From 03fe1f84dd3cf94bce893772adbf2924d4e00114 Mon Sep 17 00:00:00 2001 From: Oskar Hahn Date: Wed, 4 Jul 2012 03:21:03 +0200 Subject: [PATCH] clear overlay-message via ajax --- .../projector/static/javascript/projector-control.js | 8 ++++++-- .../templates/projector/control_overlay_message.html | 4 ++-- openslides/projector/views.py | 7 ++++++- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/openslides/projector/static/javascript/projector-control.js b/openslides/projector/static/javascript/projector-control.js index 0cb33975e..95b758c0a 100644 --- a/openslides/projector/static/javascript/projector-control.js +++ b/openslides/projector/static/javascript/projector-control.js @@ -84,6 +84,7 @@ $(function() { } $( "#iframe" ).css('zoom', '0.25'); } + // activate an element to show it on projector $('.activate_link').click(function(event) { event.preventDefault(); @@ -183,7 +184,10 @@ $(function() { }); }); - $('#overlay-form').ajaxForm(function() { - alert("Thank you for your comment!"); + $('#overlay_message').ajaxForm({ + dataType: 'json', + success: function(data) { + $('#overlay_message_text').val(data['overlay_message']); + } }); }); diff --git a/openslides/projector/templates/projector/control_overlay_message.html b/openslides/projector/templates/projector/control_overlay_message.html index e2082d8c1..7eac70430 100644 --- a/openslides/projector/templates/projector/control_overlay_message.html +++ b/openslides/projector/templates/projector/control_overlay_message.html @@ -1,8 +1,8 @@ {% load staticfiles %} {% load i18n %} {% load tags %} -
{% csrf_token %} - +{% csrf_token %} + diff --git a/openslides/projector/views.py b/openslides/projector/views.py index 1d7b8b357..09d41fd05 100644 --- a/openslides/projector/views.py +++ b/openslides/projector/views.py @@ -65,9 +65,14 @@ class ControlView(TemplateView, AjaxMixin): overlay.active = False overlay.save() if request.is_ajax(): - return ajax_get(request, *args, **kwargs) + return self.ajax_get(request, *args, **kwargs) return self.get(request, *args, **kwargs) + def get_ajax_context(self, **kwargs): + return { + 'overlay_message': config['projector_message'], + } + def get_context_data(self, **kwargs): context = super(ControlView, self).get_context_data(**kwargs)