Added sublabel, label classes and icon help to list field (#2384)

* Added descriptioin option and icon help to list field

* Changed description by sublabel in the list field. Added label classes

* Changed description by sublabel in the list field. Added label classes

* Options to add description, sublabel and help to the list field.

* Added description, sublabel and icon help to field. Field classes are also added

* Removed duplicate description
This commit is contained in:
pmoreno.rodriguez
2024-01-27 20:06:57 +01:00
committed by GitHub
parent 8b089b54f5
commit 795585db6a
2 changed files with 21 additions and 4 deletions

View File

@@ -42,7 +42,7 @@
<label for="toggleable_{{ field.name }}"></label>
</span>
{% endif %}
<label{{ (toggleable ? ' class="toggleable" for="toggleable_' ~ field.name ~ '"')|raw }}>
<label{{ (field.toggleable ? ' class="toggleable ' ~ field.classes ~ '" for="toggleable_' ~ field.name ~ '"' : ' class="' ~ field.classes ~ '"')|raw }}>
{% block label %}
{% if field.help %}
{% if field.markdown %}

View File

@@ -19,14 +19,32 @@
<label for="toggleable_{{ field.name }}"></label>
</span>
{% endif %}
<label{{ (field.toggleable ? ' class="toggleable" for="toggleable_' ~ field.name ~ '"')|raw }}>
<label{{ (field.toggleable ? ' class="toggleable ' ~ field.classes ~ '" for="toggleable_' ~ field.name ~ '"' : ' class="' ~ field.classes ~ '"')|raw }}>
{% if field.help %}
<span class="hint--bottom" data-hint="{{ field.help|t }}">{{ field.label|t }}</span>
{% if field.markdown %}
<span class="hint--bottom" data-hint="{{ field.help|t|markdown(false) }}">{{ field.label|t|markdown(false)|raw }} <i class="hint-icon fa fa-question-circle" aria-hidden="true"></i></span>
{% else %}
<span class="hint--bottom" data-hint="{{ field.help|t }}">{{ field.label|t|raw }} <i class="hint-icon fa fa-question-circle" aria-hidden="true"></i></span>
{% endif %}
{% else %}
{{ field.label|t }}
{% endif %}
{{ field.validate.required in ['on', 'true', 1] ? '<span class="required">*</span>' }}
</label>
{% if field.description %}
<div class="form-extra-wrapper">
<span class="form-description">{{ field.description|t|markdown(false)|raw }}</span>
</div>
{% endif %}
{% if field.sublabel %}
<div class="form-sublabel">
{% if field.markdown %}
{{ field.sublabel|t|markdown(false)|raw }}
{% else %}
{{ field.sublabel|t|raw }}
{% endif %}
</div>
{% endif %}
</div>
<div class="form-data{% if not vertical %} block size-2-3 pure-u-2-3{% endif %}"
{% block global_attributes %}
@@ -185,4 +203,3 @@
</div>
</div>
{% endblock %}