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,101 +1,149 @@
<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 %}
{% 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 %}
<article class='inline-box' id='{{ id_user_cluster }}'>
{% set id_user_cluster = 'u' ~ user_cluster.id_user_cluster %}
{% set memlen = core.get_members(user_cluster.id_user_cluster,0) | length %}
<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 %}
<span class='link_edit' data-cluster='{{ id_user_cluster }}'>{{ core.icon.edit | raw }}</span>
{% block uc_card_tag %} <article class='inline-box' id='{{ id_user_cluster }}'> {% endblock %}
<span class='code'>
{{ core.icon.user | raw }}
<span>{{ memlen }} utilisateur{% if memlen > 1 %}s{% endif %}</span>
</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 %}
<span class='groups'>
{{ core.icon.group | raw }}
{% block uc_card_count %}
<span class='ignore'>
{% for user in core.get_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 class='code'>
{{ core.icon.user | raw }}
<span>{{ memlen }} utilisateur{% if memlen > 1 %}s{% endif %}</span>
</span>
{% endfor %}
</span>
<span class='add-member' data-cluster='{{ id_user_cluster }}'>+</span>
</span>
{% endblock %}
</article>
{% endfor %}
{% block uc_card_member_list %}
<span class='groups'>
{{ core.icon.group | raw }}
{% for machine_cluster in core.get_clusters(1) %}
{% block uc_card_member %}
{% set noresult = false %}
<span class='ignore'>
{% for user in core.get_members(user_cluster.id_user_cluster, 0) %}
<span>
{% 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>
{% set id_machine_cluster = 'm' ~ machine_cluster.id_machine_cluster %}
{% set memlen = core.get_members(machine_cluster.id_machine_cluster,1) | length %}
{% endblock %}
<article class='inline-box' id='{{ id_machine_cluster }}'>
<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>
<span class='link_edit' data-cluster='{{ id_machine_cluster }}'>{{ core.icon.edit | raw }}</span>
<span class='code'>
{{ core.icon.device | raw }}
<span>{{ memlen }} machine{% if memlen > 1 %}s{% endif %}</span>
</span>
<span class='option'>
{{ core.icon.option | raw }}
{% for option in core.get_options(machine_cluster.id_machine_cluster) %}
<span class='ignore'>
<span>{{ option.name }}:{{ option.daemon }}</span>
</span>
{% else %}
<span class='ignore'>Aucune option</span>
{% endfor %}
</span>
<span class='groups'>
{{ core.icon.group | raw }}
<span class='ignore'>
{% for machine in core.get_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 class='add-member' data-cluster='{{ id_user_cluster }}'>+</span>
</span>
{% endfor %}
</span>
<span class='add-member' data-cluster='{{ id_machine_cluster }}'>+</span>
</span>
{% endblock %}
</article>
</article>
{% 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 %} <article class='inline-box' id='{{ id_machine_cluster }}'> {% endblock %}
{% 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) %}
<span class='ignore'>
<span>{{ option.name }}:{{ option.daemon }}</span>
</span>
{% else %}
<span class='ignore'>Aucune option</span>
{% 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>
{% 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>
{% endblock %}
{% endfor %}
{% endblock %}
{# if no result #}
{% if noresult %}
<article class='inline-box'>
<span>Aucun groupe trouvé</span>
</article>
{% block no_result %}
<article class='inline-box'>
<span>Aucun groupe trouvé</span>
</article>
{% endblock %}
{% endif %}