2013-02-05 18:46:46 +01:00
|
|
|
|
#!/usr/bin/env python
|
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
"""
|
|
|
|
|
openslides.motion.slides
|
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
2013-02-06 23:56:21 +01:00
|
|
|
|
Defines the slides for the motion app.
|
2013-02-05 18:46:46 +01:00
|
|
|
|
|
2013-03-01 17:13:12 +01:00
|
|
|
|
:copyright: (c) 2011–2013 by the OpenSlides team, see AUTHORS.
|
2013-02-05 18:46:46 +01:00
|
|
|
|
:license: GNU GPL, see LICENSE for more details.
|
|
|
|
|
"""
|
|
|
|
|
|
2013-08-04 12:59:11 +02:00
|
|
|
|
from django.template.loader import render_to_string
|
|
|
|
|
|
|
|
|
|
from openslides.projector.api import register_slide
|
2013-02-02 00:27:16 +01:00
|
|
|
|
from .models import Motion
|
|
|
|
|
|
2013-08-04 12:59:11 +02:00
|
|
|
|
|
|
|
|
|
def motion_slide(**kwargs):
|
|
|
|
|
"""
|
|
|
|
|
Slide for the motion app.
|
|
|
|
|
"""
|
|
|
|
|
motion_pk = kwargs.get('pk', None)
|
|
|
|
|
try:
|
|
|
|
|
motion = Motion.objects.get(pk=motion_pk)
|
|
|
|
|
except Motion.DoesNotExist:
|
|
|
|
|
return ''
|
|
|
|
|
|
|
|
|
|
context = {
|
|
|
|
|
'motion': motion,
|
|
|
|
|
'title': motion.title}
|
|
|
|
|
|
|
|
|
|
return render_to_string('motion/slide.html', context)
|
|
|
|
|
|
|
|
|
|
register_slide(Motion.slide_callback_name, motion_slide)
|