From 71eb529adf9f1622f7ec6837fa7fae89dcd16bea Mon Sep 17 00:00:00 2001 From: Emanuel Schuetze Date: Sat, 17 Nov 2012 20:59:30 +0100 Subject: [PATCH] Fixed #403: Moved projector control icons into projector live widget (Added RequestContext to check perms in template.) --- .../templates/projector/dashboard.html | 21 -------------- .../templates/projector/live_view_widget.html | 29 +++++++++++++++++++ openslides/projector/views.py | 2 ++ 3 files changed, 31 insertions(+), 21 deletions(-) diff --git a/openslides/projector/templates/projector/dashboard.html b/openslides/projector/templates/projector/dashboard.html index 5b6b9091e..4debd4139 100644 --- a/openslides/projector/templates/projector/dashboard.html +++ b/openslides/projector/templates/projector/dashboard.html @@ -15,27 +15,6 @@ {% block content %}

{% trans 'Dashboard' %}

- {% if perms.projector.can_manage_projector %} -
- - {% trans "Adjust projector view" %}: - - - - - - - - - - - - - - - -
- {% endif %}
{% for name, widget in widgets.items %} diff --git a/openslides/projector/templates/projector/live_view_widget.html b/openslides/projector/templates/projector/live_view_widget.html index 69672f157..0904868f1 100644 --- a/openslides/projector/templates/projector/live_view_widget.html +++ b/openslides/projector/templates/projector/live_view_widget.html @@ -1,7 +1,36 @@ {% load i18n %} {% load tags %} +{% load staticfiles %} + +{% if perms.projector.can_manage_projector %} +
+

+ + +
+ + + +

+

+ + +
+ + + +

+

+ + + +

+
+{% endif %} + +
diff --git a/openslides/projector/views.py b/openslides/projector/views.py index 7f008c87e..2b117ce38 100644 --- a/openslides/projector/views.py +++ b/openslides/projector/views.py @@ -22,6 +22,7 @@ from django.db import transaction from django.db.models import Q from django.dispatch import receiver from django.shortcuts import redirect +from django.template import RequestContext from django.utils.datastructures import SortedDict from django.utils.importlib import import_module from django.utils.translation import ugettext_lazy as _ @@ -410,6 +411,7 @@ def get_widgets(request): name='live_view', display_name=_('Projector live view'), template='projector/live_view_widget.html', + context = RequestContext(request, {}), permission_required='projector.can_see_projector', default_column=2))