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:
parent
a9487c22a7
commit
a4d024f45c
@ -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>
|
||||
<!-- activate 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' %}">
|
||||
<i class="icon-facetime-video {% if assignment.active %}icon-white{% endif %}"></i>
|
||||
<a href="{{ assignment|absolute_url:'projector' }}"
|
||||
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>
|
||||
{% endif %}
|
||||
</small>
|
||||
|
@ -41,8 +41,7 @@
|
||||
|
||||
{% if polls.exists %}
|
||||
<h3>{% trans "Election results" %}</h3>
|
||||
<table>
|
||||
|
||||
<table class="table-striped table-bordered">
|
||||
<tr>
|
||||
<th>{% trans "Candidates" %}</th>
|
||||
{% for poll in polls %}
|
||||
@ -51,10 +50,9 @@
|
||||
</th>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
|
||||
{% for candidate, poll_list in vote_results.items %}
|
||||
<tr class="{% cycle 'odd' '' as rowcolors %}">
|
||||
<td class="candidate{% if candidate in assignment.elected %} elected{% endif %}">
|
||||
<tr>
|
||||
<td class="{% if candidate in assignment.elected %} elected{% endif %}">
|
||||
{% if candidate in assignment.elected %}
|
||||
<a class="elected">
|
||||
<img src="{% static 'img/voting-yes.png' %}" title="{% trans 'Candidate is elected' %}">
|
||||
@ -83,7 +81,7 @@
|
||||
{% endfor %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
<tr class="{% cycle rowcolors %}">
|
||||
<tr>
|
||||
<td>{% trans 'Invalid votes' %}</td>
|
||||
{% for poll in polls %}
|
||||
<td style="white-space:nowrap;">
|
||||
@ -100,7 +98,6 @@
|
||||
<strong>{% trans 'Votes cast' %}</strong>
|
||||
</td>
|
||||
{% for poll in polls %}
|
||||
|
||||
<td style="white-space:nowrap;">
|
||||
{% if poll.has_votes %}
|
||||
<img src="{% static 'img/voting-total.png' %}" title="{% trans 'Votes cast' %}">
|
||||
|
@ -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,14 +725,14 @@ 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),
|
||||
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),
|
||||
|
@ -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',
|
||||
|
@ -31,8 +31,8 @@ urlpatterns = patterns('openslides.motion.views',
|
||||
),
|
||||
|
||||
url(r'^(?P<pk>\d+)/edit/$',
|
||||
'motion_edit',
|
||||
name='motion_edit',
|
||||
'motion_update',
|
||||
name='motion_update',
|
||||
),
|
||||
|
||||
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/$',
|
||||
'poll_edit',
|
||||
name='motion_poll_edit',
|
||||
'poll_update',
|
||||
name='motion_poll_update',
|
||||
),
|
||||
|
||||
url(r'^(?P<pk>\d+)/poll/(?P<poll_number>\d+)/del/$',
|
||||
|
@ -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):
|
||||
|
@ -176,3 +176,6 @@ tr.total td {
|
||||
border-top: 1px solid #333333;
|
||||
background-color: #e3e3e3;
|
||||
}
|
||||
td.elected {
|
||||
background-color: #BED4DE !important;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user