Work in progress:
 * New domains admin page, all menus are now at the same level,
 * Views, models and forms partial refactoring (better code organization).
This commit is contained in:
tonio
2010-12-07 23:44:28 +01:00
parent 66f08caea9
commit 308702ec10
25 changed files with 462 additions and 256 deletions
+4 -10
View File
@@ -1,21 +1,16 @@
{% extends "nlayout.html" %}
{% extends "admin/domains_header.html" %}
{% load i18n admin_extras libextras %}
{% block html_head %}
<script src="{{ MEDIA_URL }}js/domains.js" type="text/javascript"></script>
{{ block.super }}
<script type="text/javascript">
window.addEvent('domready', function() {
{% url admin.views.domains as view_url %}
{% url admin.views.mailboxes as view_url %}
bindRows("{{ view_url }}", "{{ current_page }}");
});
</script>
{% endblock %}
{% block middletitle %}{% trans "Available domains" %}{% endblock %}
{% block menu %}{% domains_menu "domains" user %}{% endblock %}
{% block content %}
{% if messages %}
{% display_messages messages %}
{% endif %}
<div id="domcontent">
{% block subcontent %}
{% if not domains %}<div class="info">{% trans "No domain defined." %}</div>
{% else %}
<table>
@@ -37,5 +32,4 @@
{% endfor %}
</table>
{% endif %}
</div>
{% endblock %}
+17
View File
@@ -0,0 +1,17 @@
{% extends "nlayout.html" %}
{% load i18n admin_extras libextras %}
{% block html_head %}
<script src="{{ MEDIA_URL }}js/domains.js" type="text/javascript"></script>
{% endblock %}
{% block middletitle %}
{% block pagetitle %}{% endblock %}{% if domain %} ({% trans "for" %} {{ domain.name }}){% endif %}
{% endblock %}
{% block menu %}{% domains_menu selection user domid %}{% endblock %}
{% block content %}
{% if messages %}
{% display_messages messages %}
{% endif %}
<div id="subcontent">
{% block subcontent %}{% endblock %}
</div>
{% endblock %}
+3 -14
View File
@@ -1,17 +1,7 @@
{% extends "nlayout.html" %}
{% extends "admin/domains_header.html" %}
{% load i18n admin_extras libextras %}
{% block html_head %}
<script src="{{ MEDIA_URL }}js/domains.js" type="text/javascript"></script>
<script type="text/javascript">
</script>
{% endblock %}
{% block middletitle %}
{% trans "Domain aliases" %}{% if domain %} ({% trans "for" %} {{ domain.name }}){% endif %}
{% endblock %}
{% block menu %}{% domains_menu "domaliases" user %}{% endblock %}
{% block content %}
{% if messages %}{% display_messages messages %}{% endif %}
<div id="domcontent">
{% block pagetitle %}{% trans "Domain aliases" %}{% endblock %}
{% block subcontent %}
{% if not domaliases %}
<div class="info">{% trans "No domain alias defined." %}</div>
{% else %}
@@ -32,5 +22,4 @@
{% endfor %}
</table>
{% endif %}
</div>
{% endblock %}
+1 -1
View File
@@ -6,7 +6,7 @@
{% block content %}
<div class="title"><h1>{% trans "Mailbox" %} {{ mbox.name }}</h1></div>
{% if error %}<div class="error">{{ error }}</div>{% endif %}
{% url admin.views.editmailbox mbox.domain_id mbox.id as box_url %}
{% url admin.views.editmailbox mbox.id as box_url %}
<form action="{{ box_url }}" method="POST" id="mboxform" name="mboxform">
{% include "common/genericform.html" %}
<div class="spacer"></div>
@@ -4,9 +4,9 @@
{% endblock %}
{% block content %}
{% load i18n %}
<div class="title"><h1>Alias {{ alias.address }}</h1></div>
<div class="title"><h1>Mailbox alias {{ alias.address }}</h1></div>
{% if error %}<div class="error">{{ error }}</div>{% endif %}
{% url admin.views.editalias domain alias.id as edit_url %}
{% url admin.views.editmbalias alias.id as edit_url %}
<form action="{{ edit_url }}" method="POST" id="aliasform" name="aliasform">
{% include "common/genericform.html" %}
<div class="spacer"></div>
+6 -10
View File
@@ -1,13 +1,9 @@
{% extends "admin/domain_header.html" %}
{% load i18n %}
{% block menu %}
{% load admin_extras %}
{% domain_menu domain.id "mailboxes" user %}
{% endblock %}
{% block domcontent %}
{% load i18n %}
{% extends "admin/domains_header.html" %}
{% load i18n admin_extras %}
{% block pagetitle %}{% trans "Available mailboxes" %}{% endblock %}
{% block subcontent %}
{% if not mailboxes %}
<p>{% trans "No mailbox defined." %}</p>
<div class="info">{% trans "No mailbox defined." %}</div>
{% else %}
<table>
<tr>
@@ -19,7 +15,7 @@
</tr>
{% for mb in mailboxes %}
<tr class="{% cycle 'odd' 'even' %}">
<td>{% mailbox_actions user domain.id mb.id %}</td>
<td>{% mailbox_actions user mb %}</td>
<td>{{ mb.name }}</td>
<td>{{ mb.address }}@{{ mb.domain.name }}</td>
<td>{{ mb.quota }} {% trans "MB" %}</td>
+29
View File
@@ -0,0 +1,29 @@
{% extends "admin/domains_header.html" %}
{% load i18n admin_extras %}
{% block pagetitle %}{% trans "Mailbox aliases" %}{% endblock %}
{% block subcontent %}
{% if not aliases %}
<div class="info">{% trans "No mailbox alias defined." %}</div>
{% else %}
<table>
<tr>
<th width="50px">{% trans "Actions" %}</th>
<th width="150px">{% trans "Address" %}</th>
<th width="200px">{% trans "Mailbox" %}</th>
<th width="75px">{% trans "Enabled" %}</th>
</tr>
{% for alias in aliases %}
<tr>
<td>{% mbalias_actions user alias %}
<td>{{ alias.full_address }}</td>
<td>
{% for mb in alias.mboxes.all %}
{{ mb.full_address }}<br/>
{% endfor %}
</td>
<td>{{ alias.enabled|yesno }}</td
</tr>
{% endfor %}
</table>
{% endif %}
{% endblock %}
+1 -1
View File
@@ -7,7 +7,7 @@
<div class="title"><h1>{% trans "New mailbox" %}</h1></div>
{% if error %}<div class="error">{{ error }}</div>{% endif %}
{% url admin.views.newmailbox domain.id as box_url %}
{% url admin.views.newmailbox as box_url %}
<form action="{{ box_url }}" method="POST" id="mboxform" name="mboxform">
{% include "common/genericform.html" %}
<div class="spacer"></div>
@@ -4,9 +4,9 @@
<script src="{{ MEDIA_URL }}js/form.js" type="text/javascript"></script>
{% endblock %}
{% block content %}
<div class="title"><h1>{% trans "New alias" %}</h1></div>
<div class="title"><h1>{% trans "New mailbox alias" %}</h1></div>
{% if error %}<div class="error">{{ error }}</div>{% endif %}
{% url admin.views.newalias domain as box_url %}
{% url admin.views.newmbalias as box_url %}
<form action="{{ box_url }}" method="POST" id="aliasform" name="aliasform">
{% include "common/genericform.html" %}
<div class="spacer"></div>