[build.generic.view.*group*.twig] fixed block clause that blocks counters to check if has no result

This commit is contained in:
xdrm-brackets 2018-04-17 16:41:44 +02:00
parent 73be58df63
commit 6712b33841
3 changed files with 12 additions and 11 deletions

View File

@ -1,12 +1,12 @@
{% block search_bar %} <input type='text' class='searchbar' placeholder='Recherche'> {% endblock %}
{% set noresult = true %}
{% set count = 0 %}
{% block user_cluster_list %}
{# {% block user_cluster_list %} #}
{% for user_cluster in core.get_clusters(0) %}
{% set noresult = false %}
{% set count = count + 1 %}
{% set id_user_cluster = 'u' ~ user_cluster.id_user_cluster %}
{% set memlen = core.get_members(user_cluster.id_user_cluster,0) | length %}
@ -58,15 +58,16 @@
{% endfor %}
{% endblock %}
{# {% endblock %} #}
{% block machines_cluster_list %}
{# {% block machines_cluster_list %} #}
{% for machine_cluster in core.get_clusters(1) %}
{% set noresult = false %}
{% set count = count + 1 %}
{% set id_machine_cluster = 'm' ~ machine_cluster.id_machine_cluster %}
{% set memlen = core.get_members(machine_cluster.id_machine_cluster,1) | length %}
@ -132,16 +133,16 @@
{% endfor %}
{% endblock %}
{# {% endblock %} #}
{# if no result #}
{% if noresult %}
{% if count <= 0 %}
{% block no_result %}
<article class='inline-box'>
<span>Aucun groupe trouvé</span>
<span>Aucun résultat {{ count }}</span>
</article>
{% endblock %}

View File

@ -72,7 +72,7 @@
{% block no_result %}
<article class='inline-box'>
<span>Aucun groupe trouvé.</span>
<span>Aucun groupe machine trouvé.</span>
</article>
{% endblock %}

View File

@ -55,7 +55,7 @@
{% block no_result %}
<article class='inline-box'>
<span>Aucun groupe trouvé.</span>
<span>Aucun groupe utilisateur trouvé.</span>
</article>
{% endblock %}