diff --git a/CHANGELOG b/CHANGELOG
index 56605e0b4..a3bf3ebd5 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -11,6 +11,9 @@ Version 2.1 (unreleased)
Agenda:
- Added button to remove all speakers from a list of speakers.
+Assignments:
+- Remove unused assignment config to publish winner election results only.
+
Core:
- Used Django Channels instead of Tornado.
- Added support for big assemblies with lots of users.
@@ -19,11 +22,9 @@ Motions:
- Added origin field.
- Added button to number all motions in a category.
-Assignments:
-- Remove unused assignment config to publish winner election results only.
-
Users:
- Added field is_committee and new default group Committees.
+- Added field number.
Other:
- Removed config cache to support multiple threads or processes.
diff --git a/openslides/users/migrations/0003_user_number.py b/openslides/users/migrations/0003_user_number.py
new file mode 100644
index 000000000..67ac02140
--- /dev/null
+++ b/openslides/users/migrations/0003_user_number.py
@@ -0,0 +1,20 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.7 on 2016-08-01 14:54
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('users', '0002_user_is_committee'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='user',
+ name='number',
+ field=models.CharField(blank=True, default='', max_length=50),
+ ),
+ ]
diff --git a/openslides/users/models.py b/openslides/users/models.py
index d81ee67b3..dbabd6747 100644
--- a/openslides/users/models.py
+++ b/openslides/users/models.py
@@ -124,6 +124,11 @@ class User(RESTModelMixin, PermissionsMixin, AbstractBaseUser):
blank=True,
default='')
+ number = models.CharField(
+ max_length=50,
+ blank=True,
+ default='')
+
about_me = models.TextField(
blank=True,
default='')
diff --git a/openslides/users/pdf.py b/openslides/users/pdf.py
index 109d01a30..757271aa1 100644
--- a/openslides/users/pdf.py
+++ b/openslides/users/pdf.py
@@ -23,8 +23,7 @@ def users_to_pdf(pdf):
"""
Create a list of all users as PDF.
"""
- data = [['#', _('Title'), _('Last Name'), _('First Name'),
- _('Structure level'), _('Group')]]
+ data = [['#', _('Name'), _('Structure level'), _('Group')]]
if config['users_sort_users_by_first_name']:
sort = 'first_name'
else:
@@ -36,11 +35,19 @@ def users_to_pdf(pdf):
for group in user.groups.all():
if group.pk != 2:
groups += "%s
" % escape(_(group.name))
+ if sort == 'last_name':
+ name = "%s" % escape(user.last_name)
+ if user.first_name:
+ name = "%s, %s" % (name, escape(user.first_name))
+ else:
+ name = "%s %s" % (escape(user.first_name), escape(user.last_name))
+ if user.title:
+ name = "%s %s" % (user.title, name)
+ if user.number:
+ name = "%s
%s" % (name, user.number)
data.append([
counter,
- Paragraph(user.title, stylesheet['Tablecell']),
- Paragraph(escape(user.last_name), stylesheet['Tablecell']),
- Paragraph(escape(user.first_name), stylesheet['Tablecell']),
+ Paragraph(name, stylesheet['Tablecell']),
Paragraph(escape(user.structure_level), stylesheet['Tablecell']),
Paragraph(groups, stylesheet['Tablecell'])])
t = LongTable(data, style=[
@@ -65,6 +72,7 @@ def users_passwords_to_pdf(pdf):
users_pdf_url = config["users_pdf_url"] or "-"
users_pdf_welcometitle = config["users_pdf_welcometitle"]
users_pdf_welcometext = config["users_pdf_welcometext"]
+
if config['users_sort_users_by_first_name']:
sort = 'first_name'
else:
@@ -88,6 +96,7 @@ def users_passwords_to_pdf(pdf):
for user in User.objects.all().order_by(sort):
pdf.append(Paragraph(escape(user.get_full_name()), stylesheet['h1']))
+ pdf.append(Paragraph(escape(user.number), stylesheet['h3']))
pdf.append(Spacer(0, 1 * cm))
data = []
# WLAN access data
diff --git a/openslides/users/serializers.py b/openslides/users/serializers.py
index 269d2ce56..f1b40737d 100644
--- a/openslides/users/serializers.py
+++ b/openslides/users/serializers.py
@@ -18,6 +18,7 @@ USERSHORTSERIALIZER_FIELDS = (
'first_name',
'last_name',
'structure_level',
+ 'number',
'about_me',
'groups',
'is_committee',
@@ -57,6 +58,7 @@ class UserFullSerializer(ModelSerializer):
'title',
'first_name',
'last_name',
+ 'number',
'structure_level',
'about_me',
'comment',
diff --git a/openslides/users/static/js/users/site.js b/openslides/users/static/js/users/site.js
index 4dbebc663..a386302ce 100644
--- a/openslides/users/static/js/users/site.js
+++ b/openslides/users/static/js/users/site.js
@@ -318,6 +318,12 @@ angular.module('OpenSlidesApp.users.site', ['OpenSlidesApp.users'])
description: gettextCatalog.getString('Will be shown after the name.')
}
},
+ { key: 'number',
+ type: 'input',
+ templateOptions: {
+ label:gettextCatalog.getString('Participant number')
+ }
+ },
{
key: 'groups_id',
type: 'select-multiple',
@@ -750,6 +756,10 @@ angular.module('OpenSlidesApp.users.site', ['OpenSlidesApp.users'])
if (user.structure_level) {
user.structure_level = user.structure_level.replace(quotionRe, '$1');
}
+ // number
+ if (user.number) {
+ user.number = user.number.replace(quotionRe, '$1');
+ }
// groups
if (user.groups) {
var csvGroups = user.groups.replace(quotionRe, '$1').split(",");
@@ -822,12 +832,12 @@ angular.module('OpenSlidesApp.users.site', ['OpenSlidesApp.users'])
var element = document.getElementById('downloadLink');
var csvRows = [
// column header line
- ['title', 'first_name', 'last_name', 'structure_level', 'groups', 'comment', 'is_active', 'is_committee'],
+ ['title', 'first_name', 'last_name', 'structure_level', 'number', 'groups', 'comment', 'is_active', 'is_committee'],
// example entries
- ['Dr.', 'Max', 'Mustermann', 'Berlin', '"3,4"', 'xyz', '1', ''],
- ['', 'John', 'Doe', 'Washington', '3', 'abc', '1', ''],
- ['', 'Fred', 'Bloggs', 'London', '', '', '', ''],
- ['', '', 'Executive Board', '', '5', '', '', '1'],
+ ['Dr.', 'Max', 'Mustermann', 'Berlin','1234567890', '"3,4"', 'xyz', '1', ''],
+ ['', 'John', 'Doe', 'Washington','75/99/8-2', '3', 'abc', '1', ''],
+ ['', 'Fred', 'Bloggs', 'London', '', '', '', '', ''],
+ ['', '', 'Executive Board', '', '', '5', '', '', '1'],
];
var csvString = csvRows.join("%0A");
diff --git a/openslides/users/static/templates/users/user-detail.html b/openslides/users/static/templates/users/user-detail.html
index 1ade58593..11518eb64 100644
--- a/openslides/users/static/templates/users/user-detail.html
+++ b/openslides/users/static/templates/users/user-detail.html
@@ -34,6 +34,8 @@
title, first_name, last_name, structure_level, groups, comment, is_active, is_committee
+ title, first_name, last_name, structure_level, number, groups, comment, is_active, is_committee
3
,
4
@@ -90,6 +90,7 @@