Blocks in view: group.choice.*

This commit is contained in:
xdrm-brackets 2017-11-08 14:23:07 +01:00
parent 8ac65dc399
commit 45984b4a93
2 changed files with 99 additions and 52 deletions

View File

@ -1,50 +1,87 @@
<span style='text-align:center; color: #666; text-decoration: underline; cursor: pointer;' id='members-change-group'>Modifier un autre groupe</span>
<p></p>
{% block back %}
<article class='check-table'>
<input type='hidden' id='members-member-idcluster' value='{{ core.id_cluster }}'>
<input type='hidden' id='members-member-class' value='{{ core.class }}'>
<span style='text-align:center; color: #666; text-decoration: underline; cursor: pointer;' id='members-change-group'>Modifier un autre groupe</span>
<p></p>
<div>
{% endblock %}
{# USER HEADER #}
{% if core.class == 0 %}
<span><strong>Identifiant</strong></span>
<span><strong>Nom</strong></span>
<span><strong>Code RFID</strong></span>
{# MACHINE HEADER #}
{% else %}
<span><strong>Nom</strong></span>
{% endif %}
<span><strong>Membre de <u>{{ core.name }}</u></strong></span>
</div>
{% block container %}
<article class='check-table'>
{% for member in core.get_members(core.id_cluster, core.class) %}
{% block hidden %}
{# USER ENTRIES #}
{% if core.class == 0 %}
<div>
<span>{{ member.username }}</span>
<span>{{ member.firstname }} {{ member.lastname }}</span>
<span>{{ member.code }}</span>
<span>
<input type='checkbox' value='{{ member.id_user }}' data-name='members' id='checkbox_{{ member.id_user }}' {% if member.already %}checked{% endif %}>
<label for='checkbox_{{ member.id_user }}'></label>
</span>
<input type='hidden' id='members-member-idcluster' value='{{ core.id_cluster }}'>
<input type='hidden' id='members-member-class' value='{{ core.class }}'>
</div>
{# MACHINE ENTRIES #}
{% else %}
<div>
<span>{{ member.name }}</span>
<span>
<input type='checkbox' value='{{ member.id_machine }}' data-name='members' id='checkbox_{{ member.id_machine }}' {% if member.already %}checked{% endif %}>
<label for='checkbox_{{ member.id_machine }}'></label>
</span>
{% endblock %}
</div>
{% endif %}
{% block header %}
{% endfor %}
</article>
<div>
{# USER HEADER #}
{% if core.class == 0 %}
<span><strong>Identifiant</strong></span>
<span><strong>Nom</strong></span>
<span><strong>Code RFID</strong></span>
{# MACHINE HEADER #}
{% else %}
<span><strong>Nom</strong></span>
{% endif %}
<span><strong>Membre de <u>{{ core.name }}</u></strong></span>
</div>
{% endblock %}
{% block member_list %}
{% for member in core.get_members(core.id_cluster, core.class) %}
{% block member_entry %}
{# USER ENTRIES #}
{% if core.class == 0 %}
{% block user_entry %}
<div>
<span>{{ member.username }}</span>
<span>{{ member.firstname }} {{ member.lastname }}</span>
<span>{{ member.code }}</span>
<span>
<input type='checkbox' value='{{ member.id_user }}' data-name='members' id='checkbox_{{ member.id_user }}' {% if member.already %}checked{% endif %}>
<label for='checkbox_{{ member.id_user }}'></label>
</span>
</div>
{% endblock %}
{# MACHINE ENTRIES #}
{% else %}
{% block machine_entry %}
<div>
<span>{{ member.name }}</span>
<span>
<input type='checkbox' value='{{ member.id_machine }}' data-name='members' id='checkbox_{{ member.id_machine }}' {% if member.already %}checked{% endif %}>
<label for='checkbox_{{ member.id_machine }}'></label>
</span>
</div>
{% endblock %}
{% endif %}
{% endblock %}
{% endfor %}
{% endblock %}
</article>
{% endblock %}

View File

@ -1,16 +1,26 @@
<form class='neutral' action='' method='POST' id='choose-cluster'>
<select data-name='cluster'>
<option value='.' selected disabled>Groupe à modifier</option>
{% block form_tag %} <form class='neutral' action='' method='POST' id='choose-cluster'> {% endblock %}
{% for user_cluster in core.get_clusters(0) %}
<option value='u{{ user_cluster.id_user_cluster }}'>{{ user_cluster.name }} (utilisateur)</option>
{% endfor %}
{% block input %}
{% for machine_cluster in core.get_clusters(1) %}
<option value='m{{ machine_cluster.id_machine_cluster }}'>{{ machine_cluster.name }} (machine)</option>
{% endfor %}
<select data-name='cluster'>
<option value='.' selected disabled>Groupe à modifier</option>
</select>
{% for user_cluster in core.get_clusters(0) %}
<option value='u{{ user_cluster.id_user_cluster }}'>{{ user_cluster.name }} (utilisateur)</option>
{% endfor %}
{% for machine_cluster in core.get_clusters(1) %}
<option value='m{{ machine_cluster.id_machine_cluster }}'>{{ machine_cluster.name }} (machine)</option>
{% endfor %}
</select>
{% endblock %}
{% block submit %}
<button id='choose-cluster'>Modifier la composition</button>
{% endblock %}
<button id='choose-cluster'>Modifier la composition</button>
</form>