From 17d813e08b97e8357369103804e556b391a93862 Mon Sep 17 00:00:00 2001 From: Emanuel Schuetze Date: Wed, 21 Nov 2012 19:36:12 +0100 Subject: [PATCH 1/4] Show error message for NameError. --- openslides/assignment/views.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openslides/assignment/views.py b/openslides/assignment/views.py index af661d072..f90d8d9cc 100644 --- a/openslides/assignment/views.py +++ b/openslides/assignment/views.py @@ -170,6 +170,8 @@ def set_status(request, assignment_id=None, status=None): messages.success(request, _('Election status was set to: %s.') % assignment.get_status_display()) except Assignment.DoesNotExist: pass + except NameError, e: + messages.error(request, e) return redirect(reverse('assignment_view', args=[assignment_id])) From da0757e40f75104c65b5e1d9a5b163b96a932969 Mon Sep 17 00:00:00 2001 From: Emanuel Schuetze Date: Wed, 21 Nov 2012 19:39:55 +0100 Subject: [PATCH 2/4] #417: Don't hide vote results table if status is reset --- openslides/assignment/templates/assignment/view.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openslides/assignment/templates/assignment/view.html b/openslides/assignment/templates/assignment/view.html index e67d485db..69063e7ff 100644 --- a/openslides/assignment/templates/assignment/view.html +++ b/openslides/assignment/templates/assignment/view.html @@ -111,7 +111,7 @@ {% endif %} -{% if assignment.status != "sea" %} +{% if assignment.status != "sea" or polls.exists %}

{% trans "Election results" %}

{% if polls.exists %} From c5a2f896e20b7b8d4668df9654ec7403631c0c26 Mon Sep 17 00:00:00 2001 From: Emanuel Schuetze Date: Wed, 21 Nov 2012 20:12:08 +0100 Subject: [PATCH 3/4] Fixed typo in identifier 'assignment_candidates'. --- openslides/assignment/models.py | 15 +++++++-------- openslides/assignment/views.py | 2 +- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/openslides/assignment/models.py b/openslides/assignment/models.py index 8c8019dda..749296470 100644 --- a/openslides/assignment/models.py +++ b/openslides/assignment/models.py @@ -85,7 +85,7 @@ class Assignment(models.Model, SlideMixin): raise NameError(_('%s is already a candidate.') % candidate) if not person.has_perm("assignment.can_manage_assignment") and self.status != 'sea': 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 \ not person.has_perm("assignment.can_manage_assignment"): # 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 """ try: - candidation = self.assignment_candidats.get(person=candidate) + candidation = self.assignment_candidates.get(person=candidate) except AssignmentCandidate.DoesNotExist: - # TODO: Use an OpenSlides Error raise Exception(_('%s is no candidate') % candidate) if not candidation.blocked: @@ -123,7 +122,7 @@ class Assignment(models.Model, SlideMixin): return True, if person is a candidate. """ try: - return self.assignment_candidats.filter(person=person) \ + return self.assignment_candidates.filter(person=person) \ .exclude(blocked=True).exists() except AttributeError: return False @@ -132,11 +131,11 @@ class Assignment(models.Model, SlideMixin): """ 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() @property - def assignment_candidats(self): + def assignment_candidates(self): return AssignmentCandidate.objects.filter(assignment=self) @property @@ -148,7 +147,7 @@ class Assignment(models.Model, SlideMixin): return self.get_participants(only_elected=True) 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) @@ -166,7 +165,7 @@ class Assignment(models.Model, SlideMixin): 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.save() diff --git a/openslides/assignment/views.py b/openslides/assignment/views.py index f90d8d9cc..4abf2fb80 100644 --- a/openslides/assignment/views.py +++ b/openslides/assignment/views.py @@ -101,7 +101,7 @@ def view(request, assignment_id=None): vote_results = assignment.vote_results(only_published=False) blocked_candidates = [candidate.person for candidate in \ - assignment.assignment_candidats.filter(blocked=True)] + assignment.assignment_candidates.filter(blocked=True)] return { 'assignment': assignment, 'blocked_candidates': blocked_candidates, From f3c865ee3c441b3de5f3ea146d2c3a8c4da5ea2c Mon Sep 17 00:00:00 2001 From: Emanuel Schuetze Date: Wed, 21 Nov 2012 21:05:56 +0100 Subject: [PATCH 4/4] #176: Adjusted user slide. Show only relevant information in a nice and clear layout. --- .../templates/projector/UserSlide.html | 36 ++++--------------- .../projector/static/styles/projector.css | 4 +++ 2 files changed, 11 insertions(+), 29 deletions(-) diff --git a/openslides/participant/templates/projector/UserSlide.html b/openslides/participant/templates/projector/UserSlide.html index dd845e2b9..c338cda02 100644 --- a/openslides/participant/templates/projector/UserSlide.html +++ b/openslides/participant/templates/projector/UserSlide.html @@ -6,38 +6,16 @@ {% block title %}{{ block.super }} - {{ title }}{% endblock %} {% block content %} - -