Merge pull request #582 from normanjaeckel/AgendaConfigJSFix
Moved javascript code for agenda config into extra file.
This commit is contained in:
commit
e7def39323
@ -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_stylefiles = ['styles/timepicker.css', 'styles/jquery-ui/jquery-ui.custom.min.css']
|
||||||
extra_javascript = ['javascript/jquery-ui.custom.min.js',
|
extra_javascript = ['javascript/jquery-ui.custom.min.js',
|
||||||
'javascript/jquery-ui-timepicker-addon.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'),
|
return ConfigPage(title=ugettext_noop('Agenda'),
|
||||||
url='agenda',
|
url='agenda',
|
||||||
|
@ -0,0 +1,52 @@
|
|||||||
|
/**
|
||||||
|
* OpenSlides agenda config functions for the datepicker
|
||||||
|
*
|
||||||
|
* :copyright: 2011–2013 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')
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
@ -2,60 +2,8 @@
|
|||||||
|
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
|
||||||
{% get_current_language as LANGUAGE_CODE %}
|
|
||||||
{% load staticfiles %}
|
{% 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 %}
|
{% block content %}
|
||||||
<h1>
|
<h1>
|
||||||
{% trans 'Configuration' %}
|
{% trans 'Configuration' %}
|
||||||
|
Loading…
Reference in New Issue
Block a user