Blocks in view: group.view

This commit is contained in:
xdrm-brackets 2017-11-08 20:53:21 +01:00
parent 047a71d822
commit 574e218da4
1 changed files with 118 additions and 70 deletions

View File

@ -1,65 +1,95 @@
<input type='text' class='searchbar' placeholder='Recherche'>
{% block search_bar %} <input type='text' class='searchbar' placeholder='Recherche'> {% endblock %}
{% set noresult = true %}
{% for user_cluster in core.get_clusters(0) %}
{% block user_cluster_list %}
{% for user_cluster in core.get_clusters(0) %}
{% 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 %}
<article class='inline-box' id='{{ id_user_cluster }}'>
{% block uc_card %}
<span class='title' style='color: {{ core.theme }}'>{{ user_cluster.name }}</span>
<span class='link_remove' data-cluster='{{ id_user_cluster }}'>{{ core.icon.remove | raw }}</span>
{% block uc_card_tag %} <article class='inline-box' id='{{ id_user_cluster }}'> {% endblock %}
<span class='link_edit' data-cluster='{{ id_user_cluster }}'>{{ core.icon.edit | raw }}</span>
{% block uc_card_title %} <span class='title' style='color: {{ core.theme }}'>{{ user_cluster.name }}</span> {% endblock %}
{% block uc_card_remove %} <span class='link_remove' data-cluster='{{ id_user_cluster }}'>{{ core.icon.remove | raw }}</span> {% endblock %}
{% block uc_card_edit %} <span class='link_edit' data-cluster='{{ id_user_cluster }}'>{{ core.icon.edit | raw }}</span> {% endblock %}
{% block uc_card_count %}
<span class='code'>
{{ core.icon.user | raw }}
<span>{{ memlen }} utilisateur{% if memlen > 1 %}s{% endif %}</span>
</span>
{% endblock %}
{% block uc_card_member_list %}
<span class='groups'>
{{ core.icon.group | raw }}
{% block uc_card_member %}
<span class='ignore'>
{% for user in core.get_members(user_cluster.id_user_cluster, 0) %}
<span>
{{ user.username }}
{% block uc_card_member_name %} {{ user.username }} {% endblock %}
<span class='rem-member' data-member='{{ user.id_user }}' data-cluster='{{ id_user_cluster }}'></span>
</span>
{% endfor %}
</span>
{% endblock %}
<span class='add-member' data-cluster='{{ id_user_cluster }}'>+</span>
</span>
{% endblock %}
</article>
{% endfor %}
{% endblock %}
{% endfor %}
{% endblock %}
{% for machine_cluster in core.get_clusters(1) %}
{% 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 %}
<article class='inline-box' id='{{ id_machine_cluster }}'>
{% block mc_card %}
<span class='title' style='color: {{ core.theme }}'>{{ machine_cluster.name }}</span>
<span class='link_remove' data-cluster='{{ id_machine_cluster }}'>{{ core.icon.remove | raw }}</span>
{% block mc_card_tag %} <article class='inline-box' id='{{ id_machine_cluster }}'> {% endblock %}
<span class='link_edit' data-cluster='{{ id_machine_cluster }}'>{{ core.icon.edit | raw }}</span>
{% block mc_card_title %} <span class='title' style='color: {{ core.theme }}'>{{ machine_cluster.name }}</span> {% endblock %}
{% block mc_card_remove %} <span class='link_remove' data-cluster='{{ id_machine_cluster }}'>{{ core.icon.remove | raw }}</span> {% endblock %}
{% block mc_card_edit %} <span class='link_edit' data-cluster='{{ id_machine_cluster }}'>{{ core.icon.edit | raw }}</span> {% endblock %}
{% block mc_card_count %}
<span class='code'>
{{ core.icon.device | raw }}
<span>{{ memlen }} machine{% if memlen > 1 %}s{% endif %}</span>
</span>
{% endblock %}
{% block mc_card_options %}
<span class='option'>
{{ core.icon.option | raw }}
{% for option in core.get_options(machine_cluster.id_machine_cluster) %}
@ -71,31 +101,49 @@
{% endfor %}
</span>
{% endblock %}
{% block mc_card_member_list %}
<span class='groups'>
{{ core.icon.group | raw }}
{% block mc_card_member %}
<span class='ignore'>
{% for machine in core.get_members(machine_cluster.id_machine_cluster,1) %}
<span>
{{ machine.name }}
{% block mc_card_member_name %} {{ machine.name }} {% endblock %}
<span class='rem-member' data-member='{{ machine.id_machine }}' data-cluster='{{ id_machine_cluster }}'></span>
</span>
{% endfor %}
</span>
{% endblock %}
<span class='add-member' data-cluster='{{ id_machine_cluster }}'>+</span>
</span>
{% endblock %}
</article>
{% endfor %}
{% endblock %}
{% endfor %}
{% endblock %}
{# if no result #}
{% if noresult %}
{% block no_result %}
<article class='inline-box'>
<span>Aucun groupe trouvé</span>
</article>
{% endblock %}
{% endif %}