From a4d024f45c81185684fd47c776a031b4bf690ec8 Mon Sep 17 00:00:00 2001 From: Emanuel Schuetze Date: Fri, 11 Oct 2013 20:17:43 +0200 Subject: [PATCH] Some template fixes and improvements: - Fixed absoluteurl in motion detail template. Renamed '_edit' to '_update'. - Fixed wrong projector link ind assigment poll template. - Improved assignment projector slide. - Fixed #884: Add PDF note to translation string "Show paragraph numbering" --- .../assignment/templates/assignment/poll_view.html | 6 ++++-- .../assignment/templates/assignment/slide.html | 11 ++++------- openslides/motion/models.py | 12 ++++++------ openslides/motion/signals.py | 2 +- openslides/motion/urls.py | 8 ++++---- openslides/motion/views.py | 10 +++++----- openslides/projector/static/styles/projector.css | 3 +++ 7 files changed, 27 insertions(+), 25 deletions(-) diff --git a/openslides/assignment/templates/assignment/poll_view.html b/openslides/assignment/templates/assignment/poll_view.html index 21ef5eb32..f170daeaf 100644 --- a/openslides/assignment/templates/assignment/poll_view.html +++ b/openslides/assignment/templates/assignment/poll_view.html @@ -16,8 +16,10 @@ {% trans "Back to election" %} {% if perms.projector.can_manage_projector %} - - + + {% endif %} diff --git a/openslides/assignment/templates/assignment/slide.html b/openslides/assignment/templates/assignment/slide.html index 39e633a04..93ffc00c1 100644 --- a/openslides/assignment/templates/assignment/slide.html +++ b/openslides/assignment/templates/assignment/slide.html @@ -41,8 +41,7 @@ {% if polls.exists %}

{% trans "Election results" %}

- - +
{% for poll in polls %} @@ -51,10 +50,9 @@ {% endfor %} - {% for candidate, poll_list in vote_results.items %} - - + {% endfor %} - + {% for poll in polls %} {% for poll in polls %} -
{% trans "Candidates" %}
+
{% if candidate in assignment.elected %} @@ -83,7 +81,7 @@ {% endfor %}
{% trans 'Invalid votes' %} @@ -100,7 +98,6 @@ {% trans 'Votes cast' %} {% if poll.has_votes %} diff --git a/openslides/motion/models.py b/openslides/motion/models.py index bb204c1d5..94c43c7d4 100644 --- a/openslides/motion/models.py +++ b/openslides/motion/models.py @@ -190,7 +190,7 @@ class Motion(SlideMixin, models.Model): if link == 'view' or link == 'detail': return reverse('motion_detail', args=[str(self.id)]) if link == 'update' or link == 'edit': - return reverse('motion_edit', args=[str(self.id)]) + return reverse('motion_update', args=[str(self.id)]) if link == 'delete': return reverse('motion_delete', args=[str(self.id)]) return super(Motion, self).get_absolute_url(link) @@ -725,15 +725,15 @@ class MotionPoll(RelatedModelMixin, CountInvalid, CountVotesCast, BasePoll): """Return a string, representing the poll.""" return _('Vote %d') % self.poll_number - def get_absolute_url(self, link='edit'): + def get_absolute_url(self, link='update'): """ Return an URL for the poll. - The keyargument 'link' can be 'edit' or 'delete'. + The keyargument 'link' can be 'update' or 'delete'. """ - if link == 'edit': - return reverse('motion_poll_edit', args=[str(self.motion.pk), - str(self.poll_number)]) + if link == 'update': + return reverse('motion_poll_update', args=[str(self.motion.pk), + str(self.poll_number)]) if link == 'delete': return reverse('motion_poll_delete', args=[str(self.motion.pk), str(self.poll_number)]) diff --git a/openslides/motion/signals.py b/openslides/motion/signals.py index fc218e363..b594b20ae 100644 --- a/openslides/motion/signals.py +++ b/openslides/motion/signals.py @@ -90,7 +90,7 @@ def setup_motion_config_page(sender, **kwargs): name='motion_pdf_paragraph_numbering', default_value=False, form_field=forms.BooleanField( - label=ugettext_lazy('Show paragraph numbering'), + label=ugettext_lazy('Show paragraph numbering (only in PDF)'), required=False)) motion_allow_disable_versioning = ConfigVariable( name='motion_allow_disable_versioning', diff --git a/openslides/motion/urls.py b/openslides/motion/urls.py index dbe919f99..b117dd7f6 100644 --- a/openslides/motion/urls.py +++ b/openslides/motion/urls.py @@ -31,8 +31,8 @@ urlpatterns = patterns('openslides.motion.views', ), url(r'^(?P\d+)/edit/$', - 'motion_edit', - name='motion_edit', + 'motion_update', + name='motion_update', ), url(r'^(?P\d+)/del/$', @@ -76,8 +76,8 @@ urlpatterns = patterns('openslides.motion.views', ), url(r'^(?P\d+)/poll/(?P\d+)/edit/$', - 'poll_edit', - name='motion_poll_edit', + 'poll_update', + name='motion_poll_update', ), url(r'^(?P\d+)/poll/(?P\d+)/del/$', diff --git a/openslides/motion/views.py b/openslides/motion/views.py index 82bdf5156..69638b707 100644 --- a/openslides/motion/views.py +++ b/openslides/motion/views.py @@ -281,7 +281,7 @@ class MotionUpdateView(MotionEditMixin, UpdateView): self.version = self.object.get_last_version() self.used_new_version = False -motion_edit = MotionUpdateView.as_view() +motion_update = MotionUpdateView.as_view() class MotionDeleteView(DeleteView): @@ -502,6 +502,7 @@ class PollCreateView(SingleObjectMixin, RedirectView): """ permission_required = 'motion.can_manage_motion' model = Motion + url_name = 'motion_poll_detail' def get(self, request, *args, **kwargs): """ @@ -520,9 +521,9 @@ class PollCreateView(SingleObjectMixin, RedirectView): def get_redirect_url(self, **kwargs): """ - Return the URL to the EditView of the poll. + Return the URL to the UpdateView of the poll. """ - return reverse('motion_poll_edit', args=[self.object.pk, self.poll.poll_number]) + return reverse('motion_poll_update', args=[self.object.pk, self.poll.poll_number]) poll_create = PollCreateView.as_view() @@ -557,7 +558,6 @@ class PollUpdateView(PollMixin, PollFormView): """ View to update a MotionPoll. """ - poll_class = MotionPoll """ Poll Class to use for this view. @@ -585,7 +585,7 @@ class PollUpdateView(PollMixin, PollFormView): self.object.write_log([ugettext_noop('Poll updated')], self.request.user) return value -poll_edit = PollUpdateView.as_view() +poll_update = PollUpdateView.as_view() class PollDeleteView(PollMixin, DeleteView): diff --git a/openslides/projector/static/styles/projector.css b/openslides/projector/static/styles/projector.css index 940f05bec..f67467e29 100644 --- a/openslides/projector/static/styles/projector.css +++ b/openslides/projector/static/styles/projector.css @@ -176,3 +176,6 @@ tr.total td { border-top: 1px solid #333333; background-color: #e3e3e3; } +td.elected { + background-color: #BED4DE !important; +}