fix error by activating the Agenda

This commit is contained in:
Oskar Hahn 2012-04-15 15:46:32 +02:00
parent a3808c7b30
commit 90038c1ad2
6 changed files with 25 additions and 40 deletions

View File

@ -124,7 +124,7 @@ register_slidemodel(Item, model_name=_('Agenda Item'))
from projector.api import register_slidefunc
from agenda.slides import agenda_show
register_slidefunc(_('Agenda'), agenda_show, weight=-1)
register_slidefunc('agenda', agenda_show, weight=-1, name=_('Agenda'))
from django.dispatch import receiver

View File

@ -0,0 +1,18 @@
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"></head><body>{% extends "base-projector.html" %}
{% load i18n %}
{% block title %}{{ block.super }} -
{% if title %} {{ title }} {% else %} {%trans "Agenda" %} {% endif %}
{% endblock %}
{% block content %}
<h1>{%trans "Agenda" %}</h1>
<ul class="itemlist">
{% for item in items %}
<li{% if item.closed %} class="closed" {% endif %}>{{ item }}
{% endfor %}
</li{%></ul>
{% endblock %}
</body></html>

View File

@ -56,7 +56,7 @@ def register_slidemodel(model, model_name=None, control_template=None, weight=0)
)
def register_slidefunc(key, func, control_template=None, weight=0):
def register_slidefunc(key, func, control_template=None, weight=0, name=''):
#TODO: Warn if there already is a slide with this prefix
if control_template is None:
control_template = 'projector/default_control_slidefunc.html'
@ -68,4 +68,5 @@ def register_slidefunc(key, func, control_template=None, weight=0):
key=key,
control_template=control_template,
weight=weight,
name=name,
)

View File

@ -49,7 +49,7 @@ class SlideMixin(object):
class Slide(object):
def __init__(self, model_slide=False, func=None, model=None, category=None,
key=None, model_name='', control_template='', weight=0):
key=None, model_name='', control_template='', weight=0, name=''):
"""
model_slide: Boolean if the value is a Model.
func: The function to call. Only if modelslide is False.
@ -66,6 +66,7 @@ class Slide(object):
self.key = key
self.control_template = control_template
self.weight = weight
self.name = name
def get_items(self):
try:

View File

@ -97,41 +97,6 @@
</div>
</div> <!-- end portlet-->
<!-- Single Slides -->
{% for category, slides in categories.items %}
{% if category == 'projector' %}
<div class="portlet">
<div class="portlet-header">{% trans "Static Slides" %}</div>
<div class="portlet-content">
{% for slide in slides %}
{% if slide.model_slide %}
<ul style="line-height: 180%">
{% for slide in slide.get_items %}
<li class="{% if slide.active %}activeline{% endif %}"><a href="{% url projector_activate_slide slide.sid %}"
class="activate_link {% if slide.active %}active{% endif %}"
><div></div></a>
{% for i in slide.get_ancestors %}&nbsp;&nbsp;&nbsp;{% endfor %}
<a href="{% url projector_edit_slide slide.id %}">{{ slide }}</a>
{% if slide.children.exists %}
<a href="{% url projector_activate_summary slide.sid %}"><img src="{% static 'images/icons/view-list-tree.png' %}" title="{% trans 'Select item overview' %}"></a>
{% endif %}
</li>
{% endfor %}
</ul>
{% else %}
<hr>
<ul style="line-height: 180%">
<li><a href="{% url projector_activate_slide slide.key %}"
class="activate_link {% if slide.active %}active{% endif %}"
><div></div></a>{{ slide.key }}</li>
</ul>
{% endif %}
{% endfor %}
</div>
</div> <!-- end portlet-->
{% endif %}
{% endfor %}
<!-- Messages (Countdown etc.)-->
<div class="portlet">
<div class="portlet-header">{% trans 'Messages' %}</div>

View File

@ -3,10 +3,10 @@
<ul style="line-height: 180%">
<li>
<a href="{% url projector_activate_slide slide.key %}" class="activate_link {% if slide.active %}active{% endif %}">
<a href="{% url projector_activate_slide slides.key %}" class="activate_link {% if slides.active %}active{% endif %}">
<div></div>
</a>
{{ slides.key }}
{{ slides.name }}
</li>
</ul>