iredadmin-ose / templates / default / ldap / admins.html

{% extends "layout.html" %}

{% from "macros.html" import set_account_status_img %}

{% block title %}{{ _('Domain admins') }}{% endblock %}

{% block id_welcome %}
<span>{{ _('All mail administrators.') }} {{ _('Total: %s.') |format(admins |length) }}</span>
{% endblock id_welcome %}

{% block id_visit_links %}
<span><a href="{{ctx.homepath}}/create/admin">{{ _('Create new mail admin') }}</a></span>
{% endblock id_visit_links %}

{% block main %}
{# Show system message #}
{% if msg is defined and msg is not sameas none %}
    <div class="ct-box info-box">
    {% if msg == 'ADMIN_DELETED_SUCCESS' %}
        <div class="success">{{ _('Selected accounts are deleted.') }}</div>
    {% elif msg == 'ADMIN_DISABLED_SUCCESS' %}
        <div class="success">{{ _('Selected accounts are diabled.') }}</div>
    {% elif msg == 'ADMIN_ENABLED_SUCCESS' %}
        <div class="success">{{ _('Selected accounts are enabled.') }}</div>
    {% else %}
        <div class="error">
        {% if msg == 'NO_ACCOUNT_SELECTED' %}
            {{ _('No account selected.') }}
        {% else %}
            {{ msg }}
        {% endif %}
        </div>
    {% endif %}
    </div>
{% endif %}

{# List admins #}

{#{% if admins|length > 0 %}#}
{% if admins is not string %}
    <div>
    <form id="list_table" method="post" action="{{ctx.homepath}}/admins">
        <table id="account_list" class="tablesorter">
        <thead>
        <tr>
            <th>{{ _('Display Name') }}</th>
            <th>{{ _('Mail Address') }}</th>
            <th>{{ _('Global Admin') }}</th>
        </tr>
        </thead>

        <tbody>
        {% for admin in admins %}
            {% set entry = admin[1] %}

            {% set mail = entry.get('mail')[0] %}
            {% set cn = entry.get('cn', [''])[0].decode('utf-8') %}
            {% set accountStatus = entry.get('accountStatus', ['disabled'])[0] %}
            {% set domainGlobalAdmin = entry.get('domainGlobalAdmin', ['no'])[0] %}

            {# Display username part of mail address when cn is empty. #}
            {% if cn == '' %}
                {% set cn = mail.split('@', 1)[0] %}
            {% endif %}

            <tr class="{{ loop.cycle('odd', 'even') }} {{ accountStatus |lower }}">
                <td>
                    <span class="float_left">
                        <input type="checkbox" name="mail" value="{{mail}}" />
                        <a href="{{ctx.homepath}}/profile/admin/general/{{mail}}" title="{{ _('Edit admin profile.') }}">{{ cn }}</a>
                    </span>
                    <span class="float_right">{{ set_account_status_img(accountStatus) }}</span>
                </td>
                <td>{{mail}}</td>
                <td>{{ set_account_status_img(domainGlobalAdmin) }}</td>
            </tr>
        {% endfor %}
        </tbody>
    </table>

        <div class="frm-buttons">
            <span class="submit">
                <input type="checkbox" id="checkall" />{{ _('Select/Unselect all') }}
                <input type="submit" name="delete" value="{{ _('Delete') }}" onclick="return confirm('{{ _('Are you sure want to delete selected account(s)?') }}');" }}" />
                <input type="submit" name="disable" value="{{ _('Disable') }}" onclick="return confirm('{{ _('Are you sure want to disable selected account(s)?') }}');" }}" />
                <input type="submit" name="enable" value="{{ _('Enable') }}" onclick="return confirm('{{ _('Are you sure want to enable selected account(s)?') }}');" }}" />
            </span>
        </div>
    </form>
</div>
{% endif %}

{% endblock main %}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.