diff --git a/openslides/projector/models.py b/openslides/projector/models.py index 885898ec6..c8ecb4879 100644 --- a/openslides/projector/models.py +++ b/openslides/projector/models.py @@ -21,7 +21,6 @@ class ProjectorSlide(models.Model, SlideMixin): 'template': 'projector/ProjectorSlide.html', } - def __unicode__(self): return self.title diff --git a/openslides/projector/projector.py b/openslides/projector/projector.py index aeb6e0b85..34765d2eb 100644 --- a/openslides/projector/projector.py +++ b/openslides/projector/projector.py @@ -70,7 +70,7 @@ class Slide(object): @receiver(projector_messages, dispatch_uid="projector_countdown") def countdown(sender, **kwargs): - name = _('Projector Countdown') + name = _('Countdown') if kwargs['register']: return name if name in kwargs['call']: diff --git a/openslides/projector/templates/projector/base_projector.html b/openslides/projector/templates/projector/base_projector.html index d944f8398..3e5b4bc08 100644 --- a/openslides/projector/templates/projector/base_projector.html +++ b/openslides/projector/templates/projector/base_projector.html @@ -15,9 +15,6 @@
  • {% trans 'Overview' %}
  • -
  • - {% trans 'Messages' %} -
  • {% endif %} {% if perms.projector.can_see_projector %}
  • diff --git a/openslides/projector/templates/projector/control.html b/openslides/projector/templates/projector/control.html index 31e6298ad..c5193dc68 100644 --- a/openslides/projector/templates/projector/control.html +++ b/openslides/projector/templates/projector/control.html @@ -71,7 +71,7 @@
    {% for category, slides in categories.items %} - + {% if category != 'projector' %}
    {{ category }}
    @@ -100,11 +100,13 @@ {% endif %} {% endfor %}
    -
    +
    + {% endif %} {% endfor %} - +
    +
    {% trans "Projector Live View" %} @@ -114,13 +116,68 @@
    -
    -
    -
    {% trans "Hidden information" %}
    -
    - TODO: list hidden agenda items -
    -
    - + + + {% for category, slides in categories.items %} + {% if category == 'projector' %} +
    +
    {{ category }}
    +
    + {% for slide in slides %} + {% if slide.model_slide %} +
      + {% for slide in slide.get_items %} +
    • + {% for i in slide.get_ancestors %}   {% endfor %} + {{ slide }} + {% if slide.children.exists %} + + {% endif %} +
    • + {% endfor %} +
    + {% else %} +
    +
      +
    • {{ slide.key }}
    • +
    + {% endif %} + {% endfor %} +
    +
    + {% endif %} + {% endfor %} + + +
    +
    {% trans 'Messages' %}
    +
    +
      +
      {% csrf_token %} +
        + {% for message in projector_messages %} +
      • + {{ message }} +
      • + {% endfor %} +
      + + + +
      +
    +
    +
    + {% endblock %} diff --git a/openslides/projector/templates/projector/messages.html b/openslides/projector/templates/projector/messages.html deleted file mode 100644 index bb02e0102..000000000 --- a/openslides/projector/templates/projector/messages.html +++ /dev/null @@ -1,24 +0,0 @@ -{% extends "projector/base_projector.html" %} - -{% load tags %} -{% load i18n %} - -{% block content %} -

    {% trans 'Messages' %}

    -
    {% csrf_token %} - - - - -
    -{% endblock %} diff --git a/openslides/projector/urls.py b/openslides/projector/urls.py index d08962745..0138ede2a 100644 --- a/openslides/projector/urls.py +++ b/openslides/projector/urls.py @@ -14,7 +14,7 @@ from django.conf.urls.defaults import * from utils.views import CreateView -from views import ControlView, ActivateView, MessagesView +from views import ControlView, ActivateView from agenda.views import ItemUpdate from models import ProjectorSlide @@ -54,11 +54,6 @@ urlpatterns = patterns('projector.views', name='projector_new', ), - url(r'^messages/$', - MessagesView.as_view(), - name='projector_messages', - ), - url(r'^bigger/$', 'projector_edit', {'direction': 'bigger'}, name='projector_bigger'), diff --git a/openslides/projector/views.py b/openslides/projector/views.py index ec7e8aebf..d55749736 100644 --- a/openslides/projector/views.py +++ b/openslides/projector/views.py @@ -40,6 +40,27 @@ class ControlView(TemplateView): template_name = 'projector/control.html' permission_required = 'projector.can_manage_projector' + def get_projector_messages(self): + messages = [] + for receiver, name in projector_messages.send(sender='registerer', register=True): + if name is not None: + try: + projector_message = ProjectorMessage.objects.get(def_name=name) + except ProjectorMessage.DoesNotExist: + projector_message = ProjectorMessage(def_name=name, active=False) + projector_message.save() + messages.append(projector_message) + return messages + + def post(self, request, *args, **kwargs): + for message in self.get_projector_messages(): + if message.def_name in request.POST: + message.active = True + else: + message.active = False + message.save() + return self.get(request, *args, **kwargs) + def get_context_data(self, **kwargs): context = super(ControlView, self).get_context_data(**kwargs) categories = {} @@ -56,6 +77,7 @@ class ControlView(TemplateView): 'categories': ordered_categories, 'countdown_visible': config['countdown_visible'], 'countdown_time': config['agenda_countdown_time'], + 'projector_messages': self.get_projector_messages(), }) return context @@ -120,38 +142,6 @@ def active_slide(request): ) -class MessagesView(TemplateView): - permission_required = 'projector.can_manage_projector' - template_name = 'projector/messages.html' - - def get_projector_messages(self): - messages = [] - for receiver, name in projector_messages.send(sender='registerer', register=True): - if name is not None: - try: - projector_message = ProjectorMessage.objects.get(def_name=name) - except ProjectorMessage.DoesNotExist: - projector_message = ProjectorMessage(def_name=name, active=False) - projector_message.save() - messages.append(projector_message) - return messages - - def post(self, request, *args, **kwargs): - for message in self.get_projector_messages(): - if message.def_name in request.POST: - message.active = True - else: - message.active = False - message.save() - - return self.get(request, *args, **kwargs) - - - def get_context_data(self, **kwargs): - context = super(MessagesView, self).get_context_data(**kwargs) - context['projector_messages'] = self.get_projector_messages() - return context - @permission_required('agenda.can_manage_agenda') def projector_edit(request, direction):