You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ngcp-panel/share/templates/helpers/datatables_vars.tt

27 lines
1.0 KiB

[%-
#USE Dumper;
#we can't use DEFAULT directive - it treats false the same as undefined, which doesn't allow to keep default filled values and switch them off by customization
MACRO initHelper(var,value) BLOCK;
# Dumper.dump(helper);
UNLESS helper.${var}.defined; helper.${var} = value || ${var}; END;
END;
initHelper('messages');
initHelper('length_change');
initHelper('dt_columns', ${"${helper.identifier}_dt_columns"} );
initHelper('close_target');
initHelper('create_flag');
initHelper('form_object',form);
initHelper('ajax_uri', c.uri_for( c.controller.action_for('ajax') ));
#here we can generate couple of variants, selection of proper variant will be exact view responsibility
UNLESS c.user.read_only;
initHelper('dt_buttons',[
{ name = c.loc('Edit'), uri = "/${helper.identifier}'+full[\"id\"]+'/edit", class = 'btn-small btn-primary', icon = 'icon-edit' },
] );
initHelper('top_buttons',[
{ name = c.loc("Create ${helper.name_single}"), uri = c.uri_for("/${helper.identifier}/create"), icon = 'icon-star' },
] );
END;
-%]