Automated merge with ssh://openslides.org/openslides
This commit is contained in:
commit
9de5e25ae1
@ -7,6 +7,7 @@
|
|||||||
{% blocktrans count counter=options|length %}candidate{% plural %}candidates{% endblocktrans %}
|
{% blocktrans count counter=options|length %}candidate{% plural %}candidates{% endblocktrans %}
|
||||||
</p>
|
</p>
|
||||||
<p><b>{% trans "Short description" %}:</b> {{ poll.description }}</p>
|
<p><b>{% trans "Short description" %}:</b> {{ poll.description }}</p>
|
||||||
|
<i>-1 := {% trans 'majority' %}, -2 := {% trans 'undocumented' %}</i>
|
||||||
<form action="" method="post">{% csrf_token %}
|
<form action="" method="post">{% csrf_token %}
|
||||||
<table class="table" style="width:auto;">
|
<table class="table" style="width:auto;">
|
||||||
<tr>
|
<tr>
|
||||||
@ -41,7 +42,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<a href='{% url print_assignment_poll poll.id %}'>
|
<a href='{% url print_assignment_poll poll.id %}'>
|
||||||
<button type="button">
|
<button type="button">
|
||||||
@ -49,7 +50,7 @@
|
|||||||
</button>
|
</button>
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<button type="submit">
|
<button type="submit">
|
||||||
<span class="icon ok">{%trans 'Save' %}</span>
|
<span class="icon ok">{%trans 'Save' %}</span>
|
||||||
|
@ -42,6 +42,6 @@ class OptionResultForm(Form):
|
|||||||
error_css_class = 'error'
|
error_css_class = 'error'
|
||||||
required_css_class = 'required'
|
required_css_class = 'required'
|
||||||
|
|
||||||
yes = IntegerField(min_value=-1, widget=TextInput(attrs={'class': 'small-input'}), label=_("Yes"))
|
yes = IntegerField(min_value=-2, widget=TextInput(attrs={'class': 'small-input'}), label=_("Yes"))
|
||||||
no = IntegerField(min_value=-1, required=False, widget=TextInput(attrs={'class': 'small-input'}), label=_("No"))
|
no = IntegerField(min_value=-2, required=False, widget=TextInput(attrs={'class': 'small-input'}), label=_("No"))
|
||||||
undesided = IntegerField(min_value=-1, required=False, widget=TextInput(attrs={'class': 'small-input'}), label=_("Abstention"))
|
undesided = IntegerField(min_value=-2, required=False, widget=TextInput(attrs={'class': 'small-input'}), label=_("Abstention"))
|
||||||
|
@ -71,7 +71,7 @@ class Poll(models.Model):
|
|||||||
if self.assignment:
|
if self.assignment:
|
||||||
return Poll.objects.filter(assignment=self.assignment).count()
|
return Poll.objects.filter(assignment=self.assignment).count()
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def ballot(self):
|
def ballot(self):
|
||||||
if self.application:
|
if self.application:
|
||||||
@ -125,6 +125,8 @@ class Option(models.Model):
|
|||||||
def yes(self):
|
def yes(self):
|
||||||
if self.voteyes == -1:
|
if self.voteyes == -1:
|
||||||
return _('majority')
|
return _('majority')
|
||||||
|
if self.voteyes == -2:
|
||||||
|
return _('undocumented')
|
||||||
if self.voteyes:
|
if self.voteyes:
|
||||||
return self.voteyes
|
return self.voteyes
|
||||||
return '0'
|
return '0'
|
||||||
@ -133,6 +135,8 @@ class Option(models.Model):
|
|||||||
def no(self):
|
def no(self):
|
||||||
if self.voteno == -1:
|
if self.voteno == -1:
|
||||||
return _('majority')
|
return _('majority')
|
||||||
|
if self.voteno == -2:
|
||||||
|
return _('undocumented')
|
||||||
if self.voteno:
|
if self.voteno:
|
||||||
return self.voteno
|
return self.voteno
|
||||||
return '0'
|
return '0'
|
||||||
@ -141,6 +145,8 @@ class Option(models.Model):
|
|||||||
def undesided(self):
|
def undesided(self):
|
||||||
if self.voteundesided == -1:
|
if self.voteundesided == -1:
|
||||||
return _('majority')
|
return _('majority')
|
||||||
|
if self.voteundesided == -2:
|
||||||
|
return _('undocumented')
|
||||||
if self.voteundesided:
|
if self.voteundesided:
|
||||||
return self.voteundesided
|
return self.voteundesided
|
||||||
return '0'
|
return '0'
|
||||||
@ -156,10 +162,6 @@ class Option(models.Model):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
if self.text != "" and self.text is not None:
|
if self.value:
|
||||||
return self.text
|
return unicode(self.value)
|
||||||
if self.user is not None:
|
|
||||||
return unicode(self.user)
|
|
||||||
if self.application is not None:
|
|
||||||
return unicode(self.application)
|
|
||||||
return _("No options")
|
return _("No options")
|
||||||
|
Loading…
Reference in New Issue
Block a user