diff --git a/openslides/participant/forms.py b/openslides/participant/forms.py index 64a4f2b83..7d0d810c5 100644 --- a/openslides/participant/forms.py +++ b/openslides/participant/forms.py @@ -36,8 +36,8 @@ class UserCreateForm(forms.ModelForm, CssClassMixin): class Meta: model = User - fields = ('first_name', 'last_name', 'is_active', 'groups', 'structure_level', - 'gender', 'type', 'committee', 'about_me', 'comment', 'default_password') + fields = ('title', 'first_name', 'last_name', 'gender', 'groups', 'structure_level', + 'type', 'committee', 'about_me', 'comment', 'default_password', 'is_active') class UserUpdateForm(UserCreateForm): diff --git a/openslides/participant/models.py b/openslides/participant/models.py index bbb889329..d0c40a1fc 100644 --- a/openslides/participant/models.py +++ b/openslides/participant/models.py @@ -41,6 +41,9 @@ class User(PersonMixin, Person, SlideMixin, DjangoUser): structure_level = models.CharField( max_length=100, blank=True, default='', verbose_name=_("Structure level"), help_text=_('Will be shown after the name.')) + title = models.CharField( + max_length=50, blank=True, default='', verbose_name=_("Titel"), + help_text=_('Will be shown before the name.')) gender = models.CharField( max_length=50, choices=GENDER_CHOICES, blank=True, verbose_name=_("Gender"), help_text=_('Only for filtering the participant list.')) @@ -62,7 +65,11 @@ class User(PersonMixin, Person, SlideMixin, DjangoUser): @property def clean_name(self): - return self.get_full_name() or self.username + if self.title: + name = "%s %s" % (self.title, self.get_full_name()) + else: + name = self.get_full_name() + return name or self.username def get_name_suffix(self): return self.structure_level diff --git a/openslides/participant/templates/participant/overview.html b/openslides/participant/templates/participant/overview.html index 08f4d182e..5420ac8dc 100644 --- a/openslides/participant/templates/participant/overview.html +++ b/openslides/participant/templates/participant/overview.html @@ -59,6 +59,7 @@ {% trans "Present" %} + {% trans "Title" %} {% trans "First Name" %} {% trans "Last Name" %} {% trans "Structure level" %} @@ -88,6 +89,7 @@ title="{% if user.is_active %}{% trans 'present' %}{% else %}{% trans 'absent' %}{% endif %}"> {% endif %} + {{ user.title }} {{ user.first_name }} {{ user.last_name }} {{ user.structure_level }} diff --git a/openslides/participant/views.py b/openslides/participant/views.py index 91218742d..cf9bd9056 100644 --- a/openslides/participant/views.py +++ b/openslides/participant/views.py @@ -184,7 +184,7 @@ class ParticipantsListPDF(PDFView): document_title = ugettext_lazy('List of Participants') def append_to_pdf(self, story): - data = [['#', _('Last Name'), _('First Name'), _('Group'), _('Type'), + data = [['#', _('Title'), _('Last Name'), _('First Name'), _('Group'), _('Type'), _('Committee')]] if config['participant_sort_users_by_first_name']: sort = 'first_name' @@ -195,6 +195,7 @@ class ParticipantsListPDF(PDFView): counter += 1 data.append([ counter, + Paragraph(user.title, stylesheet['Tablecell']), Paragraph(user.last_name, stylesheet['Tablecell']), Paragraph(user.first_name, stylesheet['Tablecell']), Paragraph(user.structure_level, stylesheet['Tablecell']),