diff --git a/openslides/agenda/__init__.py b/openslides/agenda/__init__.py index e69de29bb..0ef12a1e8 100644 --- a/openslides/agenda/__init__.py +++ b/openslides/agenda/__init__.py @@ -0,0 +1,4 @@ +from projector.api import register_slidefunc +from agenda.slides import agenda_show + +register_slidefunc('agenda_show', agenda_show) diff --git a/openslides/agenda/api.py b/openslides/agenda/api.py index c8d4e9cc7..1fa1a3243 100644 --- a/openslides/agenda/api.py +++ b/openslides/agenda/api.py @@ -22,11 +22,6 @@ def is_summary(): """ True, if a summery shall be displayed """ - from agenda.models import Item - try: - get_active_slide() - except Item.DoesNotExist: - return True if config_get('summary', False): return True return False diff --git a/openslides/agenda/models.py b/openslides/agenda/models.py index 11da03934..9d4aafb2f 100644 --- a/openslides/agenda/models.py +++ b/openslides/agenda/models.py @@ -24,6 +24,7 @@ from system.api import config_set from application.models import Application from poll.models import Poll from assignment.models import Assignment +from agenda.api import is_summary class Item(models.Model, Slide): @@ -45,12 +46,17 @@ class Item(models.Model, Slide): """ Return a map with all Data for the Slide """ - return { + data = { 'item': self, 'title': self.title, 'template': 'projector/AgendaText.html', } + if is_summary(): + data['items'] = self.children.filter(hidden=False) + data['template'] = 'projector/AgendaSummary.html' + return data + @property def active_parent(self): """ @@ -189,6 +195,6 @@ class Item(models.Model, Slide): ItemText = Item # ItemText is Depricated - - register_slidemodel(Item) + + diff --git a/openslides/agenda/slides.py b/openslides/agenda/slides.py new file mode 100644 index 000000000..e6a9c9706 --- /dev/null +++ b/openslides/agenda/slides.py @@ -0,0 +1,13 @@ +from django.utils.translation import ugettext as _ + +from projector.api import register_slidefunc +from agenda.models import Item + +def agenda_show(): + data = {} + items = Item.objects.filter(parent=None) \ + .filter(hidden=False).order_by('weight') + data['title'] = _("Agenda") + data['items'] = items + data['template'] = 'projector/AgendaSummary.html' + return data diff --git a/openslides/agenda/templates/agenda/overview.html b/openslides/agenda/templates/agenda/overview.html index 2c1319477..aa32e4b11 100644 --- a/openslides/agenda/templates/agenda/overview.html +++ b/openslides/agenda/templates/agenda/overview.html @@ -34,10 +34,7 @@ {% block content %}

{% trans "Agenda" %}

- {% if items_hidden and perms.agenda.can_manage_agenda %} - {% trans "Go to hidden items" %} - {% endif %} - {% if items or items_hidden %} + {% if items %}
{% csrf_token %} {% if perms.agenda.can_manage_agenda %}