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.
This commit is contained in:
commit
9911895b5b
22 changed files with 4790 additions and 0 deletions
26
templates/truth.html.tera
Normal file
26
templates/truth.html.tera
Normal file
|
@ -0,0 +1,26 @@
|
|||
<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>
|
Loading…
Add table
Add a link
Reference in a new issue