Add description field to questions
This commit is contained in:
parent
2011749836
commit
9c2c0cf108
@ -1,5 +1,5 @@
|
||||
# Eos - Verifiable elections
|
||||
# Copyright © 2017 RunasSudo (Yingtong Li)
|
||||
# Copyright © 2017-2019 RunasSudo (Yingtong Li)
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as published by
|
||||
@ -107,14 +107,15 @@ class UserVoter(Voter):
|
||||
return self.user.name
|
||||
|
||||
class Question(EmbeddedObject):
|
||||
_ver = StringField(default='0.7')
|
||||
|
||||
prompt = StringField()
|
||||
description = StringField()
|
||||
|
||||
class Result(EmbeddedObject):
|
||||
pass
|
||||
|
||||
class ListChoiceQuestion(Question):
|
||||
_ver = StringField(default='0.5')
|
||||
|
||||
choices = EmbeddedObjectListField()
|
||||
min_choices = IntField()
|
||||
max_choices = IntField()
|
||||
|
@ -18,6 +18,10 @@
|
||||
|
||||
<h2>{{ questionNum + 1 }}. {{ election.questions.__getitem__(questionNum).prompt }}</h2>
|
||||
|
||||
{% if election.questions.__getitem__(questionNum).description %}
|
||||
<p>{{ election.questions.__getitem__(questionNum).description | urlize | safe }}</p>
|
||||
{% endif %}
|
||||
|
||||
<p><small>
|
||||
Vote for
|
||||
{% if election.questions.__getitem__(questionNum).min_choices == election.questions.__getitem__(questionNum).max_choices %}
|
||||
|
@ -18,6 +18,10 @@
|
||||
|
||||
<h2>{{ questionNum + 1 }}. {{ election.questions.__getitem__(questionNum).prompt }}</h2>
|
||||
|
||||
{% if election.questions.__getitem__(questionNum).description %}
|
||||
<p>{{ election.questions.__getitem__(questionNum).description | urlize | safe }}</p>
|
||||
{% endif %}
|
||||
|
||||
<p><small>
|
||||
Vote for
|
||||
{% if election.questions.__getitem__(questionNum).min_choices == election.questions.__getitem__(questionNum).max_choices %}
|
||||
|
Loading…
Reference in New Issue
Block a user