warning only if closed

This commit is contained in:
Ville Rantanen
2018-12-14 11:33:32 +02:00
parent ef1da64dc7
commit 5554aa000c
2 changed files with 9 additions and 1 deletions

View File

@@ -71,7 +71,13 @@ def vote(key, token = None):
return render_template('blank.html', message = "Token already used")
valid_for = time_to_expiry(form)
return render_template('vote.html', form = form, key = key, token = token, valid_for = valid_for)
return render_template(
'vote.html',
form = form,
key = key,
token = token,
valid_for = valid_for
)
@app.route('/save', methods=['POST'])

View File

@@ -8,6 +8,7 @@
{% include "questions.html" %}
<p>
<input type=submit name=submit value="Submit"/><br>
{% if form.vote_style == 'closed' %}
<div class = "warning">
You can only vote once!
<ul>
@@ -15,6 +16,7 @@
<li>Empty choices counts as empty, used vote</li>
</ul>
</div>
{% endif %}
</p>
</form>
{% endblock %}