ninefolio/templates/Config/render.html.twig
2024-10-26 12:08:33 +02:00

95 lines
5.8 KiB
Twig

<table class="table table-striped table-bordered table-hover" id="" style="width:100%">
<tbody>
{% for config in configs|sort((a, b) => a.order <=> b.order) %}
{% set continue = true %}
{% if not config.grouped is empty %}
{% if app.session.get(config.grouped)==0 %}
{% set continue = false %}
{% endif %}
{% endif %}
{%if continue %}
<tr>
<td width="70px">
{% if config.changeable %}
{% if mode=="profil" %}
<a href="{{path("app_config_user_update",{mode:mode,id:config.id})}}"><i class="fa fa-file"></i></a>
<a href="{{path("app_config_user_delete",{mode:mode,id:config.id})}}"><i class="fa fa-trash"></i></a>
{% else %}
<a href="{{path("app_config_update",{mode:mode,id:config.id,userid:userid})}}"><i class="fa fa-file"></i></a>
<a href="{{path("app_config_delete",{mode:mode,id:config.id,userid:userid})}}"><i class="fa fa-trash"></i></a>
{% endif %}
{% endif %}
</td>
<td width="50%">{{config.title}}</td>
{% set color = "" %}
{% set bgcolor = "" %}
{% set otherstyle = "" %}
{% if config.id=='colorbgbodydark' %}
{% set bgcolor = config.value %}
{% set color = app.session.get('colorfttitledark') %}
{% elseif config.id=='colorbgbodylight' %}
{% set bgcolor = config.value %}
{% set color = app.session.get('colorfttitlelight') %}
{% elseif config.id=='colorfttitledark' %}
{% set bgcolor = app.session.get('colorbgbodydark') %}
{% set color = config.value %}
{% elseif config.id=='colorfttitlelight' %}
{% set bgcolor = app.session.get('colorbgbodylight') %}
{% set color = config.value %}
{% elseif config.id=='colorftbodydark' %}
{% set bgcolor = app.session.get('colorbgbodydark') %}
{% set color = config.value %}
{% elseif config.id=='colorftbodylight' %}
{% set bgcolor = app.session.get('colorbgbodylight') %}
{% set color = config.value %}
{% elseif config.id=='logodark' %}
{% set bgcolor = app.session.get('colorbgbodydark') %}
{% set otherstyle = "text-align: center;" %}
{% elseif config.id=='logolight' %}
{% set bgcolor = app.session.get('colorbgbodylight') %}
{% set otherstyle = "text-align: center;" %}
{% elseif config.type=='hero' %}
{% set otherstyle = "text-align: center;" %}
{% elseif config.type=='image' %}
{% set otherstyle = "text-align: center;" %}
{% endif %}
<td style="overflow-wrap: anywhere; background-color: {{ bgcolor }}; color: {{color}}; {{otherstyle}}" >
{% if config.type=="thumbwidth" %}
{% if config.value=="0" %} Variable
{% elseif config.value=="1" %} 10%
{% elseif config.value=="2" %} 20%
{%endif%}
{% elseif config.type=="thumbheight" %}
{% if config.value=="0" %} Carrée
{% elseif config.value=="1" %} Proportionnelle
{%endif%}
{% elseif config.type=="boolean" %}
{% if config.value=="0" %} Non
{% elseif config.value=="1" %} Oui
{%endif%}
{% elseif config.type=="logo" %}
{%if not config.value is empty %}
<img src="/{{appAlias}}/uploads/logo/{{ config.value }}" height=50px>
{% endif %}
{% elseif config.type=="hero" %}
{%if not config.value is empty %}
<img src="/{{appAlias}}/uploads/hero/{{ config.value }}" style="max-width:100%">
{% endif %}
{% elseif config.type=="image" %}
{%if not config.value is empty %}
<img src="/{{appAlias}}/uploads/image/{{ config.value }}" style="max-width:100%">
{% endif %}
{% else %}
{{ config.value|raw }}
{% endif %}
</td>
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>