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

{% macro set_account_status_img(status) -%}
    {% if status == 'active' or status == 'yes' %}
        {% set img = "enabled.png" %}
    {% else %}
        {% set img = "disabled.png" %}
    {% endif %}
    <img title="{{ _('Status:') }} {{status |title }}" src="{{ctx.homepath}}/static/{{skin}}/images/{{img}}">
{%- endmacro %}

{% macro set_status_img(status) -%}
    {% if status == 'active' or status == 'yes' %}
        {% set img = "enabled.png" %}
    {% else %}
        {% set img = "disabled.png" %}
    {% endif %}
    <img title="{{status |title }}" src="{{ctx.homepath}}/static/{{skin}}/images/{{img}}">
{%- endmacro %}

{% macro display_input_img(image="", alt="") -%}
    <input type="image" src="{{ctx.homepath}}/static/{{skin}}/images/{{image}}" alt="{{alt}}">
{%- endmacro %}

{% macro input_hidden(name, value) -%}
    <input type="hidden" name="{{ name }}" value="{{ value }}">
{%- endmacro %}

{% macro display_cn(value='', accountType='domain', firstitem='yes') -%}
    <fieldset class="frm-group {% if firstitem == 'yes' %}group1{% endif %}">
        <div class="sf-set {% if firstitem == 'yes' %}set1{% endif %}">
            <div class="sf-box text">
                <label><span>
                {% if accountType == 'domain' %}
                    {{ _('Company/Organization name') }}
                {% else %}
                    {{ _('Display Name') }}
                {% endif %}
                </span></label>
                <span class="fld-input"><input type="text" name="cn" value="{{value}}" size="50" /></span>
            </div>
        </div>
    </fieldset>
{%- endmacro %}

{# Display accountStatus #}
{% macro display_account_status(accountStatus) %}
    <fieldset class="frm-group">
        <legend class="group-legend"><strong>{{ _('Account status') }}</strong></legend>
        <fieldset class="mf-set required">
            <legend><span>{{ _('Account status') }}<em>{{ _('(Required)') }}</em></span></legend>
            <div class="mf-box">
                <div class="mf-item">
                    <span class="fld-input"><input type="radio" name="accountStatus" value="active" {% if accountStatus == 'active' %}checked="on"{%endif%}/></span>
                    <label>{{ _('Active') }}</label>
                </div>
                <div class="mf-item">
                    <span class="fld-input"><input type="radio" name="accountStatus" value="disabled" {% if accountStatus == 'disabled' %}checked{%endif%}/></span>
                    <label>{{ _('Disabled') }}</label>
                </div>
            </div>
        </fieldset>
    </fieldset>
{%- endmacro %}

{# Display domainBackupMX #}
{% macro display_domain_backup_mx(domainBackupMX) %}
    <fieldset class="frm-group group1">
        <legend class="group-legend"><strong>{{ _('Backup MX') }}</strong></legend>
        <fieldset class="mf-set">
            <legend><span>{{ _('Backup MX') }}</span></legend>
            <div class="mf-box">
                <div class="mf-item">
                    <span class="fld-input"><input type="radio" name="domainBackupMX" {% if domainBackupMX == 'yes' %}value="yes" checked{%endif%} /></span>
                    <label>{{ _('Yes') }}</label>
                </div>
                <div class="mf-item">
                    <span class="fld-input"><input type="radio" name="domainBackupMX" {% if domainBackupMX == 'no' %}value="no" checked{%endif%} /></span>
                    <label>{{ _('No') }}</label>
                </div>
            </div>
        </fieldset>
    </fieldset>
{%- endmacro %}

{% macro display_all_admins(admins, domainAdmins=[]) -%}
    <div class="frm-group group1">
        <fieldset class="mf-set set1">
        <legend><span>{{ _('Domain admin assignment') }}<em>{{ _('If no admin assigned, you can manage it with global admin.') }}</em></span></legend>
        <div class="mf-box">
            <div class="checklist">
                <fieldset>
                    {% for admin in admins %}
                    {% set adminMail = admin[1].get('mail')[0] %}
                    <div class="checklist-item">
                        <span class="fld-input">
                            <input type="checkbox" name="domainAdmin" value="{{ adminMail }}" {% if adminMail in domainAdmins %}checked{%endif%} />
                        </span>
                        <label>
                            {% if admin[1].has_key('cn') %}
                                {{ _("%s (%s)") |format( admin[1].get('cn')[0].decode('utf-8'), adminMail ) }}
                            {% else %}
                            {{ adminMail }}
                            {% endif %}
                            {% if 'yes' in admin[1].get('domainGlobalAdmin', []) %}<em><strong>{{ _('(Global Admin)') }}</strong></em>{% endif %}
                        </label>
                    </div>
                    {% endfor %}
                </fieldset>
            </div>
            <div><span><a href="{{ctx.homepath}}/create/admin" target="_blank">{{ _('Create new admin') }}</a></span></div>
        </div>
    </fieldset>
{%- endmacro %}

{% macro display_mta_transport(mtaTransport) -%}
    <fieldset class="frm-group">
        <legend class="group-legend"><strong>{{ _('MTA transport') }}</strong></legend>
        <div class="sf-set">
            <div class="sf-box text required">
                <label><span>{{ _('MTA transport') }}</span><small>{{ _('Default is <strong>%s</strong>.') |format(mtaTransport) }}</em></small></label>
                <span class="fld-input"><input type="text" name="mtaTransport" size="25" /><em>{{ _('Leave it empty to use default transport.') }}</em></span>
            </div>
        </div>
    </fieldset>
{%- endmacro %}

{% macro display_reset_password(oldpw='', newpw='', confirmpw='', show_oldpw='no', show_confirmpw='yes', firstitem='yes') -%}
    <fieldset class="frm-group {%if firstitem == 'yes' %}group1{%endif%}">
        <legend class="group-legend"><strong>Required information</strong></legend>
        {% if show_oldpw == 'yes' %}
        <div class="sf-set {%if firstitem == 'yes' %}set1{%endif%}">
            <div class="sf-box text required">
                <label for="oldpw"><span>{{ _('Old password') }} <em>{{ _('(Required)') }}</em></span></label><br />
                <span class="fld-input"><input type="password" id="oldpw" name="oldpw" size="35" value="{{oldpw}}"/></span><br />
            </div>
        </div>
        {% endif %}

        <div class="sf-set">
            <div class="sf-box text required">
                <label for="newpw"><span>{{ _('New password') }} <em>{{ _('(Required)') }}</em></span></label><br />
                <span class="fld-input"><input type="password" id="newpw" name="newpw" size="35" value="{{newpw}}"/></span><br />
            </div>
        </div>

        {% if show_confirmpw == 'yes' %}
        <div class="sf-set">
            <div class="sf-box text required">
                <label for="confirmpw"><span>{{ _('Confirm new password') }} <em>{{ _('(Required)') }}</em></span> <small>{{ _('Re-enter your password exactly as before.') }}</small></label><br />
                <span class="fld-input"><input type="password" id="confirmpw" name="confirmpw" size="35" value="{{confirmpw}}"/></span><br />
            </div>
        </div>
        {% endif %}
    </fieldset>
{%- endmacro %}

{% macro display_quota(value='', display_current_value='yes', firstitem='yes') -%}
<fieldset class="frm-group {% if firstitem == 'yes' %}group1{% endif %}">
    <div class="sf-set {% if firstitem == 'yes' %}set1{% endif %}">
        <div class="sf-box text">
            <label><span>{{ _('Mail quota (in MB)') }}</span></label>
            <span class="fld-input"><input type="text" name="mailQuota" value="" size="25" />{% if display_current_value == 'yes' %}&nbsp;{{_('Current quota:') }} {% if value == 0 or value == '0' %}<strong>{{ _('Unlimited') }}</strong>{%else%}{{ value |filesizeformat}}&nbsp;({{value}}&nbsp;Bytes){%endif%}{%endif%}</span>
        </div>
    </div>
</fieldset>
{%- endmacro %}
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.