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'> <span class='groups'>
{{ core.icon.group | raw }} {{ core.icon.group | raw }}
{% block group_list %}
<span class='ignore'> <span class='ignore'>
{% for cluster in core.get_clusters(machine.id_machine) %} {% for cluster in core.get_clusters(machine.id_machine) %}
<span> <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 class='rem-group' data-group='{{ cluster.id_machine_cluster }}' data-machine='{{ machine.id_machine }}'></span>
</span> </span>
{% endfor %} {% endfor %}
</span> </span>
{% endblock %}
<span class='add-group' data-machine='{{ machine.id_machine }}'>+</span> <span class='add-group' data-machine='{{ machine.id_machine }}'>+</span>
</span> </span>
@ -43,9 +47,14 @@
{# if no result #} {# if no result #}
{% else %} {% else %}
{% block no_result %}
<article class='inline-box'> <article class='inline-box'>
<span>Aucune machine trouvée</span> <span>Aucune machine trouvée</span>
</article> </article>
{% endblock %}
{% endfor %} {% endfor %}
{% endblock %} {% 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 %}
{% for user in core.get_users() %} {% block user_list %}
<article class='inline-box' id='{{ user.id_user }}'> {% for user in core.get_users() %}
<span class='title' style='color: {{ core.theme }}'>{{ user.firstname }} {{ user.lastname }} <span>#{{ user.username }}</span></span> {% block user_card %}
<span class='link_remove' data-user='{{ user.id_user }}'>{{ core.icon.remove | raw }}</span>
<span class='link_edit' data-user='{{ user.id_user }}'>{{ core.icon.edit | raw }}</span> {% block card_tag %} <article class='inline-box' id='{{ user.id_user }}'> {% endblock %}
{% 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'> <span class='code'>
{{ core.icon.card | raw }} {{ core.icon.card | raw }}
<span>{{ user.code }}</span> <span>{{ user.code }}</span>
</span> </span>
{% endblock %}
{% block card_mail %}
<span class='mail'> <span class='mail'>
{{ core.icon.mail | raw }} {{ core.icon.mail | raw }}
@ -22,32 +32,49 @@
</a> </a>
</span> </span>
{% endblock %}
{% block card_groups %}
<span class='groups'> <span class='groups'>
{{ core.icon.group | raw }} {{ core.icon.group | raw }}
{% block group_list %}
<span class='ignore'> <span class='ignore'>
{% for cluster in core.get_clusters(user.id_user) %} {% for cluster in core.get_clusters(user.id_user) %}
<span> <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 class='rem-group' data-group='{{ cluster.id_user_cluster }}' data-user='{{ user.id_user }}'></span>
</span> </span>
{% endfor %} {% endfor %}
</span> </span>
{% endblock %}
<span class='add-group' data-user='{{ user.id_user }}'>+</span> <span class='add-group' data-user='{{ user.id_user }}'>+</span>
</span> </span>
{% endblock %}
</article> </article>
{# if no result #} {% endblock %}
{% else %}
{# if no result #}
{% else %}
{% block no_result %}
<article class='inline-box'> <article class='inline-box'>
<span>Aucun utilisateur trouvé</span> <span>Aucun utilisateur trouvé</span>
</article> </article>
{% endfor %} {% endblock %}
{% endfor %}
{% endblock %}