commit
50a6113703
@ -85,7 +85,7 @@ class Assignment(models.Model, SlideMixin):
|
|||||||
raise NameError(_('<b>%s</b> is already a candidate.') % candidate)
|
raise NameError(_('<b>%s</b> is already a candidate.') % candidate)
|
||||||
if not person.has_perm("assignment.can_manage_assignment") and self.status != 'sea':
|
if not person.has_perm("assignment.can_manage_assignment") and self.status != 'sea':
|
||||||
raise NameError(_('The candidate list is already closed.'))
|
raise NameError(_('The candidate list is already closed.'))
|
||||||
candidation = self.assignment_candidats.filter(person=candidate)
|
candidation = self.assignment_candidates.filter(person=candidate)
|
||||||
if candidation and candidate != person and \
|
if candidation and candidate != person and \
|
||||||
not person.has_perm("assignment.can_manage_assignment"):
|
not person.has_perm("assignment.can_manage_assignment"):
|
||||||
# if the candidation is blocked and anotherone tries to run the
|
# if the candidation is blocked and anotherone tries to run the
|
||||||
@ -103,9 +103,8 @@ class Assignment(models.Model, SlideMixin):
|
|||||||
stop running for a vote
|
stop running for a vote
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
candidation = self.assignment_candidats.get(person=candidate)
|
candidation = self.assignment_candidates.get(person=candidate)
|
||||||
except AssignmentCandidate.DoesNotExist:
|
except AssignmentCandidate.DoesNotExist:
|
||||||
# TODO: Use an OpenSlides Error
|
|
||||||
raise Exception(_('%s is no candidate') % candidate)
|
raise Exception(_('%s is no candidate') % candidate)
|
||||||
|
|
||||||
if not candidation.blocked:
|
if not candidation.blocked:
|
||||||
@ -123,7 +122,7 @@ class Assignment(models.Model, SlideMixin):
|
|||||||
return True, if person is a candidate.
|
return True, if person is a candidate.
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
return self.assignment_candidats.filter(person=person) \
|
return self.assignment_candidates.filter(person=person) \
|
||||||
.exclude(blocked=True).exists()
|
.exclude(blocked=True).exists()
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
return False
|
return False
|
||||||
@ -132,11 +131,11 @@ class Assignment(models.Model, SlideMixin):
|
|||||||
"""
|
"""
|
||||||
return True, if the person is blockt for candidation.
|
return True, if the person is blockt for candidation.
|
||||||
"""
|
"""
|
||||||
return self.assignment_candidats.filter(person=person) \
|
return self.assignment_candidates.filter(person=person) \
|
||||||
.filter(blocked=True).exists()
|
.filter(blocked=True).exists()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def assignment_candidats(self):
|
def assignment_candidates(self):
|
||||||
return AssignmentCandidate.objects.filter(assignment=self)
|
return AssignmentCandidate.objects.filter(assignment=self)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -148,7 +147,7 @@ class Assignment(models.Model, SlideMixin):
|
|||||||
return self.get_participants(only_elected=True)
|
return self.get_participants(only_elected=True)
|
||||||
|
|
||||||
def get_participants(self, only_elected=False, only_candidate=False):
|
def get_participants(self, only_elected=False, only_candidate=False):
|
||||||
candidates = self.assignment_candidats.exclude(blocked=True)
|
candidates = self.assignment_candidates.exclude(blocked=True)
|
||||||
|
|
||||||
assert not (only_elected and only_candidate)
|
assert not (only_elected and only_candidate)
|
||||||
|
|
||||||
@ -166,7 +165,7 @@ class Assignment(models.Model, SlideMixin):
|
|||||||
|
|
||||||
|
|
||||||
def set_elected(self, person, value=True):
|
def set_elected(self, person, value=True):
|
||||||
candidate = self.assignment_candidats.get(person=person)
|
candidate = self.assignment_candidates.get(person=person)
|
||||||
candidate.elected = value
|
candidate.elected = value
|
||||||
candidate.save()
|
candidate.save()
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@
|
|||||||
</ul>
|
</ul>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if assignment.status != "sea" %}
|
{% if assignment.status != "sea" or polls.exists %}
|
||||||
<h3>{% trans "Election results" %}</h3>
|
<h3>{% trans "Election results" %}</h3>
|
||||||
|
|
||||||
{% if polls.exists %}
|
{% if polls.exists %}
|
||||||
|
@ -101,7 +101,7 @@ def view(request, assignment_id=None):
|
|||||||
vote_results = assignment.vote_results(only_published=False)
|
vote_results = assignment.vote_results(only_published=False)
|
||||||
|
|
||||||
blocked_candidates = [candidate.person for candidate in \
|
blocked_candidates = [candidate.person for candidate in \
|
||||||
assignment.assignment_candidats.filter(blocked=True)]
|
assignment.assignment_candidates.filter(blocked=True)]
|
||||||
return {
|
return {
|
||||||
'assignment': assignment,
|
'assignment': assignment,
|
||||||
'blocked_candidates': blocked_candidates,
|
'blocked_candidates': blocked_candidates,
|
||||||
@ -170,6 +170,8 @@ def set_status(request, assignment_id=None, status=None):
|
|||||||
messages.success(request, _('Election status was set to: <b>%s</b>.') % assignment.get_status_display())
|
messages.success(request, _('Election status was set to: <b>%s</b>.') % assignment.get_status_display())
|
||||||
except Assignment.DoesNotExist:
|
except Assignment.DoesNotExist:
|
||||||
pass
|
pass
|
||||||
|
except NameError, e:
|
||||||
|
messages.error(request, e)
|
||||||
return redirect(reverse('assignment_view', args=[assignment_id]))
|
return redirect(reverse('assignment_view', args=[assignment_id]))
|
||||||
|
|
||||||
|
|
||||||
|
@ -6,38 +6,16 @@
|
|||||||
{% block title %}{{ block.super }} - {{ title }}{% endblock %}
|
{% block title %}{{ block.super }} - {{ title }}{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
<div class="item_fullscreen">{{ shown_user }}
|
||||||
<div id='sidebar'>
|
<span>
|
||||||
<div class='box'>
|
{% if shown_user.committee %}
|
||||||
<p><strong>{% trans "Groups" %}</strong><br />
|
<p>{{ shown_user.committee }}</p>
|
||||||
|
{% endif %}
|
||||||
|
<p>
|
||||||
{% if shown_user.groups.all %}
|
{% if shown_user.groups.all %}
|
||||||
{{ shown_user.groups.all|join:", " }}
|
{{ shown_user.groups.all|join:", " }}
|
||||||
{% else %}
|
|
||||||
{% trans "The participant is not member of any group." %}
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</p>
|
</p>
|
||||||
{% if shown_user.get_gender_display %}
|
</span>
|
||||||
<p><strong>{% trans "Gender" %}</strong><br />{{ shown_user.get_gender_display }}</p>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if shown_user.get_type_display %}
|
|
||||||
<p><strong>{% trans "Type" %}</strong><br />{{ shown_user.get_type_display }}</p>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if shown_user.committee %}
|
|
||||||
<p><strong>{% trans "Committee" %}</strong><br />{{ shown_user.committee }}</p>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<h1>{{ shown_user }}</h1>
|
|
||||||
<p>{{ shown_user.email }}</p>
|
|
||||||
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% block scrollcontent %}
|
|
||||||
<p>
|
|
||||||
<div class="text">{{ shown_user.about_me|linebreaks }}</div>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -155,6 +155,10 @@ body{
|
|||||||
font-weight:bold;
|
font-weight:bold;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
.item_fullscreen span
|
||||||
|
{
|
||||||
|
font-size: 50%; font-weight:normal;
|
||||||
|
}
|
||||||
|
|
||||||
/* items in a list*/
|
/* items in a list*/
|
||||||
.itemlist li
|
.itemlist li
|
||||||
|
Loading…
Reference in New Issue
Block a user