[% site_config.title = c.loc('Subscriber Profiles for Profile Set [_1]', set.name) -%]
[%
    helper.name = c.loc('Subscriber Profile');
    helper.identifier = 'subscriber_profile';
    helper.messages = messages;
    helper.dt_columns = profile_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( "/subscriberprofile/profile_ajax", [c.req.captures.0] );

    IF clone_flag;
        helper.name = c.loc('cloned Subscriber Profile');
    END;

    UNLESS c.user.read_only;
        UNLESS c.user.roles == "reseller" && !c.config.profile_sets.reseller_edit;
            helper.dt_buttons = [
                { name = c.loc('Edit'), uri = "/subscriberprofile/" _ set.id _ "/profile/'+full.id+'/edit", class = 'btn-small btn-primary', icon = 'icon-edit' },
                { name = c.loc('Delete'), uri = "/subscriberprofile/" _ set.id _ "/profile/'+full.id+'/delete", class = 'btn-small btn-secondary', icon = 'icon-trash' },
                { name = c.loc('Clone'), uri = "/subscriberprofile/" _ set.id _ "/profile/'+full.id+'/clone", class = 'btn-small btn-tertiary', icon = 'icon-retweet' },
                { name = c.loc('Preferences'), uri = "/subscriberprofile/" _ set.id _ "/profile/'+full.id+'/preferences", class = 'btn-small btn-tertiary', icon = 'icon-list' },
            ];
            helper.top_buttons = [
                { name = c.loc('Profile Sets'), uri = c.uri_for('/subscriberprofile'), icon = 'icon-list' },
                { name = c.loc('Create Subscriber Profile'), uri = c.uri_for_action('/subscriberprofile/profile_create', c.req.captures), icon = 'icon-star' },
            ];
        ELSE;
            helper.dt_buttons = [
                { name = c.loc('Edit'), uri = "/subscriberprofile/" _ set.id _ "/profile/'+full.id+'/edit", class = 'btn-small btn-primary', icon = 'icon-edit' },
                { name = c.loc('Preferences'), uri = "/subscriberprofile/" _ set.id _ "/profile/'+full.id+'/preferences", class = 'btn-small btn-tertiary', icon = 'icon-list' },
            ];
            helper.top_buttons = [
                { name = c.loc('Profile Sets'), uri = c.uri_for('/subscriberprofile'), icon = 'icon-list' },
            ];
        END;
    ELSE;
        helper.top_buttons = [
            { name = c.loc('Profile Sets'), uri = c.uri_for('/subscriberprofile'), icon = 'icon-list' },
        ];
    END;

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