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,7 +1,9 @@
<input type='text' class='searchbar' placeholder='Recherche'> {% block search_bar %} <input type='text' class='searchbar' placeholder='Recherche'> {% endblock %}
{% set noresult = true %} {% set noresult = true %}
{% block user_cluster_list %}
{% for user_cluster in core.get_clusters(0) %} {% for user_cluster in core.get_clusters(0) %}
{% set noresult = false %} {% set noresult = false %}
@ -9,37 +11,58 @@
{% set id_user_cluster = 'u' ~ user_cluster.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 %} {% 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> {% block uc_card_tag %} <article class='inline-box' id='{{ id_user_cluster }}'> {% endblock %}
<span class='link_remove' data-cluster='{{ id_user_cluster }}'>{{ core.icon.remove | raw }}</span>
<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'> <span class='code'>
{{ core.icon.user | raw }} {{ core.icon.user | raw }}
<span>{{ memlen }} utilisateur{% if memlen > 1 %}s{% endif %}</span> <span>{{ memlen }} utilisateur{% if memlen > 1 %}s{% endif %}</span>
</span> </span>
{% endblock %}
{% block uc_card_member_list %}
<span class='groups'> <span class='groups'>
{{ core.icon.group | raw }} {{ core.icon.group | raw }}
{% block uc_card_member %}
<span class='ignore'> <span class='ignore'>
{% for user in core.get_members(user_cluster.id_user_cluster, 0) %} {% for user in core.get_members(user_cluster.id_user_cluster, 0) %}
<span> <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 class='rem-member' data-member='{{ user.id_user }}' data-cluster='{{ id_user_cluster }}'></span>
</span> </span>
{% endfor %} {% endfor %}
</span> </span>
{% endblock %}
<span class='add-member' data-cluster='{{ id_user_cluster }}'>+</span> <span class='add-member' data-cluster='{{ id_user_cluster }}'>+</span>
</span> </span>
{% endblock %}
</article> </article>
{% endblock %}
{% endfor %} {% endfor %}
{% endblock %}
{% block machines_cluster_list %}
{% for machine_cluster in core.get_clusters(1) %} {% for machine_cluster in core.get_clusters(1) %}
@ -48,18 +71,25 @@
{% set id_machine_cluster = 'm' ~ machine_cluster.id_machine_cluster %} {% set id_machine_cluster = 'm' ~ machine_cluster.id_machine_cluster %}
{% set memlen = core.get_members(machine_cluster.id_machine_cluster,1) | length %} {% 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> {% block mc_card_tag %} <article class='inline-box' id='{{ id_machine_cluster }}'> {% endblock %}
<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> {% 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'> <span class='code'>
{{ core.icon.device | raw }} {{ core.icon.device | raw }}
<span>{{ memlen }} machine{% if memlen > 1 %}s{% endif %}</span> <span>{{ memlen }} machine{% if memlen > 1 %}s{% endif %}</span>
</span> </span>
{% endblock %}
{% block mc_card_options %}
<span class='option'> <span class='option'>
{{ core.icon.option | raw }} {{ core.icon.option | raw }}
{% for option in core.get_options(machine_cluster.id_machine_cluster) %} {% for option in core.get_options(machine_cluster.id_machine_cluster) %}
@ -71,31 +101,49 @@
{% endfor %} {% endfor %}
</span> </span>
{% endblock %}
{% block mc_card_member_list %}
<span class='groups'> <span class='groups'>
{{ core.icon.group | raw }} {{ core.icon.group | raw }}
{% block mc_card_member %}
<span class='ignore'> <span class='ignore'>
{% for machine in core.get_members(machine_cluster.id_machine_cluster,1) %} {% for machine in core.get_members(machine_cluster.id_machine_cluster,1) %}
<span> <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 class='rem-member' data-member='{{ machine.id_machine }}' data-cluster='{{ id_machine_cluster }}'></span>
</span> </span>
{% endfor %} {% endfor %}
</span> </span>
{% endblock %}
<span class='add-member' data-cluster='{{ id_machine_cluster }}'>+</span> <span class='add-member' data-cluster='{{ id_machine_cluster }}'>+</span>
</span> </span>
{% endblock %}
</article> </article>
{% endblock %}
{% endfor %} {% endfor %}
{% endblock %}
{# if no result #} {# if no result #}
{% if noresult %} {% if noresult %}
{% block no_result %}
<article class='inline-box'> <article class='inline-box'>
<span>Aucun groupe trouvé</span> <span>Aucun groupe trouvé</span>
</article> </article>
{% endblock %}
{% endif %} {% endif %}