Source

iredadmin-ose / templates / default / ldap / domain_profile.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/>.
#---------------------------------------------------------------------
#}

{# cur_domain, allDomains, profile_type, #}
{% extends "layout.html" %}

{% from "macros.html" import
        set_account_status_img,
        display_cn,
        display_account_status,
        with context
        %}

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

{% block js %}{% endblock js %}
{% block js_tablesorter %}{% endblock js_tablesorter %}
{% block jquery_docoment_ready %}{% endblock jquery_docoment_ready %}

{% block title %}{{ _('Edit domain profile.') }}{% endblock %}
{% block navlinks_active_domains %}active{% endblock %}

{% block id_welcome %}
<span><a href="{{ctx.homepath}}/profile/domain/general/{{cur_domain}}" {% if profile_type == "general" %}class="active"{%endif%}>General</a>&nbsp;</span>
{% endblock id_welcome %}

{% block id_visit_links %}
<span><a href="{{ctx.homepath}}/users/{{cur_domain}}">{{ _('Users') }}</a></span>
{% endblock id_visit_links %}

{# Domain profile. #}
{% block main %}

{# Show system message #}
{{ domainMsgHandler(msg) }}

{% set p = profile[0] %}
{% set dn = p[0] %}
{% set entries = p[1] %}
{% set domainName = entries.get('domainName')[0] %}
{% set cn = entries.get('cn', [''])[0].decode('utf-8') %}
{% set accountStatus = entries.get('accountStatus', ['disabled'])[0] %}

{% set createTimestamp = entries.get('createTimestamp', ['--------------'])[0] %}

<form class="frm-form" method="post" action="{{ctx.homepath}}/profile/domain/{{profile_type}}/{{cur_domain}}">
<div class="main-frm">
    <div class="profile ct-group data-group vcard">
        <div class="ct-set data-set set1">
            <div class="ct-box data-box">
                <ul class="data-list">
                    <input type="hidden" name="domainName" value="{{cur_domain}}" />
                    <li>
                        <span><strong>{{ _('Domain Name') }}</strong></span>
                        <span>
                            <select id="domainSelect" name="domainName" onchange="changeDomain(this, baseurl='{{ctx.homepath}}/profile/domain/{{profile_type}}/');">
                                {% for d in allDomains %}
                                <option value="{{d[1].domainName[0]}}" {% if cur_domain == d[1].domainName[0] %}selected{%endif%}>{{d[1].domainName[0]}}</option>
                                {% endfor %}
                            </select>
                        </span>
                        <span>{{ set_account_status_img(accountStatus) }}</span>
                    </li>
                    <li><span><strong>{{ _('Company/Organization') }}</strong> {% if cn != 'None' %}{{cn}}{% endif %}</span></li>
                    <li><span><strong>{{ _('Created Date') }}</strong> {{createTimestamp[:4]}}-{{createTimestamp[4:6]}}-{{createTimestamp[6:8]}} {{createTimestamp[8:10]}}:{{createTimestamp[10:12]}}:{{createTimestamp[12:14]}}</span></li>
                </ul>
            </div>
        </div>
    </div>

    {% if profile_type == 'general' %}
        {% if session.get('domainGlobalAdmin') == 'yes' %}
            {{ display_account_status(accountStatus, accountType='domain', firstitem='yes',) }}
        {% endif %}

        {{ display_cn(cn, accountType='domain') }}
    {% endif %}

    <div class="frm-buttons">
        <span class="submit"><input type="submit" name="save" value="{{ _('Save changes') }}" /></span>
    </div>
</div>
</form>
{% endblock main %}