Manage empty results

This commit is contained in:
xdrm-brackets 2017-01-12 12:19:20 +01:00
parent e2032506f5
commit 59541a9855
5 changed files with 44 additions and 0 deletions

View File

@ -1,7 +1,10 @@
<input type='text' class='searchbar' placeholder='Recherche'> <input type='text' class='searchbar' placeholder='Recherche'>
{% set noresult = true %}
{% for user_cluster in f_clusters(0) %} {% for user_cluster in f_clusters(0) %}
{% set noresult = false %}
{% set id_user_cluster = 'u' ~ user_cluster.id_user_cluster %} {% set id_user_cluster = 'u' ~ user_cluster.id_user_cluster %}
{% set memlen = f_members(user_cluster.id_user_cluster,0) | length %} {% set memlen = f_members(user_cluster.id_user_cluster,0) | length %}
@ -37,6 +40,8 @@
{% for machine_cluster in f_clusters(1) %} {% for machine_cluster in f_clusters(1) %}
{% set noresult = false %}
{% set id_machine_cluster = 'm' ~ machine_cluster.id_machine_cluster %} {% set id_machine_cluster = 'm' ~ machine_cluster.id_machine_cluster %}
{% set memlen = f_members(machine_cluster.id_machine_cluster,1) | length %} {% set memlen = f_members(machine_cluster.id_machine_cluster,1) | length %}
@ -66,4 +71,15 @@
</span> </span>
</article> </article>
{% endfor %} {% endfor %}
{# if no result #}
{% if noresult %}
<article class='inline-box'>
<span>Aucun groupe trouvé</span>
</article>
{% endif %}

View File

@ -28,4 +28,12 @@
</span> </span>
</article> </article>
{# if no result #}
{% else %}
<article class='inline-box'>
<span>Aucun groupe trouvé.</span>
</article>
{% endfor %} {% endfor %}

View File

@ -20,4 +20,11 @@
</span> </span>
</article> </article>
{# if no result #}
{% else %}
<article class='inline-box'>
<span>Aucune machine trouvée</span>
</article>
{% endfor %} {% endfor %}

View File

@ -33,4 +33,10 @@
</article> </article>
{# if no result #}
{% else %}
<article class='inline-box'>
<span>Aucun groupe trouvé.</span>
</article>
{% endfor %} {% endfor %}

View File

@ -39,4 +39,11 @@
</article> </article>
{# if no result #}
{% else %}
<article class='inline-box'>
<span>Aucun utilisateur trouvé</span>
</article>
{% endfor %} {% endfor %}