diff --git a/openslides/agenda/static/styles/agenda.css b/openslides/agenda/static/styles/agenda.css index 62fb064cc..71c9f065b 100644 --- a/openslides/agenda/static/styles/agenda.css +++ b/openslides/agenda/static/styles/agenda.css @@ -17,3 +17,7 @@ a.close_link span { a.close_link.closed span { background-image: url(../images/icons/done.png); } + +table#menu-overview { + white-space: nowrap; +} diff --git a/openslides/agenda/templates/agenda/item_row.html b/openslides/agenda/templates/agenda/item_row.html index cfd0eb165..ec8c0c3d4 100644 --- a/openslides/agenda/templates/agenda/item_row.html +++ b/openslides/agenda/templates/agenda/item_row.html @@ -20,12 +20,12 @@ {% endif %} {{ item }} {% if item.releated_sid %} - ({{ item.get_releated_type }}) + ({{ item.get_releated_type }}) {% endif %} {% if perms.agenda.can_manage_agenda %} - {{ item.comment }} + {{ item.comment|first_line }} {% endif %} {% if perms.agenda.can_manage_agenda or perms.projector.can_manage_projector %} diff --git a/openslides/agenda/templates/agenda/overview.html b/openslides/agenda/templates/agenda/overview.html index 9ef1b1dc5..9dcb48b64 100644 --- a/openslides/agenda/templates/agenda/overview.html +++ b/openslides/agenda/templates/agenda/overview.html @@ -49,53 +49,53 @@ {% endif %} -

{% trans "Agenda" %}

+

{% trans "Agenda" %}

-

- {%trans "Filter" %}: - {%trans "Hide closed items" %} -

- {{ items|length }} - {% blocktrans count counter=items|length %}item{% plural %}items{% endblocktrans %} - - - - - {% if perms.agenda.can_manage_agenda %} - - {% endif %} - {% if perms.agenda.can_manage_agenda or perms.projector.can_manage_projector %} - - {% endif %} - {% if perms.agenda.can_manage_agenda %} - - {% endif %} - - {% if items %} - - - - {% if perms.agenda.can_manage_agenda %} - - {% endif %} - {% if perms.agenda.can_manage_agenda or perms.projector.can_manage_projector %} - - {% endif %} - +

+ {%trans "Filter" %}: + {%trans "Hide closed items" %} +

+ {{ items|length }} + {% blocktrans count counter=items|length %}item{% plural %}items{% endblocktrans %} + + + + + {% if perms.agenda.can_manage_agenda %} + + {% endif %} + {% if perms.agenda.can_manage_agenda or perms.projector.can_manage_projector %} + + {% endif %} + {% if perms.agenda.can_manage_agenda %} + + {% endif %} + + {% if items %} + + + + {% if perms.agenda.can_manage_agenda %} + + {% endif %} + {% if perms.agenda.can_manage_agenda or perms.projector.can_manage_projector %} + + {% endif %} + - {% for item in items %} - - {% include "agenda/item_row.html" %} - - {% endfor %} - {% else %} - - - - {% endif %} - + {% for item in items %} + + {% include "agenda/item_row.html" %} + + {% endfor %} + {% else %} + + {%trans "No items available." %} + + {% endif %} + {% endblock %} diff --git a/openslides/participant/models.py b/openslides/participant/models.py index 397a647fd..32e34ab0a 100644 --- a/openslides/participant/models.py +++ b/openslides/participant/models.py @@ -63,14 +63,6 @@ class Profile(models.Model): if link == 'delete': return ('user_delete', [str(self.user.id)]) - def get_comment_line(self): - lines = self.comment.split('\n') - if len(lines) > 1 or len(lines[0]) > 40: - s = "%s ..." - else: - s = "%s" - return s % lines[0][:40] - def __unicode__(self): if self.group: return "%s (%s)" % (self.user.get_full_name(), self.group) diff --git a/openslides/participant/templates/participant/overview.html b/openslides/participant/templates/participant/overview.html index 606445f5b..9dbf40965 100644 --- a/openslides/participant/templates/participant/overview.html +++ b/openslides/participant/templates/participant/overview.html @@ -2,6 +2,7 @@ {% load i18n %} {% load staticfiles %} +{% load tags %} {% block title %}{{ block.super }} - {%trans "Participants" %}{% endblock %} @@ -80,7 +81,7 @@ {{ user.profile.get_type_display }} {{ user.profile.committee }} {% if perms.participant.can_manage_participant %} - {{ user.profile.get_comment_line }} + {{ user.profile.comment|first_line }} {% if user.last_login > user.date_joined %} {{ user.last_login }} {% endif %} diff --git a/openslides/utils/templatetags/tags.py b/openslides/utils/templatetags/tags.py index d35f190b3..5f1d1e810 100644 --- a/openslides/utils/templatetags/tags.py +++ b/openslides/utils/templatetags/tags.py @@ -36,3 +36,16 @@ def active(request, pattern): @register.simple_tag def model_url(object, link='view'): return object.get_absolute_url(link) + + +@register.filter +def first_line(text): + try: + lines = text.split('\n') + except AttributeError: + return '' + if len(lines) > 1 or len(lines[0]) > 40: + s = "%s ..." + else: + s = "%s" + return s % lines[0][:40]