Merge pull request #34 from normanjaeckel/UserSlide

Add UserSlide with new template.
This commit is contained in:
Oskar Hahn 2012-11-08 00:25:04 -08:00
commit de7d4ed6cd
2 changed files with 57 additions and 1 deletions

View File

@ -22,8 +22,11 @@ from openslides.utils.person.signals import receive_persons
from openslides.config.models import config
from openslides.config.signals import default_config_value
from openslides.projector.api import register_slidemodel
from openslides.projector.projector import SlideMixin
class User(DjangoUser, PersonMixin, Person):
class User(DjangoUser, PersonMixin, Person, SlideMixin):
prefix = 'user' # This is for the slides
person_prefix = 'user'
GENDER_CHOICES = (
('male', _('Male')),
@ -111,6 +114,16 @@ class User(DjangoUser, PersonMixin, Person):
)
ordering = ('last_name',)
def slide(self):
"""
Returns a map with the data for the slides.
"""
return {
'shown_user': self,
'title': self.clean_name,
'template': 'projector/UserSlide.html'}
register_slidemodel(User)
class Group(DjangoGroup, PersonMixin, Person):
person_prefix = 'group'

View File

@ -0,0 +1,43 @@
{% extends "base-projector.html" %}
{% load i18n %}
{% load tags %}
{% block title %}{{ block.super }} - {{ title }}{% endblock %}
{% block content %}
<div id='sidebar'>
<div class='box'>
<p><strong>{% trans "Groups" %}</strong><br />
{% for group in shown_user.groups.all %}
{{ group }},
{% empty %}
{% trans "The participant is not member of any group." %}
{% endfor %}
</p>
{% if shown_user.get_gender_display %}
<p><strong>{% trans "Gender" %}</strong><br />{{ shown_user.get_gender_display }}</p>
{% endif %}
{% if shown_user.get_type_display %}
<p><strong>{% trans "Type" %}</strong><br />{{ shown_user.get_type_display }}</p>
{% endif %}
{% if shown_user.committee %}
<p><strong>{% trans "Committee" %}</strong><br />{{ shown_user.committee }}</p>
{% endif %}
</div>
</div>
<h1>{{ shown_user }}</h1>
<p>{{ shown_user.email }}</p>
{% endblock %}
{% block scrollcontent %}
<p>
<div class="text">{{ shown_user.about_me|linebreaks }}</div>
</p>
{% endblock %}