FabulaVotes/templates/truth.html.tera
trotFunky 9911895b5b v1.0: First production version
This first version allows login of pre-existing users, creation and update of truths
by admins, vote on the truths by users, their display as well as a simple graph
for the vote results.
Everything persisting in a SQLite database.
2024-07-23 21:51:42 +01:00

26 lines
954 B
Text

<div class="individual_truth">
<h3>Vérité {{ truth.number }}</h3>
<p>{{ truth.rendered_text | safe }}</p>
{% if user.logged_in %}
<hr/>
<label>
{%- if truth.author_id == user.id -%}
Tu l'as fait :)
{%- else -%}
Qui l'a fait ?
<select form="truths" name="truth_votes[{{ truth.id }}]">
<option value="0">---</option>
{% for player in other_players %}
{# Check if we should pre-select an existing vote #}
{% if has_vote == true and player.id == user.votes[truth_index].voted_id %}
{% set is_selected = "selected" %}
{% else %}
{% set is_selected = "" %}
{% endif %}
<option value="{{ player.id }}" {{- is_selected -}}>{{ player.name }}</option>
{% endfor %}
</select>
{%- endif -%}
</label>
{% endif %}
</div>