[% site_config.title = c.loc('Subscribers') -%]
[%
    helper.name = c.loc('Subscriber');
    helper.identifier = 'subscriber';
    helper.data = subscribers;
    helper.messages = messages;
    helper.column_sort = 'status';
    helper.dt_columns = 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/ajax');

    UNLESS c.user.read_only;
        helper.dt_buttons = [
            { name = c.loc('Terminate'), uri = "/subscriber/'+full.id+'/terminate", class = 'btn-small btn-secondary', icon = 'icon-remove', condition = 'full.status != "terminated"' },
            { name = c.loc('Details'), uri = "/subscriber/'+full.id+'/details", class = 'btn-small btn-tertiary', icon = 'icon-th-list', condition = 'full.status != "terminated"' },
            { name = c.loc('Customer'), uri = "/customer/'+full.contract_id+'/details", class = 'btn-small btn-tertiary', icon = 'icon-user' },
        ];
        helper.top_buttons = [
            { name = c.loc('Create Subscriber'), uri = c.uri_for_action('/subscriber/create_list'), icon = 'icon-star' },
        ];
    ELSE;
        helper.dt_buttons = [
            { name = c.loc('Details'), uri = "/subscriber/'+full.id+'/details", class = 'btn-small btn-tertiary', icon = 'icon-th-list', condition = 'full.status != "terminated"' },
            { name = c.loc('Customer'), uri = "/customer/'+full.contract_id+'/details", class = 'btn-small btn-tertiary', icon = 'icon-user' },
        ];
    END;

    PROCESS 'helpers/datatables.tt';
-%]
[% # vim: set tabstop=4 syntax=html expandtab: -%]
