[% USE JSON; WRAPPER 'master_templates/master.tmpl' theme="yui"; app_key = 'manage_hooks' -%] [% PROCESS '_ajaxapp_styles.tmpl' -%] [% PROCESS '_ajaxapp_header.tmpl' -%] [% null = locale.set_context_html %] [% IF data.structured_hooks.size -%]
[%# onclick because WebKit has a control for clearing the search box %]
[% SET hooks_by_key = {} -%] [% SET stage_descriptions = {} -%] [% SET stage_orders = {} -%] [% FOR cat_evts = data.structured_hooks -%]
[% cat_evts.category FILTER html -%]
[% FOR evt_stgs = cat_evts.events -%] [% SET stage_key = cat_evts.category _ '-' _ evt_stgs.event -%] [% stage_key = stage_key.replace(':','-'); -%] [% stage_orders.$stage_key = evt_stgs.stage_order -%] [% SET even = 1; -%] [% FOR stg_acts = evt_stgs.stages -%] [% SET key = stage_key _ '-' _ stg_acts.stage -%] [% hooks_by_key.$key = [] -%] [% stage_descriptions.$key = stg_acts.description -%] [% END -%] [% FOR action = stg_acts.actions -%] [% hooks_by_key.$key.push( action ) -%] [% SET row_classes = [ 'hook', "$key-hook", ] %] [% row_classes.push( action.enabled ? 'hook-enabled' : 'hook-disabled' ) -%] [% IF loop.first; row_classes.push('first-hook'); END -%] [% IF loop.last; row_classes.push('final-hook'); END -%] [% END -%] [% END -%] [% END -%]
[% locale.maketext('Event/Hook') %] [% locale.maketext('Stage') %] [% locale.maketext('Description/Notes') %] [% locale.maketext('Attributes') %] [% locale.maketext('Actions') %]
[% evt_stgs.event FILTER html -%] [% stg_acts.stage FILTER html -%] [% stg_acts.description FILTER html -%] [% IF stg_acts.attributes.blocking -%] [% ELSE -%] [% END -%] [%# TODO: Remove this before merge -%] [% IF 0 && stg_acts.actions.size > 1 -%] [% locale.maketext('Reorder Hooks') %]
[% IF stg_acts.actions.size > 1 -%] [% END -%] [% action.hook FILTER html -%] [% action.notes FILTER html -%] [% IF action.enabled -%] [% ELSE -%] [% END -%] [% IF action.escalateprivs -%] [% ELSE -%] [% END -%] [% IF action.check -%] [% ELSE -%] [% END -%] [% IF action.rollback -%] [% ELSE -%] [% END -%] [% locale.maketext('Details') %]  [% action.enabled ? locale.maketext('Disable') : locale.maketext('Enable') %]  [% locale.maketext('Delete') %]
[% END -%]
[% PROCESS '_ajaxapp_footer.tmpl' -%] [% END -%] [% END -%]