Add description field to questions
This commit is contained in:
parent
2011749836
commit
9c2c0cf108
@ -1,5 +1,5 @@
|
|||||||
# Eos - Verifiable elections
|
# 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
|
# 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
|
# 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
|
return self.user.name
|
||||||
|
|
||||||
class Question(EmbeddedObject):
|
class Question(EmbeddedObject):
|
||||||
|
_ver = StringField(default='0.7')
|
||||||
|
|
||||||
prompt = StringField()
|
prompt = StringField()
|
||||||
|
description = StringField()
|
||||||
|
|
||||||
class Result(EmbeddedObject):
|
class Result(EmbeddedObject):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
class ListChoiceQuestion(Question):
|
class ListChoiceQuestion(Question):
|
||||||
_ver = StringField(default='0.5')
|
|
||||||
|
|
||||||
choices = EmbeddedObjectListField()
|
choices = EmbeddedObjectListField()
|
||||||
min_choices = IntField()
|
min_choices = IntField()
|
||||||
max_choices = IntField()
|
max_choices = IntField()
|
||||||
|
@ -18,6 +18,10 @@
|
|||||||
|
|
||||||
<h2>{{ questionNum + 1 }}. {{ election.questions.__getitem__(questionNum).prompt }}</h2>
|
<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>
|
<p><small>
|
||||||
Vote for
|
Vote for
|
||||||
{% if election.questions.__getitem__(questionNum).min_choices == election.questions.__getitem__(questionNum).max_choices %}
|
{% 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>
|
<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>
|
<p><small>
|
||||||
Vote for
|
Vote for
|
||||||
{% if election.questions.__getitem__(questionNum).min_choices == election.questions.__getitem__(questionNum).max_choices %}
|
{% if election.questions.__getitem__(questionNum).min_choices == election.questions.__getitem__(questionNum).max_choices %}
|
||||||
|
Loading…
Reference in New Issue
Block a user