70 lines
3.4 KiB
Twig
70 lines
3.4 KiB
Twig
{% set widgethaveheader=entity.viewheader %}
|
|
{%if widgethaveheader %}
|
|
{% set widgetstyle=(entity.colorheaderback ? "border-color:"~entity.colorheaderback~";" : "border-color:var(--colorbgbodydark);") %}
|
|
{% set widgetstylemenu=(entity.colorheaderback ? "background-color:"~entity.colorheaderback~";" : "background-color:var(--colorbgbodydark);")~(entity.colorheaderfont ? "color:"~entity.colorheaderfont~";" : "color:var(--colorfttitledark);") %}
|
|
{%else%}
|
|
{% set widgetstyle=(entity.colorbodyback ? "border-color:"~entity.colorbodyback~";" : "border-color:var(--colorbgbodydark);") %}
|
|
{% set widgetstylemenu="margin:-26px 0px 0px 0px; padding: 1px 10px; background-color:var(--colorbgbodydark); color: var(--colorfttitledark); border-radius: 5px;" %}
|
|
{%endif%}
|
|
|
|
{% set widgetstyleheader=(entity.colorheaderback ? "background-color:"~entity.colorheaderback~";" : "background-color:var(--colorbgbodydark);")~(entity.colorheaderfont ? "color:"~entity.colorheaderfont~";" : "color:var(--colorfttitledark);") %}
|
|
{% set widgetstylebody=(entity.colorbodyback ? "background-color:"~entity.colorbodyback~";" : "background-color:var(--colorbgbodylight);")~(entity.colorbodyfont ? "color:"~entity.colorbodyfont~";" : "color:var(--colorfttitlelight);")~(entity.isopened ? "display:block;" : "display:none;")~(widgetname=="url" ? "padding:0px;" : "")~(not widgethaveheader and not entity.border ? "padding-top: 0px" : "")~(entity.autoajust ? "" : "height:"~entity.height~"px;") %}
|
|
{% set widgeicon= entity.icon ? path('app_minio_image',{file:entity.icon.label}) : path('app_minio_image',{file:"icon/icon_pin.png"}) %}
|
|
|
|
{% if modedesktop is defined %}
|
|
{% if modedesktop==0 %}
|
|
{% set itemsize="item-verysmall" %}
|
|
{% elseif modedesktop==1 %}
|
|
{% set itemsize="item-small" %}
|
|
{% elseif modedesktop==2 %}
|
|
{% set itemsize="item-medium" %}
|
|
{% elseif modedesktop==3 %}
|
|
{% set itemsize="item-large" %}
|
|
{% elseif modedesktop==4 %}
|
|
{% set itemsize="item-list" %}
|
|
{% endif %}
|
|
{% endif %}
|
|
|
|
{% if app.user %}
|
|
{% set username = app.user.username %}
|
|
{% else %}
|
|
{% set username = "" %}
|
|
{% endif %}
|
|
|
|
{% set colorbodyfont = "color: var(--colorfttitlelight)" %}
|
|
{% if entity.colorbodyfont is not null %}
|
|
{% set colorbodyfont = "color: " ~ entity.colorbodyfont %}
|
|
{% endif %}
|
|
|
|
|
|
<div class="widget widget-{{widgetname}} {%if entity.border %} widget-bordered {%else%} widget-notbordered {%endif%} " data-id="{{ entity.id }}" loc="{{ entity.loc }}" style="{{ widgetstyle }}">
|
|
<div class="widget-menu" style="{{ widgetstylemenu }}">
|
|
{% if canupdate and not widgethaveheader %}
|
|
<i class="widget-sortable fas fa-up-down-left-right" title="Déplacer le widget"></i>
|
|
{% endif %}
|
|
|
|
{% block widgetaction %}
|
|
{% endblock %}
|
|
|
|
{% if canupdate %}
|
|
<i class="fa fa-trash fa-fw" title="Supprimer le Widget" onClick="delWidget({{ entity.id }})" ></i>
|
|
<i class="fa fa-file fa-fw" title="Modifier le Widget" onClick="modWidget({{ entity.id }})"></i>
|
|
{% endif %}
|
|
</div>
|
|
|
|
{%if widgethaveheader %}
|
|
<div class="widget-header widget-sortable" style="{{ widgetstyleheader }}">
|
|
<img class="widget-logo" src="{{widgeicon}}" />
|
|
<span class="widget-title">{{ entity.name }}</span>
|
|
</div>
|
|
{%endif%}
|
|
|
|
<div class="widget-body" style="{{ widgetstylebody }};">
|
|
{% block widgetbody %}
|
|
{% endblock %}
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|