[% site_config.title = c.loc('Security Bans')  -%]
[% UNLESS framed -%]
<div class="row">
    <span class="pull-left" style="margin:0 5px 0 5px;">
        <a class="btn btn-primary btn-large" href="[% c.uri_for('/back') %]"><i class="icon-arrow-left"></i> [% c.loc('Back') %]</a>
    </span>
</div>
[% back_created = 1 -%]
[% END -%]

<div class="row">
    [% FOREACH m IN messages -%]
        <div class="alert alert-[% m.type %]">[% m.text %]</div>
    [% END -%]
</div>

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


<div class="accordion" id="security_data">

    <div class="accordion-group">
        <div class="accordion-heading">
            <a class="accordion-toggle" data-toggle="collapse" data-parent="#security_data" href="#collapse_ips">[% c.loc('Banned IPs') %]</a>
        </div>
        <div class="accordion-body collapse" id="collapse_ips">
            <div class="accordion-inner">
                    <a class="btn btn-large btn-primary" href="javascript:var table=$('#banned_ips_table').dataTable().api().ajax.reload();">
                        <i class="icon-star"></i> [% c.loc('Refresh banned IPs data') %]
                    </a>

[%
    helper.name = c.loc('Banned IPs');
    helper.identifier = 'banned_ips';
    helper.length_change = 1;
    helper.dt_columns = bannedips_dt_columns;
    helper.data_static = 1;
    helper.ajax_uri = c.uri_for_action('/security/ip_list');

    helper.dt_buttons = [
        { name = c.loc('Unban'), uri = "/security/ip/'+encodeURI(full.ip)+'/unban", class = 'btn-small btn-primary', icon = 'icon-removet' },
    ];
    PROCESS 'helpers/datatables.tt';
%]


            </div>
        </div>
    </div>

    <div class="accordion-group">
        <div class="accordion-heading">
            <a class="accordion-toggle" data-toggle="collapse" data-parent="#security_data" href="#collapse_users">[% c.loc('Banned Users') %]</a>
        </div>
        <div class="accordion-body collapse" id="collapse_users">
            <div class="accordion-inner">
                    <a class="btn btn-large btn-primary" href="javascript:var table=$('#banned_users_table').dataTable().api().ajax.reload();">
                        <i class="icon-star"></i> [% c.loc('Refresh banned users data') %]
                    </a>

[%
    helper.name = c.loc('Banned Users');
    helper.identifier = 'banned_users';
    helper.length_change = 1;
    helper.dt_columns = bannedusers_dt_columns;
    helper.data_static = 1;
    helper.ajax_uri = c.uri_for_action('/security/user_list');

    helper.dt_buttons = [
        { name = c.loc('Unban'), uri = "/security/user/'+encodeURI(full.username)+'/unban", class = 'btn-small btn-primary', icon = 'icon-removet' },
    ];
    PROCESS 'helpers/datatables.tt';
%]

            </div>
        </div>
    </div>

</div>

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