Fixed #1197: Use big heading for custom slides without text.

Keep last projector scale/scroll values after activate new slide.
This commit is contained in:
Emanuel Schütze 2014-03-26 22:09:37 +01:00
parent f870a75119
commit d44f385ba8
8 changed files with 36 additions and 14 deletions

View File

@ -129,6 +129,12 @@
z-index: 1; z-index: 1;
} }
/* Projector control panel */
.notNull {
color: red;
font-weight: bold;
}
/*** misc ***/ /*** misc ***/
.custom-btn-mini { .custom-btn-mini {
width: 20px; width: 20px;

View File

@ -73,14 +73,23 @@ $(function() {
url: link.attr('href'), url: link.attr('href'),
dataType: 'json', dataType: 'json',
success: function(data) { success: function(data) {
// change scale level number
$('#scale_level').html(data['scale_level']); $('#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']); $('#scroll_level').html(data['scroll_level']);
if ( data['scroll_level'] === 0 ) if ( data['scroll_level'] != 0 ) {
$('#scroll_up_button').addClass('disabled'); $('#scroll_level').addClass('notNull');
else {
if ( $('#scroll_up_button').hasClass('disabled') ) if ( $('#scroll_up_button').hasClass('disabled') )
$('#scroll_up_button').removeClass('disabled'); $('#scroll_up_button').removeClass('disabled');
} }
else {
$('#scroll_level').removeClass('notNull');
$('#scroll_up_button').addClass('disabled');
}
} }
}); });
}); });

View File

@ -1,6 +1,6 @@
{% load i18n %} {% load i18n %}
<h1> <h1 {% if not slide.text %}class="title_only"{% endif %}>
{{ slide.title }} {{ slide.title }}
</h1> </h1>

View File

@ -67,10 +67,18 @@ body{
h1 { h1 {
font-size: 2.25em; font-size: 2.25em;
margin-bottom: 40px; margin-bottom: 40px;
line-height: 0.95em; line-height: 1.1em;
padding-bottom: 10px; padding-bottom: 10px;
border-bottom: 1px solid #e6e6e6; 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 { h1 small {
font-size: 0.55em; font-size: 0.55em;
margin-top: 15px; margin-top: 15px;

View File

@ -1,5 +1,5 @@
{% load tags %} {% load tags %}
<h1> <h1 class="title_only">
{{ 'welcome_title'|get_config }} {{ 'welcome_title'|get_config }}
</h1> </h1>

View File

@ -25,7 +25,8 @@
<a class="projector_edit btn" href="{% url 'projector_clean_scale' %}" title="{% trans 'Reset zoom level' %}"> <a class="projector_edit btn" href="{% url 'projector_clean_scale' %}" title="{% trans 'Reset zoom level' %}">
<i class="icon-resize-small"></i> <i class="icon-resize-small"></i>
</a> </a>
{% trans "Zoom level" %}: <span id="scale_level">{{ 'projector_scale'|get_config }}</span> {% trans "Zoom level" %}:
<span id="scale_level" {% if 'projector_scale'|get_config != 0 %}class="notNull"{% endif %}>{{ 'projector_scale'|get_config }}</span>
</p> </p>
<p> <p>
<a class="projector_edit btn {% if 'projector_scroll'|get_config == 0 %}disabled{% endif %}" id="scroll_up_button" <a class="projector_edit btn {% if 'projector_scroll'|get_config == 0 %}disabled{% endif %}" id="scroll_up_button"
@ -38,7 +39,8 @@
<a class="projector_edit btn" href="{% url 'projector_clean_scroll' %}" title="{% trans 'Reset scroll level' %}"> <a class="projector_edit btn" href="{% url 'projector_clean_scroll' %}" title="{% trans 'Reset scroll level' %}">
<i class="icon-resize-small"></i> <i class="icon-resize-small"></i>
</a> </a>
{% trans "Scroll level" %}: <span id="scroll_level">{{ 'projector_scroll'|get_config }}</span> {% trans "Scroll level" %}:
<span id="scroll_level" {% if 'projector_scroll'|get_config != 0 %}class="notNull"{% endif %}>{{ 'projector_scroll'|get_config }}</span>
</p> </p>
{% endif %} {% endif %}

View File

@ -60,8 +60,6 @@ class ActivateView(RedirectView):
{'calls': {'load_pdf': {'url': url, 'page_num': kwargs['page_num']}}}) {'calls': {'load_pdf': {'url': url, 'page_num': kwargs['page_num']}}})
else: else:
set_active_slide(kwargs['callback'], **dict(request.GET.items())) 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'], call_on_projector({'scroll': config['projector_scroll'],
'scale': config['projector_scale']}) 'scale': config['projector_scale']})

View File

@ -2,7 +2,7 @@
from django.contrib.auth.models import AnonymousUser from django.contrib.auth.models import AnonymousUser
from django.test.client import Client, RequestFactory 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.config.api import config
from openslides.projector import views from openslides.projector import views
@ -54,9 +54,8 @@ class ActivateViewTest(TestCase):
mock_set_active_slide.assert_called_with('some_callback', mock_set_active_slide.assert_called_with('some_callback',
**{'some_key': 'some_value'}) **{'some_key': 'some_value'})
mock_config.get_default.assert_has_calls([call('projector_scroll'), mock_config.get_default.assert_has_calls([])
call('projector_scale')]) self.assertEqual(mock_config.__setitem__.call_count, 0)
self.assertEqual(mock_config.__setitem__.call_count, 2)
self.assertTrue(mock_call_on_projector.called) self.assertTrue(mock_call_on_projector.called)