Blocks in view: user.view + added blocks to machine.view

This commit is contained in:
xdrm-brackets 2017-11-08 14:10:38 +01:00
parent 4897fad9e6
commit 937515997c
2 changed files with 84 additions and 48 deletions

View File

@ -22,15 +22,19 @@
<span class='groups'>
{{ core.icon.group | raw }}
{% block group_list %}
<span class='ignore'>
{% for cluster in core.get_clusters(machine.id_machine) %}
<span>
{{ cluster.name }}
{% block group_name %} {{ cluster.name }} {% endblock %}
<span class='rem-group' data-group='{{ cluster.id_machine_cluster }}' data-machine='{{ machine.id_machine }}'></span>
</span>
{% endfor %}
</span>
{% endblock %}
<span class='add-group' data-machine='{{ machine.id_machine }}'>+</span>
</span>
@ -43,9 +47,14 @@
{# if no result #}
{% else %}
{% block no_result %}
<article class='inline-box'>
<span>Aucune machine trouvée</span>
</article>
{% endblock %}
{% endfor %}
{% endblock %}

View File

@ -1,19 +1,29 @@
<input type='text' class='searchbar' placeholder='Recherche'>
{% block search_bar %} <input type='text' class='searchbar' placeholder='Recherche'> {% endblock %}
{% block user_list %}
{% for user in core.get_users() %}
<article class='inline-box' id='{{ user.id_user }}'>
{% block user_card %}
<span class='title' style='color: {{ core.theme }}'>{{ user.firstname }} {{ user.lastname }} <span>#{{ user.username }}</span></span>
<span class='link_remove' data-user='{{ user.id_user }}'>{{ core.icon.remove | raw }}</span>
{% block card_tag %} <article class='inline-box' id='{{ user.id_user }}'> {% endblock %}
<span class='link_edit' data-user='{{ user.id_user }}'>{{ core.icon.edit | raw }}</span>
{% block card_title %} <span class='title' style='color: {{ core.theme }}'>{{ user.firstname }} {{ user.lastname }} <span>#{{ user.username }}</span></span> {% endblock %}
{% block card_remove %} <span class='link_remove' data-user='{{ user.id_user }}'>{{ core.icon.remove | raw }}</span> {% endblock %}
{% block card_edit %} <span class='link_edit' data-user='{{ user.id_user }}'>{{ core.icon.edit | raw }}</span> {% endblock %}
{% block card_code %}
<span class='code'>
{{ core.icon.card | raw }}
<span>{{ user.code }}</span>
</span>
{% endblock %}
{% block card_mail %}
<span class='mail'>
{{ core.icon.mail | raw }}
@ -22,32 +32,49 @@
</a>
</span>
{% endblock %}
{% block card_groups %}
<span class='groups'>
{{ core.icon.group | raw }}
{% block group_list %}
<span class='ignore'>
{% for cluster in core.get_clusters(user.id_user) %}
<span>
{{ cluster.name }}
{% block group_name %} {{ cluster.name }} {% endblock %}
<span class='rem-group' data-group='{{ cluster.id_user_cluster }}' data-user='{{ user.id_user }}'></span>
</span>
{% endfor %}
</span>
{% endblock %}
<span class='add-group' data-user='{{ user.id_user }}'>+</span>
</span>
{% endblock %}
</article>
{% endblock %}
{# if no result #}
{% else %}
{% block no_result %}
<article class='inline-box'>
<span>Aucun utilisateur trouvé</span>
</article>
{% endblock %}
{% endfor %}
{% endblock %}