Merge pull request #45 from normanjaeckel/GroupSlide
Insert a slide for groups
This commit is contained in:
commit
2acfd02144
@ -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):
|
||||
"""
|
||||
|
25
openslides/participant/templates/projector/GroupSlide.html
Normal file
25
openslides/participant/templates/projector/GroupSlide.html
Normal 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 %}
|
Loading…
Reference in New Issue
Block a user