From 8e886a22ef67202c20609334796e174ca370847d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Norman=20J=C3=A4ckel?= Date: Wed, 21 Nov 2012 14:22:30 +0100 Subject: [PATCH] Insert a slide for groups --- openslides/participant/models.py | 13 +++++++++- .../templates/projector/GroupSlide.html | 25 +++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 openslides/participant/templates/projector/GroupSlide.html diff --git a/openslides/participant/models.py b/openslides/participant/models.py index 68d4034a3..2437ceba7 100644 --- a/openslides/participant/models.py +++ b/openslides/participant/models.py @@ -125,7 +125,8 @@ class User(DjangoUser, PersonMixin, Person, SlideMixin): register_slidemodel(User) -class Group(DjangoGroup, PersonMixin, Person): +class Group(DjangoGroup, PersonMixin, Person, SlideMixin): + prefix = 'group' # This is for the slides person_prefix = 'group' django_group = models.OneToOneField(DjangoGroup, editable=False, parent_link=True) @@ -155,6 +156,16 @@ class Group(DjangoGroup, PersonMixin, Person): class Meta: ordering = ('name',) + def slide(self): + """ + Returns a map with the data for the slides. + """ + return { + 'group': self, + 'title': self.name, + 'template': 'projector/GroupSlide.html'} + +register_slidemodel(Group) class UsersAndGroupsToPersons(object): """ diff --git a/openslides/participant/templates/projector/GroupSlide.html b/openslides/participant/templates/projector/GroupSlide.html new file mode 100644 index 000000000..26d420bef --- /dev/null +++ b/openslides/participant/templates/projector/GroupSlide.html @@ -0,0 +1,25 @@ +{% extends "base-projector.html" %} + +{% load i18n %} +{% load tags %} + +{% block title %}{{ block.super }} - {{ title }}{% endblock %} + +{% block content %} + +

{{ group }}

+

{{ group.description }}

+ +

{% trans "Members" %}

+ +{% endblock %} + +{% block scrollcontent %} + + {% for member in group.user_set.all %} +

{{ member }}

+ {% empty %} +

{% trans "No members available." %}

+ {% endfor %} + +{% endblock %}