diff --git a/openslides/agenda/forms.py b/openslides/agenda/forms.py index b147ce2a2..e67f44f29 100644 --- a/openslides/agenda/forms.py +++ b/openslides/agenda/forms.py @@ -44,4 +44,5 @@ class ItemOrderForm(Form, CssClassMixin): class ConfigForm(Form, CssClassMixin): - agenda_countdown_time = IntegerField(widget=TextInput(attrs={'class':'small-input'}),label=_("Countdown (in seconds)"),initial=60, min_value=0) + pass + diff --git a/openslides/agenda/views.py b/openslides/agenda/views.py index 133065fb2..64e63afcf 100644 --- a/openslides/agenda/views.py +++ b/openslides/agenda/views.py @@ -167,18 +167,20 @@ class AgendaPDF(PDFView): story.append(Paragraph(item.get_title(), stylesheet['Item'])) -class Config(FormView): - permission_required = 'config.can_manage_config' - form_class = ConfigForm - template_name = 'agenda/config.html' - - def get_initial(self): - return {'agenda_countdown_time': config['agenda_countdown_time']} - - def form_valid(self, form): - config['agenda_countdown_time'] = form.cleaned_data['agenda_countdown_time'] - messages.success(self.request, _('Agenda settings successfully saved.')) - return super(Config, self).form_valid(form) +# +# rene: empty for now so comment it out to keep it from appearing in the settings +# +#class Config(FormView): +# permission_required = 'config.can_manage_config' +# form_class = ConfigForm +# template_name = 'agenda/config.html' +# +# def get_initial(self): +# return {} +# +# def form_valid(self, form): +# messages.success(self.request, _('Agenda settings successfully saved.')) +# return super(Config, self).form_valid(form) def register_tab(request): diff --git a/openslides/projector/static/images/icons/document-save.png b/openslides/projector/static/images/icons/document-save.png new file mode 100644 index 000000000..8072aea32 Binary files /dev/null and b/openslides/projector/static/images/icons/document-save.png differ diff --git a/openslides/projector/static/images/icons/spin-down.png b/openslides/projector/static/images/icons/spin-down.png new file mode 100644 index 000000000..e54993882 Binary files /dev/null and b/openslides/projector/static/images/icons/spin-down.png differ diff --git a/openslides/projector/static/images/icons/spin-up.png b/openslides/projector/static/images/icons/spin-up.png new file mode 100644 index 000000000..7830c52a7 Binary files /dev/null and b/openslides/projector/static/images/icons/spin-up.png differ diff --git a/openslides/projector/static/javascript/projector-control.js b/openslides/projector/static/javascript/projector-control.js index ffe16a17d..36a6eb255 100644 --- a/openslides/projector/static/javascript/projector-control.js +++ b/openslides/projector/static/javascript/projector-control.js @@ -42,17 +42,38 @@ $(function() { }); // control countdown - $('.projector_countdown').click(function(event) { + $('.projector_countdown_btn').click(function(event) { event.preventDefault(); var link = $(this); + var requestData = {}; + + if (link.attr('id') == "countdown_set") { + requestData = { "countdown_time" : $( "#countdown_time" ).val() }; + } $.ajax({ type: 'GET', url: link.attr('href'), + data: requestData, dataType: 'json', success: function(data) { } }); }); + + $('.projector_countdown_spindown').click(function(event) { + event.preventDefault(); + var count = parseInt($( "#countdown_time" ).val()); + + $( "#countdown_time" ).val( ((count - 1 >= 0) ? count - 1 : count)); + }); + + $('.projector_countdown_spinup').click(function(event) { + event.preventDefault(); + var count = parseInt($( "#countdown_time" ).val()); + + $( "#countdown_time" ).val(count + 1); + }); + $('.countdown_visible_link').click(function(event) { event.preventDefault(); var link = $(this); diff --git a/openslides/projector/static/styles/projector-control.css b/openslides/projector/static/styles/projector-control.css index 114655465..05320ad2a 100644 --- a/openslides/projector/static/styles/projector-control.css +++ b/openslides/projector/static/styles/projector-control.css @@ -38,6 +38,35 @@ visibility: hidden; } +/*.projector_countdown_spinval {*/ +#countdown_time { + width: 40px; + height: 16px; +} + +.projector_countdown_spinbox { + height: 16px; + width: auto; + position: relative; + display: inline-block; +} + +.projector_countdown_spinup { + position: absolute; + top: 0px; + left: 35px; +} + +.projector_countdown_spindown { + position: absolute; + top: 8px; + left: 35px; +} + +.projector_countdown_btn { + margin-top: auto; +} + /* iframe */ #iframe { -ms-zoom: 0.25; diff --git a/openslides/projector/templates/projector/control.html b/openslides/projector/templates/projector/control.html index 428d74a58..ae7823322 100644 --- a/openslides/projector/templates/projector/control.html +++ b/openslides/projector/templates/projector/control.html @@ -25,6 +25,17 @@ return true; }; + function spinCount(delta) { + var count = parseInt($( "#countdown_time" ).val()); + + if (count + delta < 0) { + delta = 0; + } + + $( "#countdown_time" ).val(count + delta); + return false; + }; + $(function() { $( ".column" ).sortable({ connectWith: ".column" @@ -132,16 +143,30 @@ {# Countdown #} {% if overlay.def_name == "Countdown" %} | - {{countdown_time}}{% trans "sec" %} - - - - - - - - - + + + + + + + + + {% trans "sec" %} + + + + + + + + + + + + + + + {% endif %} {% if overlay.def_name == "Message" %}