#247 summary of items for the projector

This commit is contained in:
Oskar Hahn 2012-07-01 16:10:26 +02:00
parent 00eb365b91
commit ff19e6d2c8
6 changed files with 27 additions and 15 deletions

View File

@ -68,13 +68,21 @@ class Item(MPTTModel, SlideMixin):
"""
Return a map with all Data for the Slide
"""
if self.releated_sid:
return self.get_releated_slide().slide()
data = {
'item': self,
'title': self.get_title(),
'template': 'projector/AgendaText.html',
}
if config['presentation_argument'] == 'summary':
print 'soweit schonmal'
data = {
'title': self.get_title(),
'items': self.get_children(),
'template': 'projector/AgendaSummary.html',
}
elif self.releated_sid:
data = self.get_releated_slide().slide()
else:
data = {
'item': self,
'title': self.get_title(),
'template': 'projector/AgendaText.html',
}
return data
def set_closed(self, closed=True):

View File

@ -39,6 +39,9 @@
{% if perms.agenda.can_manage_agenda %}
<a href="{% model_url item 'edit' %}"><img src="{% static 'images/icons/edit.png' %}" title="{% trans 'Edit item' %}"></a>
<a href="{% model_url item 'delete' %}"><img src="{% static 'images/icons/delete.png' %}" title="{% trans 'Delete item' %}"></a>
{% if not item.is_leaf_node %}
<a class="activate_link" href="{% url projector_activate_slide item.sid 'summary' %}"><img src="{% static 'images/icons/view-list-tree.png' %}" title="{% trans 'Activate summary for this item' %}"></a>
{% endif %}
{% endif %}
</span>
</td>

View File

@ -7,7 +7,7 @@
{% endblock %}
{% block content %}
<h1>{%trans "Agenda" %}</h1>
<h1>{% if title %}{{ title }}{% else %}{% trans "Agenda" %}{% endif %}</h1>
{% endblock %}
{% block scrollcontent %}

View File

@ -68,8 +68,9 @@ def get_active_slide(only_sid=False):
return get_slide_from_sid(sid)
def set_active_slide(sid):
def set_active_slide(sid, argument=None):
config["presentation"] = sid
config['presentation_argument'] = argument
def register_slidemodel(model, model_name=None, control_template=None, weight=0):
@ -115,7 +116,6 @@ def projector_message_set(message, sid=None):
overlay = ProjectorOverlay.objects.get(def_name='Message')
except ProjectorOverlay.DoesNotExist:
overlay = ProjectorOverlay(def_name='Message', active=True)
print "hier mal ein ", sid
overlay.sid=sid
overlay.save()

View File

@ -43,10 +43,9 @@ urlpatterns = patterns('projector.views',
name='projector_activate_slide',
),
url(r'^activate/(?P<sid>[^/]*)/summary/$',
url(r'^activate/(?P<sid>[^/]*)/(?P<argument>[^/]*)/$',
ActivateView.as_view(),
{'summary': True},
name='projector_activate_summary',
name='projector_activate_slide',
),
url(r'^new/$',

View File

@ -99,7 +99,10 @@ class ActivateView(RedirectView):
allow_ajax = True
def pre_redirect(self, request, *args, **kwargs):
set_active_slide(kwargs['sid'])
try:
set_active_slide(kwargs['sid'], kwargs['argument'])
except KeyError:
set_active_slide(kwargs['sid'])
config['up'] = 0
config['bigger'] = 100
@ -164,7 +167,6 @@ class Projector(TemplateView, AjaxMixin):
else:
data = get_slide_from_sid(sid)
ajax = 'off'
print data
if data is None:
data = {