From 574e218da44ae17a0abfa212ea198e56e7d83a8b Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Wed, 8 Nov 2017 20:53:21 +0100 Subject: [PATCH] Blocks in view: group.view --- build/generic/view/group/view/main.twig | 188 +++++++++++++++--------- 1 file changed, 118 insertions(+), 70 deletions(-) diff --git a/build/generic/view/group/view/main.twig b/build/generic/view/group/view/main.twig index e7119df..dc031d5 100644 --- a/build/generic/view/group/view/main.twig +++ b/build/generic/view/group/view/main.twig @@ -1,101 +1,149 @@ - +{% block search_bar %} {% endblock %} {% set noresult = true %} -{% for user_cluster in core.get_clusters(0) %} +{% block user_cluster_list %} - {% set noresult = false %} + {% for user_cluster in core.get_clusters(0) %} - {% set id_user_cluster = 'u' ~ user_cluster.id_user_cluster %} - {% set memlen = core.get_members(user_cluster.id_user_cluster,0) | length %} + {% set noresult = false %} -
+ {% set id_user_cluster = 'u' ~ user_cluster.id_user_cluster %} + {% set memlen = core.get_members(user_cluster.id_user_cluster,0) | length %} - {{ user_cluster.name }} - {{ core.icon.remove | raw }} + {% block uc_card %} - {{ core.icon.edit | raw }} + {% block uc_card_tag %}
{% endblock %} - - {{ core.icon.user | raw }} - {{ memlen }} utilisateur{% if memlen > 1 %}s{% endif %} - + {% block uc_card_title %} {{ user_cluster.name }} {% endblock %} + {% block uc_card_remove %} {{ core.icon.remove | raw }} {% endblock %} + {% block uc_card_edit %} {{ core.icon.edit | raw }} {% endblock %} - - {{ core.icon.group | raw }} + {% block uc_card_count %} - - {% for user in core.get_members(user_cluster.id_user_cluster, 0) %} - - {{ user.username }} - + + {{ core.icon.user | raw }} + {{ memlen }} utilisateur{% if memlen > 1 %}s{% endif %} - {% endfor %} - - + - + {% endblock %} -
-{% endfor %} + {% block uc_card_member_list %} + + {{ core.icon.group | raw }} -{% for machine_cluster in core.get_clusters(1) %} + {% block uc_card_member %} - {% set noresult = false %} + + {% for user in core.get_members(user_cluster.id_user_cluster, 0) %} + + {% block uc_card_member_name %} {{ user.username }} {% endblock %} + + + {% endfor %} + - {% set id_machine_cluster = 'm' ~ machine_cluster.id_machine_cluster %} - {% set memlen = core.get_members(machine_cluster.id_machine_cluster,1) | length %} + {% endblock %} -
- - {{ machine_cluster.name }} - {{ core.icon.remove | raw }} - - {{ core.icon.edit | raw }} - - - {{ core.icon.device | raw }} - {{ memlen }} machine{% if memlen > 1 %}s{% endif %} - - - - {{ core.icon.option | raw }} - {% for option in core.get_options(machine_cluster.id_machine_cluster) %} - - {{ option.name }}:{{ option.daemon }} - - {% else %} - Aucune option - {% endfor %} - - - - {{ core.icon.group | raw }} - - - {% for machine in core.get_members(machine_cluster.id_machine_cluster,1) %} - - {{ machine.name }} - + + - {% endfor %} - - + - + {% endblock %} -
+
-{% endfor %} + {% endblock %} + + {% endfor %} + +{% endblock %} + + + +{% block machines_cluster_list %} + + {% for machine_cluster in core.get_clusters(1) %} + + {% set noresult = false %} + + {% set id_machine_cluster = 'm' ~ machine_cluster.id_machine_cluster %} + {% set memlen = core.get_members(machine_cluster.id_machine_cluster,1) | length %} + + {% block mc_card %} + + {% block mc_card_tag %}
{% endblock %} + + {% block mc_card_title %} {{ machine_cluster.name }} {% endblock %} + {% block mc_card_remove %} {{ core.icon.remove | raw }} {% endblock %} + {% block mc_card_edit %} {{ core.icon.edit | raw }} {% endblock %} + + {% block mc_card_count %} + + + {{ core.icon.device | raw }} + {{ memlen }} machine{% if memlen > 1 %}s{% endif %} + + + {% endblock %} + + {% block mc_card_options %} + + + {{ core.icon.option | raw }} + {% for option in core.get_options(machine_cluster.id_machine_cluster) %} + + {{ option.name }}:{{ option.daemon }} + + {% else %} + Aucune option + {% endfor %} + + + {% endblock %} + + {% block mc_card_member_list %} + + + {{ core.icon.group | raw }} + + {% block mc_card_member %} + + + {% for machine in core.get_members(machine_cluster.id_machine_cluster,1) %} + + {% block mc_card_member_name %} {{ machine.name }} {% endblock %} + + + {% endfor %} + + + {% endblock %} + + + + + + {% endblock %} + +
+ + {% endblock %} + + {% endfor %} + +{% endblock %} {# if no result #} {% if noresult %} -
- Aucun groupe trouvé -
+ {% block no_result %} + +
+ Aucun groupe trouvé +
+ + {% endblock %} {% endif %}