From c22d35cd43924c343483c4d671827414d44d1fac Mon Sep 17 00:00:00 2001 From: Oskar Hahn Date: Sun, 4 Sep 2011 00:18:11 +0200 Subject: [PATCH] scroll and scall the beamer --- .../agenda/templates/agenda/overview.html | 2 ++ openslides/agenda/urls.py | 8 +++++++ openslides/agenda/views.py | 21 ++++++++++++++++++- openslides/static/javascript/agenda.js | 13 ++++++++++++ openslides/static/javascript/beamer.js | 3 +++ openslides/static/styles/beamer.css | 1 + 6 files changed, 47 insertions(+), 1 deletion(-) diff --git a/openslides/agenda/templates/agenda/overview.html b/openslides/agenda/templates/agenda/overview.html index b813b3305..267577e4b 100644 --- a/openslides/agenda/templates/agenda/overview.html +++ b/openslides/agenda/templates/agenda/overview.html @@ -46,6 +46,8 @@ {% endif %} + + -
+ + -
diff --git a/openslides/agenda/urls.py b/openslides/agenda/urls.py index 273847250..6ccafe0b8 100644 --- a/openslides/agenda/urls.py +++ b/openslides/agenda/urls.py @@ -56,4 +56,12 @@ urlpatterns = patterns('agenda.views', url(r'^item/print/$', 'print_agenda', name='print_agenda'), + + url(r'^beamer/bigger$', 'beamer_edit', {'direction': 'bigger'}, name='beamer_bigger'), + + url(r'^beamer/smaller$', 'beamer_edit', {'direction': 'smaller'}, name='beamer_smaller'), + + url(r'^beamer/up$', 'beamer_edit', {'direction': 'up'}, name='beamer_up'), + + url(r'^beamer/down$', 'beamer_edit', {'direction': 'down'}, name='beamer_down'), ) diff --git a/openslides/agenda/views.py b/openslides/agenda/views.py index 1254776b6..e72de845f 100644 --- a/openslides/agenda/views.py +++ b/openslides/agenda/views.py @@ -78,13 +78,30 @@ def beamer(request): content = render_block_to_string(template, 'content', data) jsondata = {'content': content, 'title': data['title'], - 'time': datetime.now().strftime('%H:%M')} + 'time': datetime.now().strftime('%H:%M'), + 'bigger': config_get('bigger'), + 'up': config_get('up')} return ajax_request(jsondata) else: return render_to_response(template, data, context_instance=RequestContext(request)) +@permission_required('agenda.can_manage_agenda') +def beamer_edit(request, direction): + if direction == 'bigger': + config_set('bigger', int(config_get('bigger', 100)) + 10) + elif direction == 'smaller': + config_set('bigger', int(config_get('bigger', 100)) - 10) + elif direction == 'up': + config_set('up', int(config_get('up', 0)) - 10) + elif direction == 'down': + config_set('up', int(config_get('up', 0)) + 10) + + if request.is_ajax(): + return ajax_request({}) + return redirect(reverse('item_overview')) + def assignment_votes(item): votes = [] @@ -156,6 +173,8 @@ def set_active(request, item_id, summary=False): item.set_active(summary) except Item.DoesNotExist: messages.error(request, _('Item ID %d does not exist.') % int(item_id)) + config_set("bigger", 100) + config_set("up", 0) if request.is_ajax(): return ajax_request({'active': item_id}) diff --git a/openslides/static/javascript/agenda.js b/openslides/static/javascript/agenda.js index 2c7036298..386a5e27c 100644 --- a/openslides/static/javascript/agenda.js +++ b/openslides/static/javascript/agenda.js @@ -104,5 +104,18 @@ $(function() { hideClosedSlides(true); } + // controll beamer + $('.beamer_edit').click(function(event) { + event.preventDefault(); + link = $(this); + $.ajax({ + type: 'GET', + url: link.attr('href'), + dataType: 'json', + success: function(data) { + } + }); + }); + ko.applyBindings(ViewModel); }); diff --git a/openslides/static/javascript/beamer.js b/openslides/static/javascript/beamer.js index ea84d3d3b..568011e86 100644 --- a/openslides/static/javascript/beamer.js +++ b/openslides/static/javascript/beamer.js @@ -9,6 +9,9 @@ function presentation_reload() { $('#content').html(data.content); document.title = data.title; $('#currentTime').html(data.time); + $('#content').clearQueue(); + $('#content').animate({'font-size': data.bigger + '%'}, 200); + $('#content').animate({'margin-top': data.up + 'em'}, 200); setTimeout("presentation_reload()", 500); }, error: function () { diff --git a/openslides/static/styles/beamer.css b/openslides/static/styles/beamer.css index 8f4c0018b..b9e585d7e 100644 --- a/openslides/static/styles/beamer.css +++ b/openslides/static/styles/beamer.css @@ -67,6 +67,7 @@ body{ left:100px; top:150px; right:40px; + z-index: -1; } .title {