[% PROCESS 'elements.html' %]
[% text('Reporting Units') %]
[% text('ID') %]
[% text('Label') %]
[% text('Active') %]
[% text('Ordering') %]
[% FOREACH m IN request.modules %]
[% text(m.label) %]
[% END %]
[% request.classes.push({}); FOR c IN request.classes; id = c.id; %]
[% PROCESS input element_data = { type = "hidden" value = id name = "id" } %][% id %]
[% PROCESS input element_data = { type = "text" class = "control_code" name = "label" value = c.label id = "label_$id" size = 12 } %]
[% PROCESS input element_data = { type = "checkbox" value = "1" class = "is-active" name = "active" id = "active_$id" checked = (c.active)? 'CHECKED' : '' } %]
[% PROCESS input element_data = { type = "text" class = "ordering" name = "ordering" value = c.ordering id = "ordering_$id" size = 4 } %]
[% FOREACH m IN request.modules %]
[% checked = ''; FOREACH mm IN c.modules; IF mm.id == m.id; checked = 'checked'; END; END; PROCESS input element_data = { type = 'checkbox' checked = checked name = "module_" _ m.id id = "module_$id" _ "_" _ m.id value = 1 } %]
[% END %]
[% PROCESS button element_data = { type = "submit" class = "submit" name = "__action" value = "save_class" id = "save_class_$id" text = (c.id) ? text('Save') : text('Add Class') 'data-lsmb-doing' = text('Saving...') 'data-lsmb-done' = text('Saved') }; PROCESS button element_data = { type = "submit" class = "submit" name = "__action" value = "delete_class" id = "delete_class_$id" text = text('Delete') } %]
[% IF c.id; PROCESS button element_data = { type = "submit" class = "submit" name = "__action" id = "action_$id" value = "add" text = text('Add Unit') #' }; PROCESS button element_data = { type = "submit" class = "submit" name = "__action" value = "list" id = "list_$id" text = text('List Units')#' }; END; %]
[% END %]