[% site_config.title = c.loc('Header Rule Actions for [_1]', hm_rule_result.name) -%]

[%
    helper.name = c.loc('Header Rule Actions');
    helper.identifier = 'header_rule_actions';
    helper.messages = messages;
    helper.dt_columns = hm_action_dt_columns;
    helper.length_change = 1;

    helper.close_target = close_target;
    helper.create_flag = create_flag;
    helper.edit_flag = edit_flag;
    helper.form_object = form;
    helper.ajax_uri = c.uri_for_action( "/header/actions_ajax", [c.req.captures.0, c.req.captures.1] );

    UNLESS c.user.read_only;
        FILTER null;
            backuritmp=c.req.uri;
            backuritmp.query_param_delete('back');
            backuritmp.query_param_delete('move');
            backuritmp.query_param_delete('where');
        END;
        helper.top_buttons = [
            { name = c.loc('Header Rule Sets'), uri = c.uri_for('/header/'), icon = 'icon-list' },
            { name = c.loc('Create Header Rule Action'), uri = c.uri_for_action('/header/actions_create', [c.req.captures.0, c.req.captures.1]), icon = 'icon-star' },
            { name = c.loc('Conditions'), uri = "/header/" _ hm_set_result.id _ "/rules/" _ hm_rule_result.id _ "/conditions", class = 'btn btn-teritary btn-large', icon = 'icon-play' },
        ];
        helper.dt_buttons = [
            { uri = "/header/" _ hm_set_result.id _ "/rules/" _ hm_rule_result.id _ "/actions/?move='+full.id+'&where=up", class = 'btn-small btn-primary', icon = 'icon-arrow-up' },
            { uri = "/header/" _ hm_set_result.id _ "/rules/" _ hm_rule_result.id _ "/actions/?move='+full.id+'&where=down", class = 'btn-small btn-primary', icon = 'icon-arrow-down' },
            { name = c.loc('Edit'), uri = "/header/" _ hm_set_result.id _ "/rules/" _ hm_rule_result.id _ "/actions/'+full.id+'/edit", class = 'btn-small btn-primary', icon = 'icon-edit' },
            { name = c.loc('Delete'), uri = "/header/" _ hm_set_result.id _ "/rules/" _ hm_rule_result.id _ "/actions/'+full.id+'/delete", class = 'btn-small btn-secondary', icon = 'icon-trash' },
        ];
    ELSE;
        helper.top_buttons = [
            { name = c.loc('Header Rule Sets'), uri = c.uri_for('/header/'), icon = 'icon-list' },
            { name = c.loc('Conditions'), uri = "/header/" _ hm_set_result.id _ "/rules/" _ hm_rule_result.id _ "/conditions", class = 'btn btn-teritary btn-large', icon = 'icon-play' },
        ];
        helper.dt_buttons = [
        ];
    END;

    PROCESS 'helpers/datatables.tt';
-%]

[% # vim: set tabstop=4 syntax=html expandtab: -%]
