Source

iredadmin-ose / templates / default / pgsql / admin / list.html

{% extends "layout.html" %}

{% from "macros/general.html" import
        display_csrf_token,
        set_account_status_img,
        highlight_username_in_mail,
        set_admin_type_img,
        show_pages,
        with context
        %}
{% from "macros/msgHandlers.html" import adminMsgHandler with context %}

{% block title %}{{ _('Domain Admins') }}{% endblock %}
{% block navlinks_active_admins %}class="active"{% endblock %}

{% block main %}
{# Show system message #}
{{ adminMsgHandler(msg) }}

{# List admins #}

{#{% if admins|length > 0 %}#}
{% if admins is not string %}
    <div class="content-box">
        <div class="box-body">
            <div class="box-header clear">
                {# -- Tabs -- #}
                <ul class="tabs clear">
                    <li class="active"><a href="{{ctx.homepath}}/admins">{{ _('All admins') }}</a></li>
                    {% if session.get('domainGlobalAdmin') is sameas true %}
                        <li><a href="{{ctx.homepath}}/create/admin"><img src="{{ctx.homepath}}/static/{{skin}}/images/ico_add_12.png" class="vcenter" />&nbsp;{{ _('Add admin') }}</a></li>
                    {% endif %}
                </ul>

                <h2>{{ _('All mail administrators.') }}
                    {% if total is defined and admins|length > 0 %}
                        ({{ (cur_page-1) * pageSizeLimit + 1 }}-{{ (cur_page-1) * pageSizeLimit + admins|length}}/{{ total }})
                    {% endif %}
                </h2>
            </div>

        <form name="admins" id="list_table" method="post" action="{{ctx.homepath}}/admins">
        {{ display_csrf_token() }}

        <table class="style1 tablesorter" cellspacing="0">
        <thead>
        <tr>
            <th class="checkbox"><input type="checkbox" class="checkbox select-all" /></th>
            <th>{{ _('Display Name') }}</th>
            <th>{{ _('Mail Address') }}</th>
            <th>{{ _('Global Admin') }}</th>
        </tr>
        </thead>

        <tbody>
            {% for r in admins %}
                {% set username = r.username |e %}
                {% set name = r.name |e %}

                <tr>
                    <td class="checkbox"><input type="checkbox" name="mail" value="{{ username }}" {% if username == session.get('username') %}disabled{% endif %}/></td>
                    <td>
                        <a href="{{ctx.homepath}}/profile/{% if r.get('isadmin') is not sameas none %}user{% else %}admin{% endif %}/general/{{ username }}"><img src="{{ctx.homepath}}/static/{{skin}}/images/action_edit.png" title="{{ _('Edit account profile') }}" class="fr-space"/></a>
                        {{ set_account_status_img(r.active) }}

                        {# -- Show name -- #}
                        {% if name == '' %}
                            {{ username.split('@', 1)[0] }}
                        {% else %}
                            {{ name |cutString }}
                        {% endif %}
                    </td>
                    <td>{{ username }}</td>
                    {% if r.get('isglobaladmin') is not sameas none %}
                        {# users marked as admin #}
                        {% if r.get('isglobaladmin') == 1 %}
                            <td>{{ set_admin_type_img('yes') }}</td>
                        {% else %}
                            <td>{{ set_admin_type_img('no') }}</td>
                        {% endif %}
                    {% else %}
                        {# Separate admin accounts #}
                        {% if username in allGlobalAdmins %}
                            <td>{{ set_admin_type_img('yes') }}</td>
                        {% else %}
                            <td>{{ set_admin_type_img('no') }}</td>
                        {% endif %}
                    {% endif %}
                </tr>
            {% endfor %}
        </tbody>
        </table>

        <div class="tab-footer clear f1">
            <div class="fl">
                <select name="action" class="fl-space">
                    <option>{{ _('Choose Action') }}</option>
                    <option value="enable">{{ _('Enable') }}</option>
                    <option value="disable">{{ _('Disable') }}</option>
                    <option value="delete">{{ _('Delete') }}</option>
                </select>
                <input type="submit" value="{{ _('Apply') }}" class="button fl-space" />
            </div>

            {{ show_pages(baseurl=ctx.homepath + '/admins', total=total, cur_page=cur_page) }}
        </div>
        </form>

    </div>{# -- box body -- #}
</div>{# -- content box -- #}
{% endif %}

{% endblock main %}

{% block js %}
    {{ load_jquery(['tablesorter'], nonSortedCols=[0]) }}
{% endblock js %}
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.