Insert a slide for groups

This commit is contained in:
Norman Jäckel 2012-11-21 14:22:30 +01:00
parent 9122052ba6
commit 8e886a22ef
2 changed files with 37 additions and 1 deletions

View File

@ -125,7 +125,8 @@ class User(DjangoUser, PersonMixin, Person, SlideMixin):
register_slidemodel(User) register_slidemodel(User)
class Group(DjangoGroup, PersonMixin, Person): class Group(DjangoGroup, PersonMixin, Person, SlideMixin):
prefix = 'group' # This is for the slides
person_prefix = 'group' person_prefix = 'group'
django_group = models.OneToOneField(DjangoGroup, editable=False, parent_link=True) django_group = models.OneToOneField(DjangoGroup, editable=False, parent_link=True)
@ -155,6 +156,16 @@ class Group(DjangoGroup, PersonMixin, Person):
class Meta: class Meta:
ordering = ('name',) 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): class UsersAndGroupsToPersons(object):
""" """

View File

@ -0,0 +1,25 @@
{% extends "base-projector.html" %}
{% load i18n %}
{% load tags %}
{% block title %}{{ block.super }} - {{ title }}{% endblock %}
{% block content %}
<h1>{{ group }}</h1>
<p>{{ group.description }}</p>
<h2>{% trans "Members" %}</h2>
{% endblock %}
{% block scrollcontent %}
{% for member in group.user_set.all %}
<p>{{ member }}</p>
{% empty %}
<p>{% trans "No members available." %}</p>
{% endfor %}
{% endblock %}