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"
This commit is contained in:
Emanuel Schuetze 2013-10-11 20:17:43 +02:00
parent a9487c22a7
commit a4d024f45c
7 changed files with 27 additions and 25 deletions

View File

@ -16,8 +16,10 @@
<a href="{{ assignment|absolute_url:'detail' }}" class="btn btn-mini"><i class="icon-chevron-left"></i> {% trans "Back to election" %}</a> <a href="{{ assignment|absolute_url:'detail' }}" class="btn btn-mini"><i class="icon-chevron-left"></i> {% trans "Back to election" %}</a>
<!-- activate projector --> <!-- activate projector -->
{% if perms.projector.can_manage_projector %} {% if perms.projector.can_manage_projector %}
<a href="{% url 'projector_activate_slide' assignment.sid %}" class="activate_link btn {% if assignment.active %}btn-primary{% endif %} btn-mini" rel="tooltip" data-original-title="{% trans 'Show election' %}"> <a href="{{ assignment|absolute_url:'projector' }}"
<i class="icon-facetime-video {% if assignment.active %}icon-white{% endif %}"></i> class="activate_link btn {% if assignment.is_active_slide %}btn-primary{% endif %} btn-mini"
rel="tooltip" data-original-title="{% trans 'Show election' %}">
<i class="icon-facetime-video {% if assignment.is_active_slide %}icon-white{% endif %}"></i>
</a> </a>
{% endif %} {% endif %}
</small> </small>

View File

@ -41,8 +41,7 @@
{% if polls.exists %} {% if polls.exists %}
<h3>{% trans "Election results" %}</h3> <h3>{% trans "Election results" %}</h3>
<table> <table class="table-striped table-bordered">
<tr> <tr>
<th>{% trans "Candidates" %}</th> <th>{% trans "Candidates" %}</th>
{% for poll in polls %} {% for poll in polls %}
@ -51,10 +50,9 @@
</th> </th>
{% endfor %} {% endfor %}
</tr> </tr>
{% for candidate, poll_list in vote_results.items %} {% for candidate, poll_list in vote_results.items %}
<tr class="{% cycle 'odd' '' as rowcolors %}"> <tr>
<td class="candidate{% if candidate in assignment.elected %} elected{% endif %}"> <td class="{% if candidate in assignment.elected %} elected{% endif %}">
{% if candidate in assignment.elected %} {% if candidate in assignment.elected %}
<a class="elected"> <a class="elected">
<img src="{% static 'img/voting-yes.png' %}" title="{% trans 'Candidate is elected' %}"> <img src="{% static 'img/voting-yes.png' %}" title="{% trans 'Candidate is elected' %}">
@ -83,7 +81,7 @@
{% endfor %} {% endfor %}
</tr> </tr>
{% endfor %} {% endfor %}
<tr class="{% cycle rowcolors %}"> <tr>
<td>{% trans 'Invalid votes' %}</td> <td>{% trans 'Invalid votes' %}</td>
{% for poll in polls %} {% for poll in polls %}
<td style="white-space:nowrap;"> <td style="white-space:nowrap;">
@ -100,7 +98,6 @@
<strong>{% trans 'Votes cast' %}</strong> <strong>{% trans 'Votes cast' %}</strong>
</td> </td>
{% for poll in polls %} {% for poll in polls %}
<td style="white-space:nowrap;"> <td style="white-space:nowrap;">
{% if poll.has_votes %} {% if poll.has_votes %}
<img src="{% static 'img/voting-total.png' %}" title="{% trans 'Votes cast' %}"> <img src="{% static 'img/voting-total.png' %}" title="{% trans 'Votes cast' %}">

View File

@ -190,7 +190,7 @@ class Motion(SlideMixin, models.Model):
if link == 'view' or link == 'detail': if link == 'view' or link == 'detail':
return reverse('motion_detail', args=[str(self.id)]) return reverse('motion_detail', args=[str(self.id)])
if link == 'update' or link == 'edit': 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': if link == 'delete':
return reverse('motion_delete', args=[str(self.id)]) return reverse('motion_delete', args=[str(self.id)])
return super(Motion, self).get_absolute_url(link) 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 a string, representing the poll."""
return _('Vote %d') % self.poll_number 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. 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': if link == 'update':
return reverse('motion_poll_edit', args=[str(self.motion.pk), return reverse('motion_poll_update', args=[str(self.motion.pk),
str(self.poll_number)]) str(self.poll_number)])
if link == 'delete': if link == 'delete':
return reverse('motion_poll_delete', args=[str(self.motion.pk), return reverse('motion_poll_delete', args=[str(self.motion.pk),
str(self.poll_number)]) str(self.poll_number)])

View File

@ -90,7 +90,7 @@ def setup_motion_config_page(sender, **kwargs):
name='motion_pdf_paragraph_numbering', name='motion_pdf_paragraph_numbering',
default_value=False, default_value=False,
form_field=forms.BooleanField( form_field=forms.BooleanField(
label=ugettext_lazy('Show paragraph numbering'), label=ugettext_lazy('Show paragraph numbering (only in PDF)'),
required=False)) required=False))
motion_allow_disable_versioning = ConfigVariable( motion_allow_disable_versioning = ConfigVariable(
name='motion_allow_disable_versioning', name='motion_allow_disable_versioning',

View File

@ -31,8 +31,8 @@ urlpatterns = patterns('openslides.motion.views',
), ),
url(r'^(?P<pk>\d+)/edit/$', url(r'^(?P<pk>\d+)/edit/$',
'motion_edit', 'motion_update',
name='motion_edit', name='motion_update',
), ),
url(r'^(?P<pk>\d+)/del/$', url(r'^(?P<pk>\d+)/del/$',
@ -76,8 +76,8 @@ urlpatterns = patterns('openslides.motion.views',
), ),
url(r'^(?P<pk>\d+)/poll/(?P<poll_number>\d+)/edit/$', url(r'^(?P<pk>\d+)/poll/(?P<poll_number>\d+)/edit/$',
'poll_edit', 'poll_update',
name='motion_poll_edit', name='motion_poll_update',
), ),
url(r'^(?P<pk>\d+)/poll/(?P<poll_number>\d+)/del/$', url(r'^(?P<pk>\d+)/poll/(?P<poll_number>\d+)/del/$',

View File

@ -281,7 +281,7 @@ class MotionUpdateView(MotionEditMixin, UpdateView):
self.version = self.object.get_last_version() self.version = self.object.get_last_version()
self.used_new_version = False self.used_new_version = False
motion_edit = MotionUpdateView.as_view() motion_update = MotionUpdateView.as_view()
class MotionDeleteView(DeleteView): class MotionDeleteView(DeleteView):
@ -502,6 +502,7 @@ class PollCreateView(SingleObjectMixin, RedirectView):
""" """
permission_required = 'motion.can_manage_motion' permission_required = 'motion.can_manage_motion'
model = Motion model = Motion
url_name = 'motion_poll_detail'
def get(self, request, *args, **kwargs): def get(self, request, *args, **kwargs):
""" """
@ -520,9 +521,9 @@ class PollCreateView(SingleObjectMixin, RedirectView):
def get_redirect_url(self, **kwargs): 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() poll_create = PollCreateView.as_view()
@ -557,7 +558,6 @@ class PollUpdateView(PollMixin, PollFormView):
""" """
View to update a MotionPoll. View to update a MotionPoll.
""" """
poll_class = MotionPoll poll_class = MotionPoll
""" """
Poll Class to use for this view. 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) self.object.write_log([ugettext_noop('Poll updated')], self.request.user)
return value return value
poll_edit = PollUpdateView.as_view() poll_update = PollUpdateView.as_view()
class PollDeleteView(PollMixin, DeleteView): class PollDeleteView(PollMixin, DeleteView):

View File

@ -176,3 +176,6 @@ tr.total td {
border-top: 1px solid #333333; border-top: 1px solid #333333;
background-color: #e3e3e3; background-color: #e3e3e3;
} }
td.elected {
background-color: #BED4DE !important;
}