From d44f385ba866f5570f287f6b103f218991e967aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emanuel=20Sch=C3=BCtze?= Date: Wed, 26 Mar 2014 22:09:37 +0100 Subject: [PATCH] Fixed #1197: Use big heading for custom slides without text. Keep last projector scale/scroll values after activate new slide. --- openslides/core/static/css/dashboard.css | 6 ++++++ openslides/core/static/js/dashboard.js | 15 ++++++++++++--- .../core/templates/core/customslide_slide.html | 2 +- openslides/projector/static/css/projector.css | 10 +++++++++- .../templates/projector/default_slide.html | 2 +- .../templates/projector/widget_live_view.html | 6 ++++-- openslides/projector/views.py | 2 -- tests/projector/test_views.py | 7 +++---- 8 files changed, 36 insertions(+), 14 deletions(-) diff --git a/openslides/core/static/css/dashboard.css b/openslides/core/static/css/dashboard.css index a13eb8d8a..af4f55117 100644 --- a/openslides/core/static/css/dashboard.css +++ b/openslides/core/static/css/dashboard.css @@ -129,6 +129,12 @@ z-index: 1; } +/* Projector control panel */ +.notNull { + color: red; + font-weight: bold; +} + /*** misc ***/ .custom-btn-mini { width: 20px; diff --git a/openslides/core/static/js/dashboard.js b/openslides/core/static/js/dashboard.js index 239c27cb5..147af9c56 100644 --- a/openslides/core/static/js/dashboard.js +++ b/openslides/core/static/js/dashboard.js @@ -73,14 +73,23 @@ $(function() { url: link.attr('href'), dataType: 'json', success: function(data) { + // change scale level number $('#scale_level').html(data['scale_level']); + if ( data['scale_level'] != 0 ) + $('#scale_level').addClass('notNull'); + else + $('#scale_level').removeClass('notNull'); + // change scroll level number $('#scroll_level').html(data['scroll_level']); - if ( data['scroll_level'] === 0 ) - $('#scroll_up_button').addClass('disabled'); - else { + if ( data['scroll_level'] != 0 ) { + $('#scroll_level').addClass('notNull'); if ( $('#scroll_up_button').hasClass('disabled') ) $('#scroll_up_button').removeClass('disabled'); } + else { + $('#scroll_level').removeClass('notNull'); + $('#scroll_up_button').addClass('disabled'); + } } }); }); diff --git a/openslides/core/templates/core/customslide_slide.html b/openslides/core/templates/core/customslide_slide.html index 3eb47df89..a14e39914 100644 --- a/openslides/core/templates/core/customslide_slide.html +++ b/openslides/core/templates/core/customslide_slide.html @@ -1,6 +1,6 @@ {% load i18n %} -

+

{{ slide.title }}

diff --git a/openslides/projector/static/css/projector.css b/openslides/projector/static/css/projector.css index bb9442f9e..f6b52833a 100644 --- a/openslides/projector/static/css/projector.css +++ b/openslides/projector/static/css/projector.css @@ -67,10 +67,18 @@ body{ h1 { font-size: 2.25em; margin-bottom: 40px; - line-height: 0.95em; + line-height: 1.1em; padding-bottom: 10px; border-bottom: 1px solid #e6e6e6; } +h1.title_only { + text-align: center; + font-size: 2.75em; + line-height: 1.3em; + border: 0px; + padding: 40px; + margin-left: -35px; /* see #content position 'left' - 'right' for real centering */ +} h1 small { font-size: 0.55em; margin-top: 15px; diff --git a/openslides/projector/templates/projector/default_slide.html b/openslides/projector/templates/projector/default_slide.html index a44f04e56..1c15da27d 100644 --- a/openslides/projector/templates/projector/default_slide.html +++ b/openslides/projector/templates/projector/default_slide.html @@ -1,5 +1,5 @@ {% load tags %} -

+

{{ 'welcome_title'|get_config }}

diff --git a/openslides/projector/templates/projector/widget_live_view.html b/openslides/projector/templates/projector/widget_live_view.html index 85af3a983..6692f5dc1 100644 --- a/openslides/projector/templates/projector/widget_live_view.html +++ b/openslides/projector/templates/projector/widget_live_view.html @@ -25,7 +25,8 @@ - {% trans "Zoom level" %}: {{ 'projector_scale'|get_config }} + {% trans "Zoom level" %}: + {{ 'projector_scale'|get_config }}

- {% trans "Scroll level" %}: {{ 'projector_scroll'|get_config }} + {% trans "Scroll level" %}: + {{ 'projector_scroll'|get_config }}

{% endif %} diff --git a/openslides/projector/views.py b/openslides/projector/views.py index 2bb6b9e4d..945004223 100644 --- a/openslides/projector/views.py +++ b/openslides/projector/views.py @@ -60,8 +60,6 @@ class ActivateView(RedirectView): {'calls': {'load_pdf': {'url': url, 'page_num': kwargs['page_num']}}}) else: set_active_slide(kwargs['callback'], **dict(request.GET.items())) - config['projector_scroll'] = config.get_default('projector_scroll') - config['projector_scale'] = config.get_default('projector_scale') call_on_projector({'scroll': config['projector_scroll'], 'scale': config['projector_scale']}) diff --git a/tests/projector/test_views.py b/tests/projector/test_views.py index 6b24a961d..250a59c9e 100644 --- a/tests/projector/test_views.py +++ b/tests/projector/test_views.py @@ -2,7 +2,7 @@ from django.contrib.auth.models import AnonymousUser from django.test.client import Client, RequestFactory -from mock import call, MagicMock, patch +from mock import MagicMock, patch from openslides.config.api import config from openslides.projector import views @@ -54,9 +54,8 @@ class ActivateViewTest(TestCase): mock_set_active_slide.assert_called_with('some_callback', **{'some_key': 'some_value'}) - mock_config.get_default.assert_has_calls([call('projector_scroll'), - call('projector_scale')]) - self.assertEqual(mock_config.__setitem__.call_count, 2) + mock_config.get_default.assert_has_calls([]) + self.assertEqual(mock_config.__setitem__.call_count, 0) self.assertTrue(mock_call_on_projector.called)