diff --git a/openslides/agenda/views.py b/openslides/agenda/views.py index cab549e83..deb3e69a6 100644 --- a/openslides/agenda/views.py +++ b/openslides/agenda/views.py @@ -229,7 +229,5 @@ def get_widgets(request): template='agenda/widget.html', context={ 'agenda': SLIDE['agenda'], - 'items': Item.objects.all(), - } - ), - ] + 'items': Item.objects.all()}, + permission_required='agenda.can_manage_agenda')] diff --git a/openslides/application/views.py b/openslides/application/views.py index 15453ce38..37a0e08b4 100644 --- a/openslides/application/views.py +++ b/openslides/application/views.py @@ -917,6 +917,8 @@ def register_tab(request): def get_widgets(request): return [ - Widget(name='applications', template='application/widget.html', - context={'applications': Application.objects.all()}) - ] + Widget( + name='applications', + template='application/widget.html', + context={'applications': Application.objects.all()}, + permission_required='application.can_manage_application')] diff --git a/openslides/assignment/views.py b/openslides/assignment/views.py index 56dc26448..7bffaa18e 100644 --- a/openslides/assignment/views.py +++ b/openslides/assignment/views.py @@ -657,6 +657,8 @@ def register_tab(request): def get_widgets(request): return [ - Widget(name=_('Assignments'), template='assignment/widget.html', - context={'assignments': Assignment.objects.all()}) - ] + Widget( + name=_('Assignments'), + template='assignment/widget.html', + context={'assignments': Assignment.objects.all()}, + permission_required='assignment.can_manage_assignment')] diff --git a/openslides/projector/projector.py b/openslides/projector/projector.py index 140592698..09942831e 100644 --- a/openslides/projector/projector.py +++ b/openslides/projector/projector.py @@ -106,13 +106,20 @@ class Widget(object): Class for a Widget for the Projector-Tab. """ def __init__(self, name, html=None, template=None, context={}, - permission_required=None): + permission_required=None, display_name=None, default_column=1): self.name = name + if display_name is None: + self.display_name = name.capitalize() + else: + self.display_name = display_name + if html is not None: self.html = html elif template is not None: self.html = render_to_string(template, context) + self.permission_required = permission_required + self.default_column = default_column def get_name(self): return self.name.lower() @@ -121,7 +128,10 @@ class Widget(object): return self.html def get_title(self): - return self.name.capitalize() + return self.display_name + + def __repr__(self): + return self.get_name() @receiver(projector_overlays, dispatch_uid="projector_countdown") diff --git a/openslides/projector/templates/projector/control_overlay_message.html b/openslides/projector/templates/projector/control_overlay_message.html index 7eac70430..16803ec4a 100644 --- a/openslides/projector/templates/projector/control_overlay_message.html +++ b/openslides/projector/templates/projector/control_overlay_message.html @@ -1,6 +1,7 @@ {% load staticfiles %} {% load i18n %} {% load tags %} +