From ff19e6d2c8f955fff7ae4059184176401112d6b6 Mon Sep 17 00:00:00 2001 From: Oskar Hahn Date: Sun, 1 Jul 2012 16:10:26 +0200 Subject: [PATCH] #247 summary of items for the projector --- openslides/agenda/models.py | 22 +++++++++++++------ .../agenda/templates/agenda/item_row.html | 3 +++ .../templates/projector/AgendaSummary.html | 2 +- openslides/projector/api.py | 4 ++-- openslides/projector/urls.py | 5 ++--- openslides/projector/views.py | 6 +++-- 6 files changed, 27 insertions(+), 15 deletions(-) diff --git a/openslides/agenda/models.py b/openslides/agenda/models.py index 817518c55..36e5df50b 100644 --- a/openslides/agenda/models.py +++ b/openslides/agenda/models.py @@ -68,13 +68,21 @@ class Item(MPTTModel, SlideMixin): """ Return a map with all Data for the Slide """ - if self.releated_sid: - return self.get_releated_slide().slide() - data = { - 'item': self, - 'title': self.get_title(), - 'template': 'projector/AgendaText.html', - } + if config['presentation_argument'] == 'summary': + print 'soweit schonmal' + data = { + 'title': self.get_title(), + 'items': self.get_children(), + 'template': 'projector/AgendaSummary.html', + } + elif self.releated_sid: + data = self.get_releated_slide().slide() + else: + data = { + 'item': self, + 'title': self.get_title(), + 'template': 'projector/AgendaText.html', + } return data def set_closed(self, closed=True): diff --git a/openslides/agenda/templates/agenda/item_row.html b/openslides/agenda/templates/agenda/item_row.html index 8cc4c27a2..a4bb9b353 100644 --- a/openslides/agenda/templates/agenda/item_row.html +++ b/openslides/agenda/templates/agenda/item_row.html @@ -39,6 +39,9 @@ {% if perms.agenda.can_manage_agenda %} + {% if not item.is_leaf_node %} + + {% endif %} {% endif %} diff --git a/openslides/agenda/templates/projector/AgendaSummary.html b/openslides/agenda/templates/projector/AgendaSummary.html index 8c1926aa1..87ef6da55 100644 --- a/openslides/agenda/templates/projector/AgendaSummary.html +++ b/openslides/agenda/templates/projector/AgendaSummary.html @@ -7,7 +7,7 @@ {% endblock %} {% block content %} -

{%trans "Agenda" %}

+

{% if title %}{{ title }}{% else %}{% trans "Agenda" %}{% endif %}

{% endblock %} {% block scrollcontent %} diff --git a/openslides/projector/api.py b/openslides/projector/api.py index bafd1bbcf..59bc41c2d 100644 --- a/openslides/projector/api.py +++ b/openslides/projector/api.py @@ -68,8 +68,9 @@ def get_active_slide(only_sid=False): return get_slide_from_sid(sid) -def set_active_slide(sid): +def set_active_slide(sid, argument=None): config["presentation"] = sid + config['presentation_argument'] = argument def register_slidemodel(model, model_name=None, control_template=None, weight=0): @@ -115,7 +116,6 @@ def projector_message_set(message, sid=None): overlay = ProjectorOverlay.objects.get(def_name='Message') except ProjectorOverlay.DoesNotExist: overlay = ProjectorOverlay(def_name='Message', active=True) - print "hier mal ein ", sid overlay.sid=sid overlay.save() diff --git a/openslides/projector/urls.py b/openslides/projector/urls.py index 02ec7ff55..7343b1cb8 100644 --- a/openslides/projector/urls.py +++ b/openslides/projector/urls.py @@ -43,10 +43,9 @@ urlpatterns = patterns('projector.views', name='projector_activate_slide', ), - url(r'^activate/(?P[^/]*)/summary/$', + url(r'^activate/(?P[^/]*)/(?P[^/]*)/$', ActivateView.as_view(), - {'summary': True}, - name='projector_activate_summary', + name='projector_activate_slide', ), url(r'^new/$', diff --git a/openslides/projector/views.py b/openslides/projector/views.py index d1218f30d..28298b9c7 100644 --- a/openslides/projector/views.py +++ b/openslides/projector/views.py @@ -99,7 +99,10 @@ class ActivateView(RedirectView): allow_ajax = True def pre_redirect(self, request, *args, **kwargs): - set_active_slide(kwargs['sid']) + try: + set_active_slide(kwargs['sid'], kwargs['argument']) + except KeyError: + set_active_slide(kwargs['sid']) config['up'] = 0 config['bigger'] = 100 @@ -164,7 +167,6 @@ class Projector(TemplateView, AjaxMixin): else: data = get_slide_from_sid(sid) ajax = 'off' - print data if data is None: data = {