Source

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

Full commit
{#
#---------------------------------------------------------------------
# This file is part of iRedAdmin-OSE, which is official web-based admin
# panel (Open Source Edition) for iRedMail.
#
# iRedMail is an open source mail server solution for Red Hat(R)
# Enterprise Linux, CentOS, Debian and Ubuntu.
#
# iRedAdmin-OSE is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# iRedAdmin-OSE is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with iRedAdmin-OSE.  If not, see <http://www.gnu.org/licenses/>.
#---------------------------------------------------------------------
#}

{% extends "layout.html" %}

{% from "macros.html" import set_account_status_img, with context %}
{% from "msgHandlers.html" import domainMsgHandler with context %}

{% block title %}{{ _('Mail Domains') }}{% endblock %}
{% block navlinks_active_domains %}active{% endblock %}

{% block id_welcome %}
<span>{{ _('All domains under your control.') }} {{ _('Total: %s.') |format(allDomains|length) }}</span>
{% endblock id_welcome %}

{% block id_visit_links %}
{% if session.get('domainGlobalAdmin') == 'yes' %}
<span><a href="{{ctx.homepath}}/create/domain">{{ _('Create new mail domain') }}</a></span>
{% endif %}
{% endblock id_visit_links %}

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

{# List all domains under control. #}
{% if allDomains is not string and allDomains |length != 0 %}
<div class="main-frm">
    <form id="list_table" method="post" action="{{ctx.homepath}}/domains">
    <table id="account_list" class="tablesorter">
        <thead>
        <tr>
            <th>{{ _('Domain Name') }}</th>
            <th>{{ _('Users') }}</th>
        </tr>
        </thead>

        {# List domain attributes/avalues. #}
        <tbody>
        {% for i in allDomains %}
            {% set entries = i[1] %}
            {% set domain = entries.get('domainName')[0] |string%}
            {% set accountStatus = entries.get('accountStatus', ['disabled'])[0] %}

            <tr class="{{ accountStatus |lower }}">
                <td>
                    <span class="float_left">
                        {% if session.get('domainGlobalAdmin') == 'yes' %}
                        <input type="checkbox" name="domainName" value="{{domain}}"/>
                        {% endif %}
                        <a href="{{ctx.homepath}}/profile/domain/general/{{domain}}" alt="{{_('Edit domain profile')}}" title="{{ _('Edit domain profile') }}">{{domain}}</a>
                    </span>
                    <span class="float_right">{{ set_account_status_img(accountStatus) }}</span>
                </td>

                {# Mail user count #}
                <td><a href="{{ctx.homepath}}/users/{{domain}}" title="{{ _('List all mail users.') }}">{{ entries.get('domainCurrentUserNumber', [0])[0] }}</a></td>
            </tr>
        {% endfor %}
        </tbody>
    </table>

    {% if session.get('domainGlobalAdmin') == 'yes' %}
        <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 domain(s) and accounts under it?') }}');" }}" />
                <input type="submit" name="disable" value="{{ _('Disable') }}" onclick="return confirm('{{ _('Are you sure want to disable selected domain(s)?') }}');" }}" />
                <input type="submit" name="enable" value="{{ _('Enable') }}" onclick="return confirm('{{ _('Are you sure want to enable selected domain(s)?') }}');" }}" />
            </span>
        </div>
    {% endif %}

    </form>
</div>
        {% endif %}

{% endblock main %}