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> {% block back %}
<p></p>
<article class='check-table'> <span style='text-align:center; color: #666; text-decoration: underline; cursor: pointer;' id='members-change-group'>Modifier un autre groupe</span>
<input type='hidden' id='members-member-idcluster' value='{{ core.id_cluster }}'> <p></p>
<input type='hidden' id='members-member-class' value='{{ core.class }}'>
<div> {% endblock %}
{# USER HEADER #} {% block container %}
{% 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>
<article class='check-table'>
{% for member in core.get_members(core.id_cluster, core.class) %} {% block hidden %}
{# USER ENTRIES #} <input type='hidden' id='members-member-idcluster' value='{{ core.id_cluster }}'>
{% if core.class == 0 %} <input type='hidden' id='members-member-class' value='{{ core.class }}'>
<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 %}
<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> {% block header %}
{% endif %}
{% endfor %} <div>
</article>
{# 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'> {% block form_tag %} <form class='neutral' action='' method='POST' id='choose-cluster'> {% endblock %}
<select data-name='cluster'>
<option value='.' selected disabled>Groupe à modifier</option>
{% for user_cluster in core.get_clusters(0) %} {% block input %}
<option value='u{{ user_cluster.id_user_cluster }}'>{{ user_cluster.name }} (utilisateur)</option>
{% endfor %}
{% for machine_cluster in core.get_clusters(1) %} <select data-name='cluster'>
<option value='m{{ machine_cluster.id_machine_cluster }}'>{{ machine_cluster.name }} (machine)</option> <option value='.' selected disabled>Groupe à modifier</option>
{% endfor %}
</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> </form>