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

[%
    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( "/subscriber/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('Create Header Rule Action'), uri = c.uri_for_action('/subscriber/header_actions_create', [c.req.captures.0, c.req.captures.1]), icon = 'icon-star' },
            { name = c.loc('Conditions'), uri = "/subscriber/" _ subscriber.id _ "/preferences/header/" _ hm_rule_result.id _ "/conditions", class = 'btn btn-teritary btn-large', icon = 'icon-play' },
        ];
        helper.dt_buttons = [
            { uri = "/subscriber/" _ subscriber.id _ "/preferences/header/" _ hm_rule_result.id _ "/actions/?move='+full.id+'&where=up", class = 'btn-small btn-primary', icon = 'icon-arrow-up' },
            { uri = "/subscriber/" _ subscriber.id _ "/preferences/header/" _ hm_rule_result.id _ "/actions/?move='+full.id+'&where=down", class = 'btn-small btn-primary', icon = 'icon-arrow-down' },
            { name = c.loc('Edit'), uri = "/subscriber/" _ subscriber.id _ "/preferences/header/" _ hm_rule_result.id _ "/actions/'+full.id+'/edit", class = 'btn-small btn-primary', icon = 'icon-edit' },
            { name = c.loc('Delete'), uri = "/subscriber/" _ subscriber.id _ "/preferences/header/" _ hm_rule_result.id _ "/actions/'+full.id+'/delete", class = 'btn-small btn-secondary', icon = 'icon-trash' },
        ];
    ELSE;
        helper.top_buttons = [
            { name = c.loc('Conditions'), uri = "/subscriber/" _ subscriber.id _ "/preferences/header/" _ 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: -%]
