diff --git a/openslides/agenda/models.py b/openslides/agenda/models.py index 5db0f3ea5..0f472b034 100644 --- a/openslides/agenda/models.py +++ b/openslides/agenda/models.py @@ -111,21 +111,19 @@ class Item(MPTTModel, SlideMixin): def __unicode__(self): return self.get_title() - def get_absolute_url(self, link='view'): + def get_absolute_url(self, link='detail'): """ Return the URL to this item. By default it is the link to its view or the view of a related object. The link can be: - * view - * edit + * detail or view + * update or edit * delete """ - if link == 'view': - if self.related_sid: - return self.get_related_slide().get_absolute_url(link) + if link == 'detail' or link == 'view': return reverse('item_view', args=[str(self.id)]) - if link == 'edit': + if link == 'update' or link == 'edit': if self.related_sid: return self.get_related_slide().get_absolute_url(link) return reverse('item_edit', args=[str(self.id)]) @@ -139,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 diff --git a/openslides/agenda/templates/agenda/view.html b/openslides/agenda/templates/agenda/view.html index 753744e37..2fe33e92b 100644 --- a/openslides/agenda/templates/agenda/view.html +++ b/openslides/agenda/templates/agenda/view.html @@ -4,7 +4,7 @@ {% load tags %} {% load staticfiles %} -{% block title %}{{ block.super }} – {{ item.title }}{% endblock %} +{% block title %}{{ block.super }} – {{ item }}{% endblock %} {% block header %} @@ -36,15 +36,21 @@
{% endif %} -{{ item.text|safe|linebreaks }}
++ {% if item.get_related_slide == item %} + {{ item.text|safe|linebreaks }} + {% else %} + {% trans 'Goto' %} {% trans item.get_related_type %} {{ item.get_related_slide }} + {% endif %} +
{% if perms.agenda.can_manage_agenda %} {% if item.comment %} diff --git a/openslides/assignment/models.py b/openslides/assignment/models.py index a2b528e21..fe7c6958a 100644 --- a/openslides/assignment/models.py +++ b/openslides/assignment/models.py @@ -37,7 +37,7 @@ class AssignmentCandidate(models.Model): class Assignment(models.Model, SlideMixin): - prefix = 'assignment' + prefix = ugettext_noop('assignment') STATUS = ( ('sea', ugettext_lazy('Searching for candidates')), ('vot', ugettext_lazy('Voting')), @@ -226,10 +226,10 @@ class Assignment(models.Model, SlideMixin): data['template'] = 'projector/Assignment.html' return data - def get_absolute_url(self, link='view'): - if link == 'view': + def get_absolute_url(self, link='detail'): + if link == 'detail' or link == 'view': return reverse('assignment_view', args=[str(self.id)]) - if link == 'edit': + if link == 'update' or link == 'edit': return reverse('assignment_edit', args=[str(self.id)]) if link == 'delete': return reverse('assignment_delete', args=[str(self.id)]) diff --git a/openslides/motion/models.py b/openslides/motion/models.py index 9b7e7eedc..31cc24488 100644 --- a/openslides/motion/models.py +++ b/openslides/motion/models.py @@ -43,7 +43,7 @@ class Motion(SlideMixin, models.Model): This class is the main entry point to all other classes related to a motion. """ - prefix = 'motion' + prefix = ugettext_noop('motion') """ Prefix for the slide system. """ @@ -100,7 +100,7 @@ class Motion(SlideMixin, models.Model): """ Return a human readable name of this motion. """ - return self.get_title() + return self.active_version.title # TODO: Use transaction def save(self, ignore_version_data=False, *args, **kwargs): @@ -163,11 +163,11 @@ class Motion(SlideMixin, models.Model): """ Return an URL for this version. - The keyword argument 'link' can be 'detail', 'view', 'edit' or 'delete'. + The keyword argument 'link' can be 'detail', 'view', 'edit', 'update' or 'delete'. """ if link == 'view' or link == 'detail': return reverse('motion_detail', args=[str(self.id)]) - if link == 'edit': + if link == 'update' or link == 'edit': return reverse('motion_edit', args=[str(self.id)]) if link == 'delete': return reverse('motion_delete', args=[str(self.id)]) @@ -458,11 +458,15 @@ class Motion(SlideMixin, models.Model): """ Return a title for the Agenda. """ - return self.last_version.title # TODO: nutze active_version + return self.active_version.title - ## def get_agenda_title_supplement(self): - ## number = self.number or '[%s]' % ugettext('no number') - ## return '(%s %s)' % (ugettext('motion'), number) + def get_agenda_title_supplement(self): + """ + Returns the supplement to the title for the agenda item. + """ + if self.identifier: + return '(%s %s)' % (_('Motion'), self.identifier) + return '(%s)' % _('Motion') def get_allowed_actions(self, person): """ diff --git a/openslides/motion/templates/motion/motion_list.html b/openslides/motion/templates/motion/motion_list.html index ca1036149..a551dce93 100644 --- a/openslides/motion/templates/motion/motion_list.html +++ b/openslides/motion/templates/motion/motion_list.html @@ -50,7 +50,7 @@ {% for motion in motion_list %}