diff --git a/openslides/participant/models.py b/openslides/participant/models.py
index cabb54b7a..2490b89d7 100644
--- a/openslides/participant/models.py
+++ b/openslides/participant/models.py
@@ -78,14 +78,17 @@ class User(DjangoUser, PersonMixin, Person):
self.save()
@models.permalink
- def get_absolute_url(self, link='edit'):
+ def get_absolute_url(self, link='view'):
"""
Return the URL to this user.
link can be:
+ * view
* edit
* delete
"""
+ if link == 'view':
+ return ('user_view', [str(self.id)])
if link == 'edit':
return ('user_edit', [str(self.id)])
if link == 'delete':
@@ -114,14 +117,17 @@ class Group(DjangoGroup, PersonMixin, Person):
description = models.TextField(blank=True)
@models.permalink
- def get_absolute_url(self, link='edit'):
+ def get_absolute_url(self, link='view'):
"""
Return the URL to this user.
link can be:
+ * view
* edit
* delete
"""
+ if link == 'view':
+ return ('user_group_view', [str(self.id)])
if link == 'edit':
return ('user_group_edit', [str(self.id)])
if link == 'delete':
diff --git a/openslides/participant/templates/participant/base_participant.html b/openslides/participant/templates/participant/base_participant.html
index bb726731d..d9fc3adeb 100644
--- a/openslides/participant/templates/participant/base_participant.html
+++ b/openslides/participant/templates/participant/base_participant.html
@@ -27,4 +27,51 @@
{% trans 'First time passwords as PDF' %}
{% endif %}
+
+ {# second submenu #}
+ {% if shown_user %}
+
+ {{ shown_user.clean_name }}
+
+ {% elif group %}
+
+ {{ group.name }}
+
+ {% endif %}
+
{% endblock %}
diff --git a/openslides/participant/templates/participant/group_detail.html b/openslides/participant/templates/participant/group_detail.html
index 770380218..3a7f748f4 100644
--- a/openslides/participant/templates/participant/group_detail.html
+++ b/openslides/participant/templates/participant/group_detail.html
@@ -1,9 +1,20 @@
{% extends "participant/base_participant.html" %}
-{% block title %}{{ block.super }} – {{ object }}{% endblock %}
+{% load i18n %}
+{% load tags %}
+
+{% block title %}{{ block.super }} – {{ group }}{% endblock %}
{% block content %}
-{{ object }}
+{{ group }}
+
+{{ group.description }}
+
+{% trans "Members" %}
+
+{% for member in group.user_set.all %}
+ {{ member }}
+{% endfor %}
{% endblock %}
diff --git a/openslides/participant/templates/participant/group_overview.html b/openslides/participant/templates/participant/group_overview.html
index 3745308fb..c226f7ec1 100644
--- a/openslides/participant/templates/participant/group_overview.html
+++ b/openslides/participant/templates/participant/group_overview.html
@@ -2,6 +2,7 @@
{% load i18n %}
{% load staticfiles %}
+{% load tags %}
{% block title %}{{ block.super }} – {% trans "User groups" %}{% endblock %}
@@ -14,7 +15,7 @@
{% for group in groups %}
- {{ group.name }} |
+ {{ group.name }} |
{% if group.name != 'Anonymous' %}
diff --git a/openslides/participant/templates/participant/group_widget.html b/openslides/participant/templates/participant/group_widget.html
index 5900ef547..50cd7e6b6 100644
--- a/openslides/participant/templates/participant/group_widget.html
+++ b/openslides/participant/templates/participant/group_widget.html
@@ -17,7 +17,7 @@
- {{ group }}
+ {{ group }}
{% endif %}
{% empty %}
diff --git a/openslides/participant/templates/participant/overview.html b/openslides/participant/templates/participant/overview.html
index f950bc302..0066b1dbe 100644
--- a/openslides/participant/templates/participant/overview.html
+++ b/openslides/participant/templates/participant/overview.html
@@ -76,7 +76,7 @@
|
{% for user in users %}
- {{ user.first_name }} |
+ {{ user.first_name }} |
{{ user.last_name }} |
{{ user.detail }} |
{{ user.get_type_display }} |
diff --git a/openslides/participant/templates/participant/user_detail.html b/openslides/participant/templates/participant/user_detail.html
index 770380218..379248bc1 100644
--- a/openslides/participant/templates/participant/user_detail.html
+++ b/openslides/participant/templates/participant/user_detail.html
@@ -1,9 +1,40 @@
{% extends "participant/base_participant.html" %}
-{% block title %}{{ block.super }} – {{ object }}{% endblock %}
+{% load i18n %}
+{% load tags %}
+
+{% block title %}{{ block.super }} – {{ shown_user }}{% endblock %}
{% block content %}
-{{ object }}
+{{ shown_user }}
+
+{{ shown_user.email }}
+
+{% trans "Groups" %}
+
+ {% for group in shown_user.groups.all %}
+ {{ group }},
+ {% endfor %}
+
+
+{% trans "Gender" %}
+{{ shown_user.get_gender_display }}
+
+{% trans "Type" %}
+{{ shown_user.get_type_display }}
+
+{% trans "Committee" %}
+{{ shown_user.committee }}
+
+{% if perms.participant.can_manage_participant %}
+ {% trans "Comment" %}
+ {{ shown_user.comment }}
+
+ {% trans "Last Login" %}
+ {% if shown_user.last_login > shown_user.date_joined %}
+ {{ shown_user.last_login }}
+ {% endif %}
+{% endif %}
{% endblock %}
diff --git a/openslides/participant/templates/participant/user_widget.html b/openslides/participant/templates/participant/user_widget.html
index 21e0db5a9..e8657cb17 100644
--- a/openslides/participant/templates/participant/user_widget.html
+++ b/openslides/participant/templates/participant/user_widget.html
@@ -16,7 +16,7 @@
- {{ user }}
+ {{ user }}
{% empty %}
{% trans 'No users available.' %}
diff --git a/openslides/participant/urls.py b/openslides/participant/urls.py
index ed98c45c5..e3ac2e553 100644
--- a/openslides/participant/urls.py
+++ b/openslides/participant/urls.py
@@ -34,7 +34,7 @@ urlpatterns = patterns('',
url(r'^(?P\d+)/$',
UserDetailView.as_view(),
- name='user_detail',
+ name='user_view',
),
url(r'^(?P\d+)/edit/$',
@@ -88,7 +88,7 @@ urlpatterns = patterns('',
url(r'^group/(?P\d+)/$',
GroupDetailView.as_view(),
- name='user_group_detail',
+ name='user_group_view',
),
url(r'^group/(?P\d+)/edit/$',
diff --git a/openslides/participant/views.py b/openslides/participant/views.py
index 4fa817128..854b59b31 100644
--- a/openslides/participant/views.py
+++ b/openslides/participant/views.py
@@ -140,19 +140,25 @@ class UserOverview(ListView):
return context
-from django.views.generic.detail import DetailView
-class UserDetailView(DetailView):
+from openslides.utils.views import DetailView, PermissionMixin
+class UserDetailView(DetailView, PermissionMixin):
"""
Classed based view to show a specific user in the interface.
"""
+ permission_required = 'participant.can_see_participant'
model = User
+ template_name = 'participant/user_detail.html'
+ context_object_name = 'shown_user'
-class GroupDetailView(DetailView):
+class GroupDetailView(DetailView, PermissionMixin):
"""
Classed based view to show a specific group in the interface.
"""
+ permission_required = 'participant.can_manage_participant'
model = Group
+ template_name = 'participant/group_detail.html'
+ context_object_name = 'group'
class UserCreateView(CreateView):