FabulaVotes/templates/truth_editor.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
797 B
Text

<textarea class="truth_editor" name="truth_raw_text">
{%- if truth.raw_text -%}
{{- truth.raw_text -}}
{%- endif -%}
</textarea>
<label>Qui l'a écrit ?
<select name="truth_author">
<option value="0">---</option>
{% for player in other_players %}
{# Check if we should pre-select if the truth already exists #}
{% if truth.author_id and player.id == truth.author_id %}
{% set is_selected = "selected" %}
{% else %}
{% set is_selected = "" %}
{% endif %}
<option value="{{ player.id }}" {{- is_selected -}}>{{ player.name }}</option>
{% endfor %}
</select>
</label>
<button>
{%- if not truth.author_id -%}
Ajouter une vérité
{%- else -%}
Modifier la vérité
{%- endif -%}
</button>