Merge pull request #45 from normanjaeckel/GroupSlide

Insert a slide for groups
This commit is contained in:
Oskar Hahn 2012-11-21 12:18:17 -08:00
commit 2acfd02144
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 %}