nineskeletor/templates/Config/render.html.twig

93 lines
5.2 KiB
Twig
Raw Normal View History

2022-07-21 16:15:47 +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 %}
<a href="{{path("app_admin_config_update",{id:config.id})}}"><i class="fa fa-file"></i></a>
{% endif %}
{% if not config.required %}
<a href="{{path("app_admin_config_delete",{id:config.id})}}"><i class="fa fa-trash"></i></a>
{% endif %}
</td>
<td width="50%">{{config.title}}</td>
{% set val = config.value %}
{% if val is empty %}
{% set val=app.session.get(config.id) %}
{% endif %}
{% set color = "" %}
{% set bgcolor = "" %}
{% set otherstyle = "" %}
{% if config.id=='colorbgbodydark' %}
{% set bgcolor = val %}
{% set color = app.session.get('colorftbodydark') %}
{% elseif config.id=='colorbgbodylight' %}
{% set bgcolor = val %}
{% set color = app.session.get('colorftbodylight') %}
2023-02-16 17:03:53 +01:00
{% elseif config.id=='colorbgbodyimportant' %}
{% set bgcolor = val %}
{% set color = app.session.get('colorftbodydark') %}
2022-07-21 16:15:47 +02:00
{% elseif config.id=='colorfttitledark' %}
{% set bgcolor = app.session.get('colorbgbodydark') %}
{% set color = val %}
{% elseif config.id=='colorfttitlelight' %}
{% set bgcolor = app.session.get('colorbgbodylight') %}
{% set color = val %}
{% elseif config.id=='colorftbodydark' %}
{% set bgcolor = app.session.get('colorbgbodydark') %}
{% set color = val %}
{% elseif config.id=='colorftbodylight' %}
{% set bgcolor = app.session.get('colorbgbodylight') %}
{% set color = val %}
{% elseif config.id=='fonttitle' %}
{% set color = app.session.get('colorfttitlelight') %}
{% set otherstyle = "font-family: "~val~";" %}
{% 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;" %}
{% endif %}
<td style="overflow-wrap: anywhere; background-color: {{ bgcolor }}; color: {{color}}; {{otherstyle}}" >
{% if config.type=="boolean" %}
{% if val=="0" %} Non
{% elseif val=="1" %} Oui
{%endif%}
{% elseif config.type=="logo" %}
{%if not val is empty %}
2022-08-31 11:20:22 +02:00
<img src="{{path("app_minio_image",{file:"logo/"~val}) }}" height=50px>
2022-07-21 16:15:47 +02:00
{% endif %}
{% elseif config.type=="header" %}
{%if not val is empty %}
2022-08-31 11:20:22 +02:00
<img src="{{ path("app_minio_image",{file:"header/"~val}) }}" width="100%">
2022-07-21 16:15:47 +02:00
{% endif %}
2023-02-16 17:03:53 +01:00
{% elseif config.type=="image" %}
{%if not val is empty %}
<img src="{{ path("app_minio_image",{file:val}) }}" width="100%">
{% endif %}
2022-07-21 16:15:47 +02:00
{% else %}
{{ val|raw }}
{% endif %}
</td>
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>