project ProjectorSlide

This commit is contained in:
Oskar Hahn 2012-04-14 11:37:12 +02:00
parent c0bf5ba822
commit 15a34fda97
3 changed files with 24 additions and 0 deletions

View File

@ -13,6 +13,14 @@ class ProjectorSlide(models.Model, SlideMixin):
text = models.TextField(null=True, blank=True, verbose_name=_("Text")) text = models.TextField(null=True, blank=True, verbose_name=_("Text"))
weight = models.IntegerField(default=0, verbose_name=_("Weight")) weight = models.IntegerField(default=0, verbose_name=_("Weight"))
def slide(self):
return {
'slide': self,
'title': self.title,
'template': 'projector/ProjectorSlide.html',
}
def __unicode__(self): def __unicode__(self):
return self.title return self.title

View File

@ -0,0 +1,14 @@
{% extends "base-projector.html" %}
{% load i18n %}
{% block title %}{{ block.super }} - {{ slide.title }}{% endblock %}
{% block content %}
{% if slide.text %}
<h1>{{ slide.title }}</h1>
{{ slide.text|safe|linebreaks }}
{% else %}
<div class="item_fullscreen">{{ slide.title }}</div>
{% endif %}
{% endblock %}

View File

@ -90,6 +90,8 @@ def active_slide(request):
data['ajax'] = 'on' data['ajax'] = 'on'
data['messages'] = [] data['messages'] = []
# Projector Messages
active_defs = ProjectorMessage.objects.filter(active=True).values_list('def_name', flat=True) active_defs = ProjectorMessage.objects.filter(active=True).values_list('def_name', flat=True)
for receiver, response in projector_messages.send(sender='active_slide', register=False, call=active_defs): for receiver, response in projector_messages.send(sender='active_slide', register=False, call=active_defs):
if response is not None: if response is not None: