Opti (min) for twig

This commit is contained in:
xdrm-brackets 2017-01-12 06:50:14 +01:00
parent 11988e3735
commit 69fdaf8d2f
3 changed files with 25 additions and 13 deletions

View File

@ -1,18 +1,25 @@
<input type='text' class='searchbar' placeholder='Recherche'> <input type='text' class='searchbar' placeholder='Recherche'>
<article class='inline-row' style='border: 0; box-shadow: none;background: transparent;'>
<span>Machine</span>
<span>Dernière utilisation</span>
<span>Utilisateur</span>
<span>Action</span>
<span>Historique détaillé</span>
</article>
{% for entry in f_history() %} {% for entry in f_history() %}
{% if loop.index == 1 %}
<article class='inline-row' style='border: 0; box-shadow: none;background: transparent;'>
<span>Machine</span>
<span>Dernière utilisation</span>
<span>Utilisateur</span>
<span>Action</span>
<span>Historique détaillé</span>
</article>
{% endif %}
<article class='inline-row' data-history='{{ entry.id_history }}'> <article class='inline-row' data-history='{{ entry.id_history }}'>
<span class='title'><span>#{{ entry.machine_name }}</span></span> <span data-machine='{{ entry.id_machine }}' class='title'><span>#{{ entry.machine_name }}</span></span>
<span> <span>
<span>{{ entry.timestamp | f_tsformat }}</span> <span>{{ entry.timestamp | f_tsformat }}</span>
@ -20,7 +27,7 @@
</span> </span>
<span> <span data-user='{{ entry.id_user }}'>
<span>{{ entry.user_name }}</span> <span>{{ entry.user_name }}</span>
<span style='color:#aaa;'>{{ entry.user_firstname }} {{ entry.user_lastname }}</span> <span style='color:#aaa;'>{{ entry.user_firstname }} {{ entry.user_lastname }}</span>
</span> </span>

View File

@ -3,6 +3,8 @@
{% for cluster in f_clusters() %} {% for cluster in f_clusters() %}
<article class='inline-box' id='{{ cluster.id_machine_cluster }}'> <article class='inline-box' id='{{ cluster.id_machine_cluster }}'>
{% set machinelist = f_machines(cluster.id_machine_cluster) %}
<span class='title' style='color: {{ p_theme }}'>{{ cluster.name }}</span> <span class='title' style='color: {{ p_theme }}'>{{ cluster.name }}</span>
<span class='link_remove' data-cluster='{{ cluster.id_machine_cluster }}'>{{ p_icon.remove | raw }}</span> <span class='link_remove' data-cluster='{{ cluster.id_machine_cluster }}'>{{ p_icon.remove | raw }}</span>
@ -10,13 +12,13 @@
<span class='code'> <span class='code'>
{{ p_icon.device | raw }} {{ p_icon.device | raw }}
<span>{{ f_machines(cluster.id_machine_cluster) | length }} machines</span> <span>{{ machinelist | length }} machines</span>
</span> </span>
<span class='groups'> <span class='groups'>
{{ p_icon.group | raw }} {{ p_icon.group | raw }}
{% for machine in f_machines(cluster.id_machine_cluster) %} {% for machine in machinelist %}
<span> <span>
{{ machine.name }} {{ machine.name }}
<span class='rem-member' data-member='{{ machine.id_machine }}' data-cluster='{{ cluster.id_machine_cluster }}'></span> <span class='rem-member' data-member='{{ machine.id_machine }}' data-cluster='{{ cluster.id_machine_cluster }}'></span>

View File

@ -2,6 +2,9 @@
{% for cluster in f_clusters() %} {% for cluster in f_clusters() %}
<article class='inline-box' id='{{ cluster.id_user_cluster }}'> <article class='inline-box' id='{{ cluster.id_user_cluster }}'>
{% set userlist = f_users(cluster.id_user_cluster) %}
<span class='title' style='color: {{ p_theme }}'>{{ cluster.name }}</span> <span class='title' style='color: {{ p_theme }}'>{{ cluster.name }}</span>
<span class='link_remove' data-cluster='{{ cluster.id_user_cluster }}'>{{ p_icon.remove | raw }}</span> <span class='link_remove' data-cluster='{{ cluster.id_user_cluster }}'>{{ p_icon.remove | raw }}</span>
@ -10,13 +13,13 @@
<span class='code'> <span class='code'>
{{ p_icon.type | raw }} {{ p_icon.type | raw }}
<span>{{ f_users(cluster.id_user_cluster) | length }} utilisateurs</span> <span>{{ userlist | length }} utilisateurs</span>
</span> </span>
<span class='groups'> <span class='groups'>
{{ p_icon.group | raw }} {{ p_icon.group | raw }}
{% for user in f_users(cluster.id_user_cluster) %} {% for user in userlist %}
<span> <span>
{{ user.username }} {{ user.username }}