Merge pull request #582 from normanjaeckel/AgendaConfigJSFix

Moved javascript code for agenda config into extra file.
This commit is contained in:
Oskar Hahn 2013-04-03 10:21:08 -07:00
commit e7def39323
3 changed files with 54 additions and 53 deletions

View File

@ -38,7 +38,8 @@ def setup_agenda_config_page(sender, **kwargs):
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']
'javascript/jquery-ui-sliderAccess.min.js',
'javascript/agenda-config-datepicker.js']
return ConfigPage(title=ugettext_noop('Agenda'),
url='agenda',

View File

@ -0,0 +1,52 @@
/**
* OpenSlides agenda config functions for the datepicker
*
* :copyright: 20112013 by OpenSlides team, see AUTHORS.
* :license: GNU GPL, see LICENSE for more details.
*/
$(function() {
$.datepicker.regional[gettext('en')] = {
prevText: gettext('previous month'),
nextText: gettext('next month'),
monthNames: [
gettext('January'), gettext('February'), gettext('March'),
gettext('April'), gettext('May'), gettext('June'),
gettext('July'), gettext('August'), gettext('September'),
gettext('October'), gettext('November'), gettext('December')
],
monthNamesShort: [
gettext('Jan'), gettext('Feb'), gettext('Mar'),
gettext('Apr'), gettext('May'), gettext('Jun'),
gettext('Jul'), gettext('Aug'), gettext('Sep'),
gettext('Oct'), gettext('Nov'), gettext('Dec')
],
dayNames: [
gettext('Sunday'), gettext('Monday'), gettext('Tuesdey'), gettext('Wednesday'),
gettext('Thursday'), gettext('Friday'), gettext('Saturday')
],
dayNamesMin: [
gettext('Su'), gettext('Mo'), gettext('Tu'), gettext('We'),
gettext('Th'), gettext('Fr'), gettext('Sa')
],
dayNamesShort: [
gettext('Su'), gettext('Mo'), gettext('Tu'), gettext('We'),
gettext('Th'), gettext('Fr'), gettext('Sa')
],
dateFormat: 'dd.mm.yy', firstDay: 1, isRTL: false
};
$.datepicker.setDefaults($.datepicker.regional[gettext('en')]);
$("#id_agenda_start_event_date_time").datetimepicker (
{
hour: 12,
timeFormat: 'HH:mm',
timeText: gettext('Time'),
hourText: gettext('Hour'),
minuteText: gettext('Minute'),
currentText: gettext('Current time'),
closeText: gettext('Close')
}
);
});

View File

@ -2,60 +2,8 @@
{% load i18n %}
{% get_current_language as LANGUAGE_CODE %}
{% load staticfiles %}
{% block javascript %}
{{ block.super }}
<script type="text/javascript">
$(function() {
$.datepicker.regional['{{ LANGUAGE_CODE }}'] = {
prevText: 'previous month',
nextText: 'next month',
monthNames: [
'{% trans 'January' %}', '{% trans 'February' %}', '{% trans 'March' %}',
'{% trans 'April' %}', '{% trans 'May' %}', '{% trans 'June' %}',
'{% trans 'July' %}', '{% trans 'August' %}', '{% trans 'September' %}',
'{% trans 'October' %}', '{% trans 'November' %}', '{% trans 'December' %}'
],
monthNamesShort: [
'{% trans 'Jan' %}', '{% trans 'Feb' %}', '{% trans 'Mar' %}',
'{% trans 'Apr' %}', '{% trans 'May' %}', '{% trans 'Jun' %}',
'{% trans 'Jul' %}', '{% trans 'Aug' %}', '{% trans 'Sep' %}',
'{% trans 'Oct' %}', '{% trans 'Nov' %}', '{% trans 'Dec' %}'
],
dayNames: [
'{% trans 'Sunday' %}', '{% trans 'Monday' %}', '{% trans 'Tuesdey' %}', '{% trans 'Wednesday' %}',
'{% trans 'Thursday' %}', '{% trans 'Friday' %}', '{% trans 'Saturday' %}'
],
dayNamesMin: [
'{% trans 'Su' %}', '{% trans 'Mo' %}', '{% trans 'Tu' %}', '{% trans 'We' %}',
'{% trans 'Th' %}', '{% trans 'Fr' %}', '{% trans 'Sa' %}'
],
dayNamesShort: [
'{% trans 'Su' %}', '{% trans 'Mo' %}', '{% trans 'Tu' %}', '{% trans 'We' %}',
'{% trans 'Th' %}', '{% trans 'Fr' %}', '{% trans 'Sa' %}'
],
dateFormat: 'dd.mm.yy', firstDay: 1, isRTL: false
};
$.datepicker.setDefaults($.datepicker.regional['{{ LANGUAGE_CODE }}']);
$("#id_agenda_start_event_date_time").datetimepicker (
{
hour: 12,
timeFormat: "HH:mm",
timeText: '{% trans 'Time' %}',
hourText: '{% trans 'Hour' %}',
minuteText: '{% trans 'Minute' %}',
currentText: '{% trans 'current time' %}',
closeText: '{% trans 'close' %}'
}
);
});
</script>
{% endblock %}
{% block content %}
<h1>
{% trans 'Configuration' %}