Source

iredadmin-ose / templates / default / ldap / admin / profile.html

{% extends "layout.html" %}
{% from "macros/general.html" import
                display_subnav,
                set_account_status_img,
                display_csrf_token,
                display_account_status,
                display_input_cn,
                display_preferred_language,
                display_reset_password,
                display_random_password,
                display_button_submit,
                with context
                %}

{% from "macros/ldap.html" import
                display_all_domains,
                with context
                %}

{% from "macros/msgHandlers.html" import adminMsgHandler with context %}

{% block title %}{{ _('Edit account profile') }}{% endblock %}
{% block navlinks_active_admins %}class="active"{% endblock %}

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

{% block breadcrumb %}
    {% set crumbs = [
            (ctx.homepath + '/admins', _('All admins'),),
            (None, _('Profile of admin:') + ' ' + mail,),
            ]
            %}
    {{ display_subnav(crumbs) }}
{% endblock %}


{% block main %}

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

{% set navlinks = [
                ('general', _('General'), []),
                ('password', _('Password'), []),
                ]
                %}

<div class="content-box">
    <div class="box-body">
        <div class="box-header clear">
            <ul class="tabs clear">
                {% for nav in navlinks %}
                    {% if not false in nav[2] and not none in nav[2] %}
                        <li {% if profile_type == nav[0] %}class="active"{% endif %}><a href="{{ctx.homepath}}/profile/admin/{{nav[0]}}/{{mail}}">{{ nav[1] }}</a></li>
                    {% endif %}
                {% endfor %}
            </ul>

            <h2>{{ _('Profile of admin:') }} {{ mail }}</h2>
        </div>

        <div class="box-wrap clear">
            <form name="{{profile_type}}" method="post" action="{{ctx.homepath}}/profile/admin/{{profile_type}}/{{mail}}">
                {{ display_csrf_token() }}

                {% if profile_type == 'general' %}
                    <div class="columns clear">
                        <div class="col2-3">
                            {% if session.get('domainGlobalAdmin') is sameas true %}
                                {{ display_account_status(accountStatus) }}
                                <div class="bt-space0">&nbsp;</div>
                            {% endif %}

                            {{ display_input_cn(cn=cn, accountType='admin') }}
                            {{ display_preferred_language(value=entry.get('preferredLanguage', ['en_US'])[0], languagemaps=languagemaps) }}
                        </div>
                    </div>{# .columns #}

                {% elif profile_type == 'password' %}
                    <div class="columns clear">
                        <div class="col3-4">
                            {% if session.get('domainGlobalAdmin') is sameas true %}
                                {{ display_reset_password(
                                        min_passwd_length=min_passwd_length,
                                        max_passwd_length=max_passwd_length,
                                        show_confirmpw=true,
                                        )
                                }}
                            {% else %}
                                {{ display_reset_password(
                                        min_passwd_length=min_passwd_length,
                                        max_passwd_length=max_passwd_length,
                                        show_oldpw=true,
                                        show_confirmpw=true,
                                        )
                                }}
                            {% endif %}
                        </div>

                        <div class="col1-4 lastcol">
                            {{ display_random_password(max_passwd_length) }}
                        </div>
                    </div>
                {% endif %}{# profile_type #}

                {{ display_button_submit() }}
            </form>
        </div>{# .box-wrap #}
    </div>{# .box-body #}
</div>{#-- .content-box --#}
{% endblock main %}