From 3f0c31d12b953282cd46b30a7256b046f0097635 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Norman=20J=C3=A4ckel?= Date: Fri, 26 Oct 2012 18:16:09 +0200 Subject: [PATCH] Add user widget and group widget, see # 379 --- .../templates/participant/group_widget.html | 26 +++++++++++++++++++ .../templates/participant/user_widget.html | 24 +++++++++++++++++ openslides/participant/views.py | 21 +++++++++++---- 3 files changed, 66 insertions(+), 5 deletions(-) create mode 100644 openslides/participant/templates/participant/group_widget.html create mode 100644 openslides/participant/templates/participant/user_widget.html diff --git a/openslides/participant/templates/participant/group_widget.html b/openslides/participant/templates/participant/group_widget.html new file mode 100644 index 000000000..5900ef547 --- /dev/null +++ b/openslides/participant/templates/participant/group_widget.html @@ -0,0 +1,26 @@ +{% load i18n %} +{% load tags %} + + diff --git a/openslides/participant/templates/participant/user_widget.html b/openslides/participant/templates/participant/user_widget.html new file mode 100644 index 000000000..21e0db5a9 --- /dev/null +++ b/openslides/participant/templates/participant/user_widget.html @@ -0,0 +1,24 @@ +{% load i18n %} +{% load tags %} + + diff --git a/openslides/participant/views.py b/openslides/participant/views.py index 1dd58185e..12fe213fc 100644 --- a/openslides/participant/views.py +++ b/openslides/participant/views.py @@ -517,9 +517,8 @@ def get_widgets(request): """ return [ get_personal_info_widget(request), - #get_user_widget(request), - #get_group_widget(request) - ] + get_user_widget(request), + get_group_widget(request)] def get_personal_info_widget(request): @@ -548,7 +547,13 @@ def get_user_widget(request): Provides a widget with all users. This is for short activation of user slides. """ - pass + return Widget( + name='user', + display_name=_('Users'), + template='participant/user_widget.html', + context={'users': User.objects.all(),}, + permission_required='projector.can_manage_projector', + default_column=1) def get_group_widget(request): @@ -556,4 +561,10 @@ def get_group_widget(request): Provides a widget with all groups. This is for short activation of group slides. """ - pass + return Widget( + name='group', + display_name=_('Groups'), + template='participant/group_widget.html', + context={'groups': Group.objects.all(),}, + permission_required='projector.can_manage_projector', + default_column=1)