Bugfixing, template improvements, translation updates.

- Fixed #649: Clean old motion fragments in template and pdf (about motion notes).
- Fixed motion pdf issues: missing submitters, voting result and make motion state translateable- Added post_save function also for UserUpdateView.
This commit is contained in:
Emanuel Schuetze 2013-05-28 20:31:01 +02:00
parent b80a526ddc
commit 9fb2052b3d
11 changed files with 301 additions and 251 deletions

View File

@ -137,7 +137,7 @@ class Item(MPTTModel, SlideMixin):
# TODO: Rename it to 'get_related_object'
object = get_slide_from_sid(self.related_sid, element=True)
if object is None:
self.title = _('Item for deleted slide %s') % self.related_sid
self.title = _('< Item for deleted slide (%s) >') % self.related_sid
self.related_sid = None
self.save()
return self

View File

@ -20,27 +20,25 @@
<h1>
{{ item }}
<small class="pull-right">
<div class="btn-toolbar">
<a href="{% url 'item_overview' %}" class="btn btn-mini"><i class="icon-chevron-left"></i> {% trans "Back to overview" %}</a>
{% if perms.projector.can_manage_projector %}
<a href="{% url 'projector_activate_slide' item.sid %}"
class="activate_link btn btn-mini {% if item.active and not show_list %}btn-primary{% endif %}"
rel="tooltip" data-original-title="{% trans 'Show' %}">
<i class="icon icon-facetime-video {% if item.active and not show_list %}icon-white{% endif %}"></i>
</a>
{% endif %}
{% if perms.agenda.can_manage_agenda %}
<div class="btn-group">
<a data-toggle="dropdown" href="#" class="btn btn-mini dropdown-toggle">
{% trans 'More actions' %}
<span class="caret"></span>
</a>
<ul class="dropdown-menu pull-right">
<li><a href="{% model_url item 'update' %}"><i class="icon-pencil"></i> {% trans 'Edit item' %}</a></li>
<li><a href="{% model_url item 'delete' %}"><i class="icon-remove"></i> {% trans 'Delete item' %}</a></li>
</ul>
{% endif %}
</div>
<a href="{% url 'item_overview' %}" class="btn btn-mini"><i class="icon-chevron-left"></i> {% trans "Back to overview" %}</a>
{% if perms.projector.can_manage_projector %}
<a href="{% url 'projector_activate_slide' item.sid %}"
class="activate_link btn btn-mini {% if item.active and not show_list %}btn-primary{% endif %}"
rel="tooltip" data-original-title="{% trans 'Show' %}">
<i class="icon icon-facetime-video {% if item.active and not show_list %}icon-white{% endif %}"></i>
</a>
{% endif %}
{% if perms.agenda.can_manage_agenda %}
<div class="btn-group">
<a data-toggle="dropdown" href="#" class="btn btn-mini dropdown-toggle">
{% trans 'More actions' %}
<span class="caret"></span>
</a>
<ul class="dropdown-menu pull-right">
<li><a href="{% model_url item 'update' %}"><i class="icon-pencil"></i> {% trans 'Edit item' %}</a></li>
<li><a href="{% model_url item 'delete' %}"><i class="icon-remove"></i> {% trans 'Delete item' %}</a></li>
</ul>
{% endif %}
</div>
</small>
</h1>
@ -48,7 +46,7 @@
{% if item.get_related_slide == item %}
{{ item.text|safe|linebreaks }}
{% else %}
<a href="{% model_url item.get_related_slide %}">{% trans 'Goto' %} {% trans item.get_related_type %} {{ item.get_related_slide }}</a>
<a href="{% model_url item.get_related_slide %}" class="btn btn-small">{% trans 'View' %} "{{ item.get_related_slide }}" ({% trans item.get_related_type %})</a>
{% endif %}
</p>
@ -146,7 +144,7 @@
{% endif %}
</p>
{% if perms.can_manage_agenda %}
{% if perms.agenda.can_manage_agenda %}
<form action="" method="post">{% csrf_token %}
{% for field in form %}
<label>{{ field.label }}:</label>

File diff suppressed because it is too large Load Diff

View File

@ -734,7 +734,7 @@ class MotionPoll(CountInvalid, CountVotesCast, BasePoll):
def __unicode__(self):
"""Return a string, representing the poll."""
return _('Ballot %d') % self.poll_number
return _('Vote %d') % self.poll_number
def get_absolute_url(self, link='edit'):
"""Return an URL for the poll.

View File

@ -56,7 +56,8 @@ def motion_to_pdf(pdf, motion):
stylesheet['Heading4']))
cell1b = []
cell1b.append(Spacer(0, 0.2 * cm))
cell1b.append(Paragraph(unicode(motion.submitter), stylesheet['Normal']))
for submitter in motion.submitter.all():
cell1b.append(Paragraph(unicode(submitter), stylesheet['Normal']))
motion_data.append([cell1a, cell1b])
# TODO: choose this in workflow
@ -88,26 +89,12 @@ def motion_to_pdf(pdf, motion):
cell3b.append(Spacer(0, 0.2 * cm))
motion_data.append([cell3a, cell3b])
## # status
## cell4a = []
## cell4b = []
## note = " ".join(motion.notes)
## cell4a.append(Paragraph("<font name='Ubuntu-Bold'>%s:</font>" % _("Status"), stylesheet['Heading4']))
## if note != "":
## if motion.status == "pub":
## cell4b.append(Paragraph(note, stylesheet['Normal']))
## else:
## cell4b.append(Paragraph("%s | %s" % (motion.get_status_display(), note), stylesheet['Normal']))
## else:
## cell4b.append(Paragraph("%s" % motion.get_status_display(), stylesheet['Normal']))
## data.append([cell4a, cell4b])
# Motion state
cell4a = []
cell4b = []
cell4a.append(Paragraph("<font name='Ubuntu-Bold'>%s:</font>" % _("State"),
stylesheet['Heading4']))
cell4b.append(Paragraph(motion.state.name, stylesheet['Normal']))
cell4b.append(Paragraph(_(motion.state.name), stylesheet['Normal']))
motion_data.append([cell4a, cell4b])
# Version number (aid)
@ -137,7 +124,7 @@ def motion_to_pdf(pdf, motion):
option = poll.get_options()[0]
yes, no, abstain, invalid, votecast = (
option['Yes'], option['No'], option['Abstain'],
poll.print_voteinvalid(), poll.print_votecast())
poll.print_votesinvalid(), poll.print_votescast())
if len(polls) > 1:
cell6b.append(Paragraph("%s. %s" % (ballotcounter, _("Vote")),

View File

@ -5,6 +5,11 @@
* :license: GNU GPL, see LICENSE for more details.
*/
/* motion create/update form fields */
#id_submitter, #id_supporter {
height: 110px;
width: auto;
}
/* motion version diff table */
table.diff, .diff_row {
font-size: 12px;

View File

@ -184,11 +184,8 @@
<!-- Status -->
<h5>{% trans "Status" %}:</h5>
{% if motion.state_id != "pub" %}
{# TODO: trans motion.state #}
<span class="label label-info">{% trans motion.state.name %}</span>
<br>
{% endif %}
<span class="label label-info">{% trans motion.state.name %}</span>
<br>
<!-- Vote results -->
<h5>{% trans "Vote results" %}:</h5>

View File

@ -6,6 +6,7 @@
{% load staticfiles %}
{% block header %}
<link type="text/css" rel="stylesheet" media="all" href="{% static 'styles/motion.css' %}" />
<link type="text/css" rel="stylesheet" media="all" href="{% static 'styles/ckeditor.css' %}" />
{% endblock %}

View File

@ -132,6 +132,17 @@ class UserUpdateView(UpdateView):
form_kwargs.update({'request': self.request})
return form_kwargs
def post_save(self, form):
super(UserUpdateView, self).post_save(form)
# TODO: find a better solution that makes the following lines obsolete
# Background: motion.models.use_post_save adds already the registerd group
# to new user but super(..).post_save(form) removes it and sets only the
# groups selected in the form (without 'registered')
# workaround: add registered group again manually
from openslides.participant.api import get_registered_group # TODO: Test, if global import is possible
registered = get_registered_group()
self.object.groups.add(registered)
class UserDeleteView(DeleteView):
"""

View File

@ -167,17 +167,17 @@ legend + .control-group {
height: 310px;
width: auto;
}
#id_submitter, #id_supporter, #id_users {
#id_users {
height: 110px;
width: auto;
}
#dataTableParticipants_filter input {
#dataTable_filter input {
width: auto;
}
#dataTableParticipants {
#dataTable {
clear: none;
}
#dataTableParticipants_wrapper .row-fluid:after {
#dataTable_wrapper .row-fluid:after {
clear: none;
}