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

90 lines
2.4 KiB
Twig
Raw Permalink Normal View History

<input type='text' class='searchbar' placeholder='Recherche'>
2017-01-12 11:19:20 +00:00
{% set noresult = true %}
{% for user_cluster in f_clusters(0) %}
2017-01-12 11:19:20 +00:00
{% 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 }}
<span class='ignore'>
{% 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>
<span class='add-member' data-cluster='{{ id_user_cluster }}'>+</span>
</span>
</article>
{% endfor %}
{% for machine_cluster in f_clusters(1) %}
2017-01-12 11:19:20 +00:00
{% 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 }}
<span class='ignore'>
{% 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>
<span class='add-member' data-cluster='{{ id_machine_cluster }}'>+</span>
</span>
</article>
2017-01-12 11:19:20 +00:00
{% endfor %}
2017-01-12 11:19:20 +00:00
{# if no result #}
{% if noresult %}
<article class='inline-box'>
<span>Aucun groupe trouvé</span>
</article>
{% endif %}