Rename participant field 'details' to 'structure level' (Gliederungsebene). (DB rebuild required!)

This commit is contained in:
Emanuel Schuetze 2012-11-19 23:30:09 +01:00
parent 844b2892f1
commit 0fbb7dced3
9 changed files with 30 additions and 30 deletions

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: OpenSlides 1.x\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-11-19 23:01+0100\n"
"POT-Creation-Date: 2012-11-19 23:20+0100\n"
"PO-Revision-Date: 2012-07-28 11:07+0200\n"
"Last-Translator: Emanuel Schuetze <emanuel@intevation.de>\n"
"Language-Team: support@openslides.de\n"
@ -1762,8 +1762,8 @@ msgstr "Gast"
#: participant/models.py:44 participant/templates/participant/overview.html:30
#: participant/templates/participant/overview.html:68
msgid "Detail"
msgstr "Detail"
msgid "Structure level"
msgstr "Gliederungsebene"
#: participant/models.py:45
msgid "Will be shown after the name."
@ -2296,8 +2296,8 @@ msgid ""
"Get <a href='http://openslides.org/support' target='_blank'>professional "
"support</a> for OpenSlides."
msgstr ""
"Nutzen Sie unseren <a href='http://openslides.org/support' target='_blank'>professionellen "
"Support</a> für OpenSlides."
"Nutzen Sie unseren <a href='http://openslides.org/support' "
"target='_blank'>professionellen Support</a> für OpenSlides."
#: utils/pdf.py:227
#, python-format

View File

@ -615,7 +615,7 @@ def motion_import(request):
user.last_name = last_name
user.first_name = first_name
user.username = gen_username(first_name, last_name)
user.detail = ''
user.structure_level = ''
user.committee = ''
user.gender = ''
user.type = ''

View File

@ -71,7 +71,7 @@ def import_users(csv_file):
dialect=dialect)):
if line_no:
try:
(first_name, last_name, gender, detail, type, committee, comment) = line[:7]
(first_name, last_name, gender, structure_level, type, committee, comment) = line[:7]
except ValueError:
error_messages.append(_('Ignoring malformed line %d in import file.') % line_no + 1)
continue
@ -80,7 +80,7 @@ def import_users(csv_file):
user.first_name = first_name
user.username = gen_username(first_name, last_name)
user.gender = gender
user.detail = detail
user.structure_level = structure_level
user.type = type
user.committee = committee
user.comment = comment

View File

@ -27,7 +27,7 @@ class UserCreateForm(forms.ModelForm, CssClassMixin):
class Meta:
model = User
fields = ('first_name', 'last_name', 'is_active', 'groups', 'detail',
fields = ('first_name', 'last_name', 'is_active', 'groups', 'structure_level',
'gender', 'type', 'committee', 'about_me', 'comment', 'default_password')
@ -35,7 +35,7 @@ class UserUpdateForm(UserCreateForm):
class Meta:
model = User
fields = ('username', 'first_name', 'last_name', 'is_active', 'groups',
'detail', 'gender', 'type', 'committee', 'about_me', 'comment',
'structure_level', 'gender', 'type', 'committee', 'about_me', 'comment',
'default_password')

View File

@ -40,8 +40,8 @@ class User(DjangoUser, PersonMixin, Person, SlideMixin):
)
django_user = models.OneToOneField(DjangoUser, editable=False, parent_link=True)
detail = models.CharField(
max_length=100, blank=True, default='', verbose_name=_("Detail"),
structure_level = models.CharField(
max_length=100, blank=True, default='', verbose_name=_("Structure level"),
help_text=_('Will be shown after the name.'))
gender = models.CharField(
max_length=50, choices=GENDER_CHOICES, blank=True,
@ -67,10 +67,10 @@ class User(DjangoUser, PersonMixin, Person, SlideMixin):
return self.get_full_name() or self.username
def get_name_suffix(self):
return self.detail
return self.structure_level
def set_name_suffix(self, value):
self.detail = value
self.structure_level = value
name_suffix = property(get_name_suffix, set_name_suffix)

View File

@ -26,11 +26,11 @@
<option value="female"{% if 'female' in sortfilter.gender %} selected{% endif %}>{% trans "Female" %}</option>
<option value=""{% if '' in sortfilter.gender %} selected{% endif %}>{% trans "Not specified" %}</option>
</select>
<select class="default-input" name="detail" onchange="document.forms['filter'].submit()">
<option value="---">-- {% trans "Detail" %} --</option>
{% for detail in details %}
<option value="{{ detail }}"{% if detail in sortfilter.detail %} selected{% endif %}>
{{ detail }}</option>
<select class="default-input" name="structure_level" onchange="document.forms['filter'].submit()">
<option value="---">-- {% trans "Structure level" %} --</option>
{% for level in structure_levels %}
<option value="{{ level }}"{% if level in sortfilter.structure_level %} selected{% endif %}>
{{ level }}</option>
{% endfor %}
</select>
<select class="default-input" name="type" onchange="document.forms['filter'].submit()">
@ -65,7 +65,7 @@
<tr>
<th><a href="?sort=first_name&reverse={% if 'first_name' in sortfilter.sort and 'reverse' not in sortfilter %}1{% else %}---{%endif%}">{% trans "First Name" %}</a></th>
<th><a href="?sort=last_name&reverse={% if 'last_name' in sortfilter.sort and 'reverse' not in sortfilter %}1{% else %}---{%endif%}">{% trans "Last Name" %}</a></th>
<th><a href="?sort=detail&reverse={% if 'detail' in sortfilter.sort and 'reverse' not in sortfilter %}1{% else %}---{%endif%}">{% trans "Detail" %}</a></th>
<th><a href="?sort=structure_level&reverse={% if 'structure_level' in sortfilter.sort and 'reverse' not in sortfilter %}1{% else %}---{%endif%}">{% trans "Structure level" %}</a></th>
<th><a href="?sort=type&reverse={% if 'type' in sortfilter.sort and 'reverse' not in sortfilter %}1{% else %}---{%endif%}">{% trans "Type" %}</a></th>
<th><a href="?sort=committee&reverse={% if 'committee' in sortfilter.sort and 'reverse' not in sortfilter %}1{% else %}---{%endif%}">{% trans "Committee" %}</a></th>
{% if perms.participant.can_manage_participant %}
@ -78,7 +78,7 @@
<tr class="{% cycle '' 'odd' %}">
<td><a href="{% model_url user 'view' %}">{{ user.first_name }}</a></td>
<td><a href="{% model_url user 'view' %}">{{ user.last_name }}</a></td>
<td>{{ user.detail }}</td>
<td>{{ user.structure_level }}</td>
<td>{{ user.get_type_display }}</td>
<td>{{ user.committee }}</td>
{% if perms.participant.can_manage_participant %}

View File

@ -38,7 +38,7 @@ class UserTest(TestCase):
self.assertEqual(unicode(self.user1), 'Max Mustermann')
def test_name_suffix(self):
self.user1.detail = 'München'
self.user1.structure_level = 'München'
self.user1.save()
self.assertEqual(unicode(self.user1), 'Max Mustermann (München)')

View File

@ -71,7 +71,7 @@ class UserOverview(ListView):
except KeyError:
sortfilter = {}
for value in ['gender', 'detail', 'type', 'committee', 'status',
for value in ['gender', 'structure_level', 'type', 'committee', 'status',
'sort', 'reverse']:
if value in self.request.REQUEST:
if self.request.REQUEST[value] == '---':
@ -85,8 +85,8 @@ class UserOverview(ListView):
query = User.objects
if 'gender' in sortfilter:
query = query.filter(gender__iexact=sortfilter['gender'][0])
if 'detail' in sortfilter:
query = query.filter(detail__iexact=sortfilter['detail'][0])
if 'structure_level' in sortfilter:
query = query.filter(structure_level__iexact=sortfilter['structure_level'][0])
if 'type' in sortfilter:
query = query.filter(type__iexact=sortfilter['type'][0])
if 'committee' in sortfilter:
@ -97,7 +97,7 @@ class UserOverview(ListView):
if sortfilter['sort'][0] in ['first_name', 'last_name', 'last_login']:
query = query.order_by(sortfilter['sort'][0])
elif (sortfilter['sort'][0] in
['detail', 'type', 'committee', 'comment']):
['structure_level', 'type', 'committee', 'comment']):
query = query.order_by(
'%s' % sortfilter['sort'][0])
else:
@ -125,8 +125,8 @@ class UserOverview(ListView):
percent = 0
# list of all existing categories
details = [p['detail'] for p in User.objects.values('detail')
.exclude(detail='').distinct()]
structure_levels = [p['structure_level'] for p in User.objects.values('structure_level')
.exclude(structure_level='').distinct()]
# list of all existing committees
committees = [p['committee'] for p in User.objects.values('committee')
.exclude(committee='').distinct()]
@ -135,7 +135,7 @@ class UserOverview(ListView):
'allusers': all_users,
'request_user': self.request.user,
'percent': round(percent, 1),
'details': details,
'structure_levels': structure_levels,
'committees': committees,
'cookie': ['participant_sortfilter', urlencode(decodedict(self.sortfilter),
doseq=True)],
@ -268,7 +268,7 @@ class ParticipantsListPDF(PDFView):
counter,
Paragraph(user.last_name, stylesheet['Tablecell']),
Paragraph(user.first_name, stylesheet['Tablecell']),
Paragraph(user.detail, stylesheet['Tablecell']),
Paragraph(user.structure_level, stylesheet['Tablecell']),
Paragraph(user.get_type_display(), stylesheet['Tablecell']),
Paragraph(user.committee, stylesheet['Tablecell'])])
t = LongTable(data, style=[