[%
    admin_header = 1;
    title = c.pref('name');
    selected = 'roles';
    WRAPPER page/wrapper.tt;
%]

<div id="content">
    <h1>[% loc('Roles') %]</h1>
[% IF roles.size > 0 %]
    <a href="[% c.uri_for('admin/create_role') %]">[%loc('Create a new role')%]</a>
    <table class="roles">
    <thead>
        <tr>
            <th>[%loc('ID')%]</th>
            <th>[%loc('Name')%]</th>
            <th>[%loc('Active')%]</th>
            <th></th>
        </tr>
    </thead>
    [% FOREACH role IN roles %]
    <tbody>
        <tr>
            <td>[% role.id     %]</td>
            <td>[% role.name   %]</td>
            <td>[% role.active ? loc('Yes') : loc('No') %]</td>
            <td><a href="[% c.uri_for('admin/role', role.name) %]">[%loc('Edit')%]</a></td>
        </tr>
    [% END %]
    </tbody>
    </table>
[% ELSE %]
    <div>
        [%loc('No roles created yet.')%]
        <a href="[% c.uri_for('admin/create_role') %]">[%loc('Create a new role')%]</a>
    </div>
[% END %]
    <h2>[% message %]</h2>
</div>

<div id="bottomnav">&nbsp;</div>
[% END # WRAPPER %]
