1. Zhang Huangbin
  2. iredadmin-ose

Commits

Zhang Huangbin  committed b37d086

Template code cleanup.

  • Participants
  • Parent commits 98e51f1
  • Branches default

Comments (0)

Files changed (9)

File templates/default/ldap/admin/create.html

View file
  • Ignore whitespace
 
 {% from "macros/general.html" import
         display_reset_password,
-        display_preferredLanguage,
+        display_preferred_language,
         display_add_admin,
         with context
         %}

File templates/default/ldap/admin/profile.html

View file
  • Ignore whitespace
                 set_account_status_img,
                 display_account_status,
                 display_input_cn,
-                display_preferredLanguage,
+                display_preferred_language,
                 display_reset_password,
                 display_input_global_admin,
                 display_button_submit,
                             {% endif %}
 
                             {{ display_input_cn(cn=cn, accountType='admin') }}
-                            {{ display_preferredLanguage(value=preferredLanguage, languagemaps=languagemaps) }}
+                            {{ display_preferred_language(value=preferredLanguage, languagemaps=languagemaps) }}
                         </div>
 
                     </div>{# .columns #}

File templates/default/ldap/domain/profile.html

View file
  • Ignore whitespace
 
 {% from "macros/general.html" import
         display_subnav,
-        nav_links_of_account_types,
         set_account_status_img,
         display_button_submit,
         display_input_cn,

File templates/default/ldap/user/list.html

View file
  • Ignore whitespace
         display_subnav,
         set_account_status_img,
         highlight_username_in_mail,
-        nav_links_of_account_types,
         display_progress_bar,
         show_pages,
         with context %}

File templates/default/macros/general.html

View file
  • Ignore whitespace
     {% endif %}
 {%- 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_button_submit(label=none, color='green') -%}
     <div class="rule2"></div>
     <div class="form-field clear">
     {% endif %}
 {%- endmacro %}
 
-{% macro input_hidden(name, value) -%}
-    <input type="hidden" name="{{ name }}" value="{{ value }}">
-{%- endmacro %}
-
 {% macro display_input_employeeid(value='') -%}
     {% if value is sameas none %}
         {% set value = '' %}
     </div>
 {%- endmacro %}
 
-{% macro display_preferredLanguage(value='', languagemaps=['en_US',]) -%}
+{% macro display_preferred_language(value='', languagemaps=['en_US',]) -%}
 <div class="form-field clear">
     <h4 class="size-250 fl-space">{{ _('Preferred language') }}</h4>
     <select name="preferredLanguage">
 </div>
 {%- endmacro %}
 
-{% macro displayedInGlobalAddressBook(enabledService=[]) %}
-    <div class="form-field clear">
-        <h4 class="size-250 fl-space">{{ _("Displayed in Global LDAP Address Book") }}</h4>
-        <div class="form-checkbox-item clear">
-            <input name="displayedInGlobalAddressBook" {% if 'displayedInGlobalAddressBook' in enabledService %}checked{% endif %} type="checkbox" rel="checkboxhorizont" class="checkbox" />
-        </div>
-    </div>
-{%- endmacro %}
 
 {% macro display_input_global_admin(value='no') %}
 <div class="form-field clear">
     {% if value == '0' or value == 0 or value == 'None' %}{% if hide_unlimited is not sameas true %}<span class="grey">/<em>{{ _('Unlimited') }}</em></span>{% endif %}{%else%}<span class="grey">/ <em>{{value}}</em></span>{%endif%}
 {%- endmacro %}
 
-{%- macro display_quota_usage_percent(current, total) -%}
-    {% set percent = (current |int * 100) // total |int %}
-    {% if percent > 80 %}
-        <span class="important"><strong>{{percent}}%</strong></span>
-    {% else %}
-        <span>{{percent}}%</span>
-    {% endif %}
-{%- endmacro -%}
 
 {# Display accountStatus #}
 {% macro display_account_status(accountStatus, accountType='user') %}
             <div class="bt-space5">&nbsp;</div>
 
             {{ display_input_cn() }}
-            {{ display_preferredLanguage(lang, languagemaps) }}
+            {{ display_preferred_language(lang, languagemaps) }}
 
             {{ display_button_submit(label=_('Add')) }}
         </form>
     </div>
 {%- endmacro %}
 
-{% macro display_maillist_restrictions(policy, maillist_email) -%}
-    {% set policy = policy.lower() %}
-    {% if policy == 'open' %}
-        {{ _('Unrestricted') }}
-    {% elif policy == 'domain' %}
-        {{ _("<a href='%s'>Domain users</a>") |format(ctx.homepath + '/users/' + maillist_email.split('@')[-1] ) }}
-    {% elif policy == 'subdomain' %}
-        {{ _("<a href='%s'>Domain and sub-domain users</a>") |format(ctx.homepath + '/users/' + maillist_email.split('@')[-1] ) }}
-    {% elif policy == 'membersonly' %}
-        {{ _("<a href='%s'>Members</a>") |format(ctx.homepath + '/profile/maillist/members/' + maillist_email) }}
-    {% elif policy == 'allowedonly' %}
-    {{ _("<a href='%s'>Moderators</a>") |format(ctx.homepath + '/profile/maillist/moderators/' + maillist_email) }}
-    {% elif policy == 'membersandmoderatorsonly' %}
-    {{ _("<a href='%s'>Members</a> and <a href='%s'>moderators</a>") |format(ctx.homepath + '/profile/maillist/members/' + maillist_email, ctx.homepath + '/profile/maillist/moderators/' + maillist_email) }}
-    {% else %}
-        {{ _('Unrestricted') }}
-    {% endif %}
-{% endmacro %}
-
-{% macro nav_links_of_account_types(domain, active='users') -%}
-    {% set links = [
-                    ('users', _('Users')),
-                    ('maillists', _('Mail Lists')),
-                    ('aliases', _('Aliases')),
-                    ]
-    %}
-    <span>&raquo;</span>
-    {% for url, label in links %}
-        <span class="important"><a href="{{ctx.homepath}}/{{url}}/{{domain}}" class="menu-item {% if url == active %}active{% endif %}">{{ label }}</a></span>{% if not loop.last %}&nbsp;&raquo;&nbsp;{% endif %}
-    {% endfor %}
-{%- endmacro %}
 
 {% macro highlight_username_in_mail(mail) -%}
     <span><strong>{{ mail.split('@')[0] }}</strong></span><span class="grey"><em>@{{ mail.split('@')[-1] }}</em></span>

File templates/default/mysql/admin/create.html

View file
  • Ignore whitespace
 
 {% from "macros/general.html" import
         display_reset_password,
-        display_preferredLanguage,
+        display_preferred_language,
         display_add_admin,
         with context
         %}

File templates/default/mysql/admin/profile.html

View file
  • Ignore whitespace
                 set_account_status_img,
                 display_account_status,
                 display_input_cn,
-                display_preferredLanguage,
+                display_preferred_language,
                 display_reset_password,
                 display_button_submit,
                 with context
                             {% endif %}
 
                             {{ display_input_cn(cn=profile.name, accountType='admin') }}
-                            {{ display_preferredLanguage(value=preferredLanguage, languagemaps=languagemaps) }}
+                            {{ display_preferred_language(value=preferredLanguage, languagemaps=languagemaps) }}
                         </div>
                     </div>{# .columns #}
 

File templates/default/mysql/domain/profile.html

View file
  • Ignore whitespace
 
 {% from "macros/general.html" import
         display_subnav,
-        nav_links_of_account_types,
         set_account_status_img,
         display_button_submit,
         display_input_cn,

File templates/default/mysql/user/list.html

View file
  • Ignore whitespace
         display_subnav,
         set_account_status_img,
         highlight_username_in_mail,
-        nav_links_of_account_types,
         display_progress_bar,
         show_pages,
         with context %}