SMMP/build/viewer/view/group/view.twig

86 lines
2.4 KiB
Twig

<input type='text' class='searchbar' placeholder='Recherche'>
{% 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 %}
<article class='inline-box' id='{{ id_user_cluster }}'>
<span class='title' style='color: {{ p_theme }}'>{{ user_cluster.name }}</span>
<span class='link_remove' data-cluster='{{ id_user_cluster }}'>{{ p_icon.remove | raw }}</span>
<span class='link_edit' data-cluster='{{ id_user_cluster }}'>{{ p_icon.edit | raw }}</span>
<span class='code'>
{{ p_icon.type | raw }}
<span>{{ memlen }} utilisateur{% if memlen > 1 %}s{% endif %}</span>
</span>
<span class='groups'>
{{ p_icon.group | raw }}
{% for user in f_members(user_cluster.id_user_cluster, 0) %}
<span>
{{ user.username }}
<span class='rem-member' data-member='{{ user.id_user }}' data-cluster='{{ id_user_cluster }}'></span>
</span>
{% endfor %}
<span class='add-member' data-cluster='{{ id_user_cluster }}'>+</span>
</span>
</article>
{% endfor %}
{% 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 %}
<article class='inline-box' id='{{ id_machine_cluster }}'>
<span class='title' style='color: {{ p_theme }}'>{{ machine_cluster.name }}</span>
<span class='link_remove' data-cluster='{{ id_machine_cluster }}'>{{ p_icon.remove | raw }}</span>
<span class='link_edit' data-cluster='{{ id_machine_cluster }}'>{{ p_icon.edit | raw }}</span>
<span class='code'>
{{ p_icon.type | raw }}
<span>{{ memlen }} machine{% if memlen > 1 %}s{% endif %}</span>
</span>
<span class='groups'>
{{ p_icon.group | raw }}
{% for machine in f_members(machine_cluster.id_machine_cluster,1) %}
<span>
{{ machine.name }}
<span class='rem-member' data-member='{{ machine.id_machine }}' data-cluster='{{ id_machine_cluster }}'></span>
</span>
{% endfor %}
<span class='add-member' data-cluster='{{ id_machine_cluster }}'>+</span>
</span>
</article>
{% endfor %}
{# if no result #}
{% if noresult %}
<article class='inline-box'>
<span>Aucun groupe trouvé</span>
</article>
{% endif %}