[% site_config.title = c.loc('NCOS details for [_1]', level_result.level) -%]

<h2>[% c.loc('NCOS Number Patterns') %]</h2>
[%
    helper.name = c.loc('Number Pattern');
    helper.identifier = 'number_pattern';
    helper.messages = messages;
    helper.dt_columns = pattern_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( "/ncos/pattern_ajax", [c.req.captures.0] );

    helper.tmpuri = c.uri_for_action( "/ncos/pattern_root", [c.req.captures.0] );

    UNLESS c.user.read_only;
        helper.dt_buttons = [
            { name = c.loc('Edit'), uri = helper.tmpuri _ "/'+full.id+'/edit", class = 'btn-small btn-primary', icon = 'icon-edit' },
            { name = c.loc('Delete'), uri = helper.tmpuri _ "/'+full.id+'/delete", class = 'btn-small btn-secondary', icon = 'icon-trash' },
        ];
        helper.top_buttons = [
            { name = c.loc('Create Pattern Entry'), uri = c.uri_for_action( "/ncos/pattern_create", [c.req.captures.0] ), icon = 'icon-star' },
        ];
    END;

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

<div class="ngcp-separator"></div>

<div id="number_patterns_extra">
    <input id="local_ac" type="checkbox" name="local_ac" disabled="disabled"
        [% IF local_ac_checked %]checked="checked"[% END %]>
    <label for="local_ac">[% c.loc('Include local area code') %]</label>
    <div class="ngcp-separator"></div>
    [% IF c.license('pbx') && c.config.features.cloudpbx -%]
    <input id="intra_pbx" type="checkbox" name="intra_pbx" disabled="disabled"
        [% IF intra_pbx_checked %]checked="checked"[% END %]>
    <label for="intra_pbx">[% c.loc('Intra PBX Calls within same customer') %]</label>
    <div class="ngcp-separator"></div>
    [% END -%]

    <div>
        <a class="btn btn-primary btn-small"
            href="[% c.uri_for_action("/ncos/pattern_edit_extra", [c.req.captures.0]) %]">
            <i class="icon-edit"></i> [% c.loc('Edit') %]
        </a>
    </div>
    <div class="ngcp-separator"></div>
</div>

[% IF c.user.roles == "admin" -%]
<div class="ngcp-separator"></div>
<h2>[% c.loc('NCOS LNP Carriers') %]</h2>
[%
    helper.name = c.loc('LNP Carriers');
    helper.identifier = 'lnp_carriers';
    helper.messages = lnp_messages;
    helper.dt_columns = lnp_dt_columns;
    helper.length_change = 1;

    helper.close_target = close_target;
    helper.create_flag = lnp_create_flag;
    helper.edit_flag = lnp_edit_flag;
    helper.form_object = lnp_form;
    helper.ajax_uri = c.uri_for_action( "/ncos/lnp_ajax", [c.req.captures.0] );

    helper.tmpuri = c.uri_for_action( "/ncos/lnp_root", [c.req.captures.0] );

    UNLESS c.user.read_only;
        helper.dt_buttons = [
            { name = c.loc('Edit'), uri = helper.tmpuri _ "/'+full.id+'/edit", class = 'btn-small btn-primary', icon = 'icon-edit' },
            { name = c.loc('Delete'), uri = helper.tmpuri _ "/'+full.id+'/delete", class = 'btn-small btn-secondary', icon = 'icon-trash' },
            { name = c.loc('Patterns'), uri = helper.tmpuri _ "/'+full.id+'/lnp_patterns", class = 'btn-small btn-tertiary', icon = 'icon-list' },
        ];
        helper.top_buttons = [
            { name = c.loc('Create LNP Entry'), uri = c.uri_for_action( "/ncos/lnp_create", [c.req.captures.0] ), icon = 'icon-star' },
        ];
    END;

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

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