2013-02-20 23:50:34 +01:00
|
|
|
|
#!/usr/bin/env python
|
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
"""
|
|
|
|
|
openslides.agenda.signals
|
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
|
|
Signals for the agenda app.
|
|
|
|
|
|
2013-03-01 17:13:12 +01:00
|
|
|
|
:copyright: (c) 2011–2013 by the OpenSlides team, see AUTHORS.
|
2013-02-20 23:50:34 +01:00
|
|
|
|
:license: GNU GPL, see LICENSE for more details.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
from django.dispatch import receiver
|
2013-03-01 17:13:12 +01:00
|
|
|
|
from django import forms
|
|
|
|
|
from django.utils.translation import ugettext_lazy, ugettext_noop, ugettext as _
|
2013-02-20 23:50:34 +01:00
|
|
|
|
|
2013-03-01 17:13:12 +01:00
|
|
|
|
from openslides.config.signals import config_signal
|
|
|
|
|
from openslides.config.api import ConfigVariable, ConfigPage
|
2013-02-20 23:50:34 +01:00
|
|
|
|
|
|
|
|
|
|
2013-03-01 17:13:12 +01:00
|
|
|
|
# TODO: Reinsert the datepicker scripts in the template
|
|
|
|
|
|
|
|
|
|
@receiver(config_signal, dispatch_uid='setup_agenda_config_page')
|
|
|
|
|
def setup_agenda_config_page(sender, **kwargs):
|
|
|
|
|
"""
|
|
|
|
|
Agenda config variables.
|
|
|
|
|
"""
|
|
|
|
|
# TODO: Insert validator for the format or use other field carefully.
|
|
|
|
|
agenda_start_event_date_time = ConfigVariable(
|
|
|
|
|
name='agenda_start_event_date_time',
|
|
|
|
|
default_value='',
|
|
|
|
|
form_field=forms.CharField(
|
|
|
|
|
widget=forms.DateTimeInput(format='%d.%m.%Y %H:%M'),
|
|
|
|
|
required=False,
|
|
|
|
|
label=ugettext_lazy('Begin of event'),
|
|
|
|
|
help_text=_('Input format: DD.MM.YYYY HH:MM')))
|
|
|
|
|
|
|
|
|
|
extra_stylefiles = ['styles/timepicker.css', 'styles/jquery-ui/jquery-ui.custom.min.css']
|
|
|
|
|
extra_javascript = ['javascript/jquery-ui.custom.min.js',
|
|
|
|
|
'javascript/jquery-ui-timepicker-addon.min.js',
|
|
|
|
|
'javascript/jquery-ui-sliderAccess.min.js']
|
|
|
|
|
|
|
|
|
|
return ConfigPage(title=ugettext_noop('Agenda'),
|
|
|
|
|
url='agenda',
|
|
|
|
|
required_permission='config.can_manage',
|
|
|
|
|
weight=20,
|
|
|
|
|
variables=(agenda_start_event_date_time,),
|
|
|
|
|
extra_context={'extra_stylefiles': extra_stylefiles,
|
|
|
|
|
'extra_javascript': extra_javascript})
|