]> git.proxmox.com Git - pve-manager.git/blob - www/manager6/form/CalendarEvent.js
ui: form/calendar event: add some more complex examples
[pve-manager.git] / www / manager6 / form / CalendarEvent.js
1 Ext.define('PVE.form.CalendarEvent', {
2 extend: 'Ext.form.field.ComboBox',
3 xtype: 'pveCalendarEvent',
4
5 editable: true,
6 emptyText: gettext('Editable'), // FIXME: better way to convey that to confused users?
7
8 valueField: 'value',
9 queryMode: 'local',
10
11 matchFieldWidth: false,
12 listConfig: {
13 maxWidth: 450,
14 },
15
16 store: {
17 field: ['value', 'text'],
18 data: [
19 { value: '*/30', text: Ext.String.format(gettext("Every {0} minutes"), 30) },
20 { value: '*/2:00', text: gettext("Every two hours") },
21 { value: '2,22:30', text: gettext("Every day") + " 02:30, 22:30" },
22 { value: 'mon..fri', text: gettext("Monday to Friday") + " 00:00" },
23 { value: 'mon..fri */1:00', text: gettext("Monday to Friday") + ': ' + gettext("hourly") },
24 {
25 value: 'mon..fri 7..18:00/15',
26 text: gettext("Monday to Friday") + ', '
27 + Ext.String.format(gettext('{0} to {1}'), '08:00', '18:45') + ': '
28 + Ext.String.format(gettext("Every {0} minutes"), 15),
29 },
30 { value: 'sun 01:00', text: gettext("Sunday") + " 01:00" },
31 { value: 'sat *-1..7 15:00', text: gettext("First Saturday each Month") + " 15:00" },
32 ],
33 },
34
35 tpl: [
36 '<ul class="x-list-plain"><tpl for=".">',
37 '<li role="option" class="x-boundlist-item">{text}</li>',
38 '</tpl></ul>',
39 ],
40
41 displayTpl: [
42 '<tpl for=".">',
43 '{value}',
44 '</tpl>',
45 ],
46
47 });