Allow to define icons for settings

This commit is contained in:
Jan Böhmer 2024-08-04 00:00:38 +02:00
parent 947cce78d7
commit 47830dcd08
8 changed files with 72 additions and 3 deletions

View file

@ -32,9 +32,12 @@
{{ form_errors(tab_widget) }}
{% for section_widget in tab_widget %}
{% set settings_object = section_widget.vars.value %}
{% if section_widget.vars.compound ?? false %}
<fieldset>
<legend>
<legend class="offset-3">
<i class="fa-solid {{ settings_icon(settings_object)|default('fa-sliders') }} fa-fw"></i>
{{ (section_widget.vars.label ?? section_widget.vars.name|humanize)|trans }}
</legend>
{{ form_help(section_widget) }}
@ -42,7 +45,7 @@
{{ form_widget(section_widget) }}
</fieldset>
{% if not loop.last %}
<hr class="m-0">
<hr class="mx-0 mb-2 mt-2">
{% endif %}
{% else %} {# If not a compound render as normal row #}
{{ form_row(section_widget) }}