#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 Return a map with all Data for the Slide
""" """
if self.releated_sid: if config['presentation_argument'] == 'summary':
return self.get_releated_slide().slide() print 'soweit schonmal'
data = { data = {
'item': self, 'title': self.get_title(),
'title': self.get_title(), 'items': self.get_children(),
'template': 'projector/AgendaText.html', '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 return data
def set_closed(self, closed=True): def set_closed(self, closed=True):

View File

@ -39,6 +39,9 @@
{% if perms.agenda.can_manage_agenda %} {% 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 '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> <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 %} {% endif %}
</span> </span>
</td> </td>

View File

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

View File

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

View File

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

View File

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