N° 5874 - Quick create: improvement for newcomer

Hide Popular section when empty
This commit is contained in:
XGUI
2024-11-28 16:55:44 +01:00
parent e7a3e7de90
commit 1eaeeb502b

View File

@@ -50,22 +50,22 @@
{% endif %}
</div>
{# Popular classes section #}
<div class="ibo-quick-create--compartment-title ibo-quick-create--popular-classes--title" data-role="ibo-quick-create--compartment-title">
<span>{{ 'UI:Component:QuickCreate:MostPopular:Title'|dict_s }}</span>
</div>
<div class="ibo-quick-create--compartment-content ibo-quick-create--popular-classes--content" data-role="ibo-quick-create--compartment-content">
{% if oUIBlock.GetPopularClasses()|length > 0 %}
{% for aClass in oUIBlock.GetPopularClasses() %}
<a href="{{ aClass.target_url }}" class="ibo-quick-create--compartment-element" data-role="ibo-quick-create--compartment-element" data-class-code="{{ aQuery.class }}">
{% if aClass.icon_url is defined and aClass.icon_url is not null%}
{# Mind the empty "alt" attribute https://www.w3.org/WAI/tutorials/images/decorative/ #}
<img src="{{ aClass.icon_url}}" alt="" class="ibo-quick-create--compartment-element-image">
{% endif %}
{{ aClass.label_html|raw }}
</a>
{% endfor %}
{% endif %}
</div>
{% if oUIBlock.GetPopularClasses()|length > 0 %}
<div class="ibo-quick-create--compartment-title ibo-quick-create--popular-classes--title" data-role="ibo-quick-create--compartment-title">
<span>{{ 'UI:Component:QuickCreate:MostPopular:Title'|dict_s }}</span>
</div>
<div class="ibo-quick-create--compartment-content ibo-quick-create--popular-classes--content" data-role="ibo-quick-create--compartment-content">
{% for aClass in oUIBlock.GetPopularClasses() %}
<a href="{{ aClass.target_url }}" class="ibo-quick-create--compartment-element" data-role="ibo-quick-create--compartment-element" data-class-code="{{ aQuery.class }}">
{% if aClass.icon_url is defined and aClass.icon_url is not null%}
{# Mind the empty "alt" attribute https://www.w3.org/WAI/tutorials/images/decorative/ #}
<img src="{{ aClass.icon_url}}" alt="" class="ibo-quick-create--compartment-element-image">
{% endif %}
{{ aClass.label_html|raw }}
</a>
{% endfor %}
</div>
{% endif %}
</div>
</div>
</div>