TT#49688 Implement human readable rrule in ical events list

Change-Id: I4d69be6423d5f4b4fefb645eac59a5d38cf2ca00
changes/18/26518/35
Irina Peshinskaya 7 years ago
parent 92ac694c6c
commit 0162f70fae

@ -234,6 +234,7 @@ sub event_list :Chained('base') :PathPart('event') :CaptureArgs(0) {
{ name => 'id', search => 1, title => $c->loc('#') },
{ name => 'time_set_id', search => 1, title => $c->loc('Time Set #') },
{ name => 'comment', search => 1, title => $c->loc('Comment') },
{ name => 'periods_ical.rrule_ical', search => 0, accessor => "ical", title => $c->loc('iCal')},#, literal_sql => '""'
]);
$c->stash(template => 'timeset/event_list.tt');

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

@ -3,7 +3,7 @@
helper.column_titles = [];
helper.column_fields = [];
helper.column_sortable_map = {};
helper.custom_renderers = {};
helper.custom_renderers = helper.custom_renderers ? helper.custom_renderers : {};
helper.strict_search = 0;
FOR col IN helper.dt_columns;
IF !col.accessor;
@ -20,6 +20,9 @@
IF col.custom_renderer.defined;
helper.custom_renderers.${col.accessor} = col.custom_renderer;
END;
IF col.visible.defined && !col.visible;
helper.columns_hidden.${col.accessor} = 1;
END;
END;
END;
backuri = c.req.uri;
@ -93,6 +96,9 @@ $(document).ready(function() {
[% FOREACH f IN helper.column_fields -%]
{
"mData": "[% f %]",
[%IF helper.columns_hidden.${f} %]
"visible": false,
[%END%]
"mRender": function ( data, type, full ) {
if(data == null)
return '';

@ -1,3 +1,23 @@
<script src="/js/require.js"></script>
<script>
require.config({
paths: {
"luxon": "/js/libs/rrule/luxon",
"rrule": "/js/libs/rrule/rrule",
},
});
var RRule;
require(['rrule'], function (rrule) {
RRule = rrule;
});
function toText(data, type, full) {
if (!data) {
return '';
}
var r = RRule.rrulestr(data);
return r.toText();
}
</script>
<script>
function dynamicFields(){
//remember about after error and edit form cases
@ -182,6 +202,9 @@ $( document ).ready(function() {
helper.edit_flag = edit_flag;
helper.form_object = form;
helper.ajax_uri = c.uri_for_action( "/timeset/event_ajax", [c.req.captures.0] );
helper.custom_renderers => {
ical => 'function ( data, type, full ) { return toText(data, type, full); }'
};
UNLESS c.user.read_only;
helper.dt_buttons = [

Loading…
Cancel
Save