From 6712b338412515685149c62116ba29a9e7b9cc10 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Tue, 17 Apr 2018 16:41:44 +0200 Subject: [PATCH] [build.generic.view.*group*.twig] fixed block clause that blocks counters to check if has no result --- build/generic/view/group/view/main.twig | 19 ++++++++++--------- build/generic/view/machine/group/main.twig | 2 +- build/generic/view/user/group/main.twig | 2 +- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/build/generic/view/group/view/main.twig b/build/generic/view/group/view/main.twig index dc031d5..cd4bd92 100644 --- a/build/generic/view/group/view/main.twig +++ b/build/generic/view/group/view/main.twig @@ -1,12 +1,12 @@ {% block search_bar %} {% 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 %}
- Aucun groupe trouvé + Aucun résultat {{ count }}
{% endblock %} diff --git a/build/generic/view/machine/group/main.twig b/build/generic/view/machine/group/main.twig index e836acd..b6df943 100644 --- a/build/generic/view/machine/group/main.twig +++ b/build/generic/view/machine/group/main.twig @@ -72,7 +72,7 @@ {% block no_result %}
- Aucun groupe trouvé. + Aucun groupe machine trouvé.
{% endblock %} diff --git a/build/generic/view/user/group/main.twig b/build/generic/view/user/group/main.twig index 3c37653..2431c7b 100644 --- a/build/generic/view/user/group/main.twig +++ b/build/generic/view/user/group/main.twig @@ -55,7 +55,7 @@ {% block no_result %}
- Aucun groupe trouvé. + Aucun groupe utilisateur trouvé.
{% endblock %}