ninefolio/templates/Config/render.html.twig

95 lines
5.7 KiB
Twig
Raw Normal View History

2024-09-17 14:02:17 +02:00
<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 %}
2024-10-30 17:58:39 +01:00
{% if by=="profil" %}
<a href="{{path("app_user_config_update",{by:by,id:config.id})}}"><i class="fa fa-file"></i></a>
<a href="{{path("app_user_config_delete",{by:by,id:config.id})}}"><i class="fa fa-trash"></i></a>
2024-10-26 12:08:33 +02:00
{% else %}
2024-10-30 17:58:39 +01:00
<a href="{{path("app_admin_config_update",{by:by,id:config.id,userid:userid})}}"><i class="fa fa-file"></i></a>
<a href="{{path("app_admin_config_delete",{by:by,id:config.id,userid:userid})}}"><i class="fa fa-trash"></i></a>
2024-10-26 12:08:33 +02:00
{% endif %}
2024-09-17 14:02:17 +02:00
{% 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 %}
2024-10-29 16:54:40 +01:00
<img src="{{asset("uploads/logo/"~config.value)}}" height=50px>
2024-09-17 14:02:17 +02:00
{% endif %}
{% elseif config.type=="hero" %}
{%if not config.value is empty %}
2024-10-29 16:54:40 +01:00
<img src="{{asset("uploads/hero/"~config.value)}}" style="max-width:100%">
2024-09-17 14:02:17 +02:00
{% endif %}
{% elseif config.type=="image" %}
{%if not config.value is empty %}
2024-10-29 16:54:40 +01:00
<img src="{{asset("uploads/image/"~config.value)}}" style="max-width:100%">
2024-09-17 14:02:17 +02:00
{% endif %}
{% else %}
{{ config.value|raw }}
{% endif %}
</td>
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>