On utilise l'abbréviation dans les résultats

This commit is contained in:
Tom Hubrecht 2021-04-17 08:37:23 +02:00
parent 15f160a0e6
commit bd968d55c1
4 changed files with 9 additions and 7 deletions

View file

@ -206,7 +206,7 @@
<span class="icon">
<i class="fas fa-layer-group"></i>
</span>
<span>{{ forloop.counter }}</span>
<span>{% if o.abbreviation %}{{ o.abbreviation }}{% else %}{{ forloop.counter }}{% endif %}</span>
{% endif %}
</span>
{% endif %}

View file

@ -226,7 +226,7 @@
<span class="icon">
<i class="fas fa-layer-group"></i>
</span>
<span>{{ forloop.counter }}</span>
<span>{% if o.abbreviation %}{{ o.abbreviation }}{% else %}{{ forloop.counter }}{% endif %}</span>
{% endif %}
</span>
{% endif %}

View file

@ -10,20 +10,20 @@
<i class="fas fa-undo-alt"></i>
</span>
</th>
{% for i in range %}
{% for o in options %}
<th class="has-text-centered">
<span class="icon-text">
<span class="icon">
<i class="fas fa-layer-group"></i>
</span>
<span>{{ i }}</span>
<span>{% if o.abbreviation %}{{ o.abbreviation }}{% else %}{{ forloop.counter }}{% endif %}</span>
</span>
</th>
{% endfor %}
</thead>
<tbody>
{% for line in matrix %}
{% for line, o in matrix %}
{% with loser=forloop.counter %}
<tr>
<th class="has-text-centered">
@ -31,7 +31,7 @@
<span class="icon">
<i class="fas fa-layer-group"></i>
</span>
<span>{{ forloop.counter }}</span>
<span>{% if o.abbreviation %}{{ o.abbreviation }}{% else %}{{ forloop.counter }}{% endif %}</span>
</span>
</th>

View file

@ -265,9 +265,11 @@ class ResultsData:
else:
matrix[i, j] = (_matrix[i, j], "")
matrix = zip(matrix.tolist(), options)
return render_to_string(
"elections/results/rank.html",
{"q": question, "matrix": matrix, "range": range(1, n + 1)},
{"q": question, "matrix": matrix, "options": options},
)