74 lines
2.9 KiB
Twig
74 lines
2.9 KiB
Twig
{% set theme = app.session.get('theme') %}
|
|
{% if theme is not empty %}
|
|
{{ include('@Theme/'~theme~'/function.html.twig') }}
|
|
{% endif %}
|
|
|
|
{% import "@CadolesPortal/Pagewidget/constants.twig" as constants %}
|
|
|
|
{% set stylewidget = constants.mystylewidget(entity) %}
|
|
{% set stylewidgetmenu = constants.mystylewidgetmenu(entity) %}
|
|
{% set stylewidgetheader = constants.mystylewidgetheader(entity) %}
|
|
{% set stylewidgetbody = constants.mystylewidgetbody(entity) %}
|
|
{% set color = app.session.get('color') %}
|
|
|
|
<style>
|
|
|
|
|
|
|
|
</style>
|
|
|
|
<div class="widget {%if entity.border %} widget-bordered {%endif%}" data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ stylewidget }}" height="{{ entity.height }}px">
|
|
<div class="widgetmenu">
|
|
{% if canupdate %}
|
|
<i class="fa fa-trash fa-fw" onClick="delWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
|
<i class="fa fa-file fa-fw" onClick="modWidget({{ entity.id }})" style="{{ stylewidgetmenu }}"></i>
|
|
{% endif %}
|
|
<a onClick="showFrameitem('calendar','{{ path('cadoles_portal_'~access~'_calendar_view') }}',true)" style="{{ stylewidgetmenu }}"><i class="fa fa-calendar fa-fw"></i></a>
|
|
</div>
|
|
|
|
<div class="widgetheader" style="{{ stylewidgetheader }}">
|
|
<img src="/{{ alias }}/{{ entity.icon.label }}" class="logo"/>
|
|
<span class="title">{{ entity.name }}</span>
|
|
</div>
|
|
|
|
{% set firstflux="" %}
|
|
|
|
<div class="widgetbody" style="{{ stylewidgetbody }}">
|
|
{% set monthsel = "" %}
|
|
{% for i in 0..(nbday-1) %}
|
|
{% set dateeventstart = 'now'|date_modify("+"~i~" day midnight") %}
|
|
{% set dateeventend = 'now'|date_modify("+"~(i+1)~" day midnight") %}
|
|
|
|
{% set fgaffday=false %}
|
|
{% for event in events %}
|
|
{% if event.start< dateeventend and event.end>=dateeventstart %}
|
|
|
|
{% if monthsel == "" or dateeventstart|date("Y-m")!=monthsel %}
|
|
{% set monthsel = dateeventstart|date("Y-m") %}
|
|
{% set libmonth = constants.libmonth(dateeventstart|date("m")) %}
|
|
<h3>{{ libmonth ~ " " ~ dateeventstart|date("Y") }}</h3>
|
|
{% endif %}
|
|
|
|
{% if not fgaffday %}
|
|
{% set fgaffday=true %}
|
|
{% set libday = constants.libday(dateeventstart|date("N")) %}
|
|
<div style="margin-top:15px; font-weight:bold; font-size:18px;">{{ libday ~ " " ~ dateeventstart|date("d/m/Y") }}</div>
|
|
{% endif %}
|
|
|
|
<div style="background-color:{{ event.color }}; color: #FFF; padding:2px;">
|
|
{% if not event.allDay %}
|
|
{{ event.start | date("H:i") }} -
|
|
{%endif%}
|
|
{{ event.title }}
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|