SMMP/build/generic/view/group/permission/main.twig

87 lines
2.4 KiB
Twig

{% block search_bar %} <input type='text' class='searchbar' placeholder='Recherche'> {% endblock %}
{% for machine_cluster in core.get_clusters() %}
{% 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) %}
{% block card_title %} <span class='title' style='color: {{ core.theme }}'>{{ machine_cluster.name }}</span> {% endblock %}
{% 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>
{% 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 %}