Blocks in view: group.permission

This commit is contained in:
xdrm-brackets 2017-11-08 21:08:32 +01:00
parent 574e218da4
commit 0a3d4d9a0a
1 changed files with 65 additions and 29 deletions

View File

@ -1,50 +1,86 @@
<input type='text' class='searchbar' placeholder='Recherche'>
{% block search_bar %} <input type='text' class='searchbar' placeholder='Recherche'> {% endblock %}
{% for machine_cluster in core.get_clusters() %}
<article class='inline-box' id='{{ machine_cluster.id_machine_cluster }}'>
{% block machine_cluster_card %}
{% block card_tag %} <article class='inline-box' id='{{ machine_cluster.id_machine_cluster }}'> {% endblock %}
{% set nb_machines = core.get_nb_machines(machine_cluster.id_machine_cluster) %}
<span class='title' style='color: {{ core.theme }}'>{{ machine_cluster.name }}</span>
{# <span class='link_remove' data-cluster='{{ machine_cluster.id_machine_cluster }}'>{{ core.icon.remove | raw }}</span>
{% block card_title %} <span class='title' style='color: {{ core.theme }}'>{{ machine_cluster.name }}</span> {% endblock %}
<span class='link_edit' data-cluster='{{ machine_cluster.id_machine_cluster }}'>{{ core.icon.edit | raw }}</span> #}
{% block card_remove %} <span class='link_remove' data-cluster='{{ machine_cluster.id_machine_cluster }}'>{{ core.icon.remove | raw }}</span> {% endblock %}
{% block card_edit %} <span class='link_edit' data-cluster='{{ machine_cluster.id_machine_cluster }}'>{{ core.icon.edit | raw }}</span> {% endblock %}
{% block card_count %}
<span class='code'>
{{ core.icon.device | raw }}
<span>{{ nb_machines }} machines</span>
</span>
{% endblock %}
{% block card_permission_list %}
{% for permission in core.get_permissions() %}
{% block card_permission %}
<span class='groups'>
{% block card_permission_name %}
<span style='border-color: #ddd; background-color: #eee;'>
{{ core.permission_translate(permission.name, 'fr') }}
<span class='icon-permission'></span>
</span>
{% endblock %}
{% block auth_user_cluster_list %}
<span class='ignore'>
{% for user_cluster in core.get_authed_user_clusters(machine_cluster.id_machine_cluster, permission.id_permission) %}
{% block auth_user_cluster %}
<span>
{{ user_cluster.name }}
{% block auth_user_cluster_name %} {{ user_cluster.name }} {% endblock %}
<span class='rem-permission' data-permission='{{ permission.id_permission }}' data-source='{{ user_cluster.id_user_cluster }}' data-target='{{ machine_cluster.id_machine_cluster }}'></span>
</span>
{% endblock %}
{% endfor %}
</span>
{% endblock %}
<span class='add-permission' data-target='{{ machine_cluster.id_machine_cluster }}' data-permission='{{ permission.id_permission }}'>+</span>
</span>
{% endblock %}
{% endfor %}
{% endblock %}
</article>
{% endblock %}
{# if no result #}
{% else %}
{% block no_result %}
<article class='inline-box'>
<span>Aucun groupe trouvé.</span>
</article>
{% endblock %}
{% endfor %}