mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-19 05:58:34 +02:00
@@ -6,7 +6,7 @@
|
||||
{% render_field form.password1 %}
|
||||
{% render_field form.password2 %}
|
||||
{% if form.domain_is_disabled %}
|
||||
{% include "common/generic_field.html" with field=form.is_active inline_message=_("Domain is disabled") extra_classes="info" %}
|
||||
{% include "common/generic_field.html" with field=form.is_active label_width="col-sm-4" inline_message=_("Domain is disabled") %}
|
||||
{% else %}
|
||||
{% render_field form.is_active %}
|
||||
{% endif %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% load i18n admin_tags lib_tags %}
|
||||
{% for domain in domains %}
|
||||
<tr id="{{ domain.id }}" class="{% if not domain.enabled %}muted{% endif %}" name="{{ forloop.counter }}">
|
||||
<td name="name">{% domain_modify_link domain %}</td>
|
||||
<tr id="{{ domain.id }}" class="{% if not domain.enabled %}text-muted{% endif %}" name="{{ forloop.counter }}">
|
||||
<td name="name">{% domain_modify_link domain %}{% if not domain.enabled %} ({% trans "disabled" %}){% endif %}</td>
|
||||
<td name="aliases">{% domain_aliases domain %} </td>
|
||||
<td name="tags">{% render_tags domain.tags %}</td>
|
||||
<td name="actions">{% domain_actions user domain %}</td>
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
{% load i18n admin_tags lib_tags %}
|
||||
{% for ident in identities %}
|
||||
<tr id="{{ ident.id }}" class="{% disable_identity ident %}" name="{{ forloop.counter }}">
|
||||
<td name="identity">{% identity_modify_link ident %}</td>
|
||||
{% check_identity_status ident as identity_is_enabled %}
|
||||
<tr id="{{ ident.id }}" class="{% if not identity_is_enabled %}text-muted{% endif %}" name="{{ forloop.counter }}">
|
||||
<td name="identity">{% identity_modify_link ident %}{% if not identity_is_enabled %} (disabled){% endif %}</td>
|
||||
<td name="name_or_rcpt">{{ ident.name_or_rcpt }}</td>
|
||||
<td name="tags">{% render_tags ident.tags %}</td>
|
||||
<td name="actions">{% identity_actions user ident %}</td>
|
||||
|
||||
@@ -168,19 +168,19 @@ def identity_actions(user, ident):
|
||||
return render_actions(actions)
|
||||
|
||||
|
||||
@register.simple_tag
|
||||
def disable_identity(identity):
|
||||
"""Disable an identity.
|
||||
|
||||
Finding this information depends on the identity type.
|
||||
"""
|
||||
@register.assignment_tag
|
||||
def check_identity_status(identity):
|
||||
"""Check if identity is enabled or not."""
|
||||
if identity.__class__.__name__ == "User":
|
||||
if identity.is_active and identity.mailbox_set.count() \
|
||||
and identity.mailbox_set.all()[0].domain.enabled:
|
||||
return ""
|
||||
elif identity.enabled and identity.domain.enabled:
|
||||
return ""
|
||||
return "muted"
|
||||
if identity.mailbox_set.count() \
|
||||
and not identity.mailbox_set.all()[0].domain.enabled:
|
||||
return False
|
||||
elif not identity.is_active:
|
||||
return False
|
||||
elif not identity.enabled or not identity.domain.enabled:
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
@register.simple_tag
|
||||
def domain_modify_link(domain):
|
||||
|
||||
@@ -284,5 +284,5 @@ html body div.navbar div.container-fluid div#navigate-navbar-collapse.collapse u
|
||||
|
||||
/* Wizard */
|
||||
#wizard .carousel-inner {
|
||||
overflow: visible;
|
||||
overflow: visible;
|
||||
}
|
||||
@@ -26,7 +26,7 @@
|
||||
<span class="help-block pull-right">{{ field.help_text }}</span>
|
||||
{% endif %}
|
||||
{% if inline_message %}
|
||||
<span class="">{{ inline_message }}</span>
|
||||
<span class="text-info">{{ inline_message }}</span>
|
||||
{% endif %}
|
||||
{% if field.errors %}
|
||||
<p class="help-block">
|
||||
|
||||
Reference in New Issue
Block a user