pedagogy: simpler generation for department radio buttons

This commit is contained in:
Antoine Bartuccio 2019-07-08 15:36:30 +02:00
parent fd1f89de1d
commit 0d13014e8a
Signed by: klmp200
GPG Key ID: E7245548C53F904B

View File

@ -21,8 +21,7 @@
<button class="button-search">{% trans %}Search{% endtrans %}</button> <button class="button-search">{% trans %}Search{% endtrans %}</button>
</p> </p>
<div class="radio-guide"> <div class="radio-guide">
{% for department in [("EDIM", "EDIM"), ("ENERGIE", "EE"), ("IMSI", "IMSI"), ("INFO", "GI"), ("GMC", "MC"), ("HUMA", "HUMA"), ("TC", "TC")] %} {% for (display_name, real_name) in [("EDIM", "EDIM"), ("ENERGIE", "EE"), ("IMSI", "IMSI"), ("INFO", "GI"), ("GMC", "MC"), ("HUMA", "HUMA"), ("TC", "TC")] %}
{% set display_name, real_name = department %}
<input type="radio" name="department" id="radio{{ real_name }}" value="{{ real_name }}"><label for="radio{{ real_name }}">{% trans %}{{ display_name }}{% endtrans %}</label> <input type="radio" name="department" id="radio{{ real_name }}" value="{{ real_name }}"><label for="radio{{ real_name }}">{% trans %}{{ display_name }}{% endtrans %}</label>
{% endfor %} {% endfor %}
</div> </div>