From 59541a985571c4242b8c5f5b10615ab270a7cc4e Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Thu, 12 Jan 2017 12:19:20 +0100 Subject: [PATCH] Manage empty results --- build/viewer/view/group/view.twig | 16 ++++++++++++++++ build/viewer/view/machine/groups.twig | 8 ++++++++ build/viewer/view/machine/view.twig | 7 +++++++ build/viewer/view/user/groups.twig | 6 ++++++ build/viewer/view/user/view.twig | 7 +++++++ 5 files changed, 44 insertions(+) diff --git a/build/viewer/view/group/view.twig b/build/viewer/view/group/view.twig index 1fd57e8..1eab31c 100644 --- a/build/viewer/view/group/view.twig +++ b/build/viewer/view/group/view.twig @@ -1,7 +1,10 @@ +{% set noresult = true %} {% for user_cluster in f_clusters(0) %} + + {% set noresult = false %} {% set id_user_cluster = 'u' ~ user_cluster.id_user_cluster %} {% set memlen = f_members(user_cluster.id_user_cluster,0) | length %} @@ -37,6 +40,8 @@ {% for machine_cluster in f_clusters(1) %} + {% set noresult = false %} + {% set id_machine_cluster = 'm' ~ machine_cluster.id_machine_cluster %} {% set memlen = f_members(machine_cluster.id_machine_cluster,1) | length %} @@ -66,4 +71,15 @@ + {% endfor %} + + +{# if no result #} +{% if noresult %} + +
+ Aucun groupe trouvé +
+ +{% endif %} diff --git a/build/viewer/view/machine/groups.twig b/build/viewer/view/machine/groups.twig index c93ac6c..db72c3d 100644 --- a/build/viewer/view/machine/groups.twig +++ b/build/viewer/view/machine/groups.twig @@ -28,4 +28,12 @@ + +{# if no result #} +{% else %} + +
+ Aucun groupe trouvé. +
+ {% endfor %} diff --git a/build/viewer/view/machine/view.twig b/build/viewer/view/machine/view.twig index d6fc032..500403e 100644 --- a/build/viewer/view/machine/view.twig +++ b/build/viewer/view/machine/view.twig @@ -20,4 +20,11 @@ + +{# if no result #} +{% else %} + +
+ Aucune machine trouvée +
{% endfor %} diff --git a/build/viewer/view/user/groups.twig b/build/viewer/view/user/groups.twig index 58be65a..86ad1b3 100644 --- a/build/viewer/view/user/groups.twig +++ b/build/viewer/view/user/groups.twig @@ -33,4 +33,10 @@ +{# if no result #} +{% else %} + +
+ Aucun groupe trouvé. +
{% endfor %} diff --git a/build/viewer/view/user/view.twig b/build/viewer/view/user/view.twig index 8075070..024070e 100644 --- a/build/viewer/view/user/view.twig +++ b/build/viewer/view/user/view.twig @@ -39,4 +39,11 @@ +{# if no result #} +{% else %} + +
+ Aucun utilisateur trouvé +
+ {% endfor %}