mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-17 05:41:25 +02:00
@@ -40,10 +40,10 @@
|
||||
<tr>
|
||||
<th>{% trans "Phone number" %}</th><td>{{ object.phone_number|default:_("Not defined") }}</td>
|
||||
</tr>
|
||||
{% if user.mailbox %}
|
||||
{% if object.mailbox %}
|
||||
<tr>
|
||||
<th>{% trans "Quota" %}</th>
|
||||
<td>{% include "common/progressbar.html" with id='quotabar' value=user.mailbox.get_quota_in_percent %}</td>
|
||||
<td>{% include "common/progressbar.html" with id='quotabar' value=object.mailbox.get_quota_in_percent %}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</table>
|
||||
@@ -69,13 +69,13 @@
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
{% if user.mailbox %}
|
||||
{% if object.mailbox %}
|
||||
<div class="panel panel-info">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">{% trans "Aliases" %}</h3>
|
||||
</div>
|
||||
<table class="table">
|
||||
{% for alias in user.mailbox.alias_addresses %}
|
||||
{% for alias in object.mailbox.alias_addresses %}
|
||||
<tr><td>{{ alias }}</td></tr>
|
||||
{% empty %}
|
||||
<tr><td>{% trans "No alias defined" %}</td></tr>
|
||||
|
||||
@@ -23,4 +23,16 @@ $(document).ready(function() {
|
||||
{% extra_static_content "identities" "js" user %}
|
||||
{% endblock %}
|
||||
|
||||
{% block toolbar_right %}
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<span class="fa fa-plus"></span> {% trans "Add" %} <span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a data-toggle="ajaxmodal" modalcb="admin.newaccount_cb" href="{% url 'admin:account_add' %}"><span class="fa fa-user"></span> {% trans "Account" %}</a></li>
|
||||
<li><a data-toggle="ajaxmodal" modalcb="admin.aliasform_cb" href="{% url 'admin:alias_add' %}">{% trans "Alias" %}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block actions %}{% identities_menu user "identities" %}{% endblock %}
|
||||
|
||||
@@ -30,7 +30,10 @@ var admin;
|
||||
<div class="col-sm-5">
|
||||
{% include "admin/searchform.html" %}
|
||||
</div>
|
||||
<div id="taglist" class="col-sm-5"> </div>
|
||||
<div class="col-sm-3">
|
||||
{% block toolbar_right %}{% endblock %}
|
||||
</div>
|
||||
<div id="taglist" class="col-sm-4"> </div>
|
||||
</div>
|
||||
|
||||
<div id="listing">
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
"""
|
||||
Admin extension tags.
|
||||
"""
|
||||
"""Admin extension tags."""
|
||||
|
||||
from django import template
|
||||
from django.core.urlresolvers import reverse
|
||||
@@ -107,30 +105,6 @@ def identities_menu(user, selection=None, ajax_mode=True):
|
||||
"img": "fa fa-hdd-o",
|
||||
"class": nav_classes,
|
||||
"url": quota_list_url},
|
||||
{"name": "newaccount",
|
||||
"label": _("Add account"),
|
||||
"img": "fa fa-plus",
|
||||
"modal": True,
|
||||
"modalcb": "admin.newaccount_cb",
|
||||
"url": reverse("admin:account_add")},
|
||||
{"name": "newalias",
|
||||
"label": _("Add alias"),
|
||||
"img": "fa fa-plus",
|
||||
"modal": True,
|
||||
"modalcb": "admin.aliasform_cb",
|
||||
"url": reverse("admin:alias_add")},
|
||||
{"name": "newforward",
|
||||
"label": _("Add forward"),
|
||||
"img": "fa fa-plus",
|
||||
"modal": True,
|
||||
"modalcb": "admin.aliasform_cb",
|
||||
"url": reverse("admin:forward_add")},
|
||||
{"name": "newdlist",
|
||||
"label": _("Add distribution list"),
|
||||
"img": "fa fa-plus",
|
||||
"modal": True,
|
||||
"modalcb": "admin.aliasform_cb",
|
||||
"url": reverse("admin:dlist_add")},
|
||||
{"name": "import",
|
||||
"label": _("Import"),
|
||||
"img": "fa fa-folder-open",
|
||||
@@ -142,8 +116,7 @@ def identities_menu(user, selection=None, ajax_mode=True):
|
||||
"img": "fa fa-share-alt",
|
||||
"url": reverse("admin:identity_export"),
|
||||
"modal": True,
|
||||
"modalcb": "admin.exportform_cb"
|
||||
}
|
||||
"modalcb": "admin.exportform_cb"}
|
||||
]
|
||||
|
||||
return render_to_string('common/menulist.html', {
|
||||
|
||||
@@ -48,9 +48,6 @@ urlpatterns += patterns(
|
||||
urlpatterns += patterns(
|
||||
'modoboa.admin.views.alias',
|
||||
|
||||
url(r'^distriblists/new/$', 'newdlist', name="dlist_add"),
|
||||
url(r'^forwards/new/$', 'newforward', name="forward_add"),
|
||||
|
||||
url(r'^aliases/new/$', 'newalias', name="alias_add"),
|
||||
url(r'^aliases/(?P<pk>\d+)/$', views.AliasDetailView.as_view(),
|
||||
name="alias_detail"),
|
||||
|
||||
@@ -62,17 +62,6 @@ def _new_alias(request, title, action, successmsg,
|
||||
return render(request, tplname, ctx)
|
||||
|
||||
|
||||
@login_required
|
||||
@permission_required("admin.add_alias")
|
||||
@reversion.create_revision()
|
||||
def newdlist(request):
|
||||
return _new_alias(
|
||||
request, _("New distribution list"),
|
||||
reverse("admin:dlist_add"),
|
||||
_("Distribution list created")
|
||||
)
|
||||
|
||||
|
||||
@login_required
|
||||
@permission_required("admin.add_alias")
|
||||
@reversion.create_revision()
|
||||
@@ -83,16 +72,6 @@ def newalias(request):
|
||||
)
|
||||
|
||||
|
||||
@login_required
|
||||
@permission_required("admin.add_alias")
|
||||
@reversion.create_revision()
|
||||
def newforward(request):
|
||||
return _new_alias(
|
||||
request, _("New forward"), reverse("admin:forward_add"),
|
||||
_("Forward created")
|
||||
)
|
||||
|
||||
|
||||
@login_required
|
||||
@permission_required("admin.change_alias")
|
||||
@reversion.create_revision()
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
* Global javascript utilities
|
||||
*/
|
||||
|
||||
/* global $ */
|
||||
|
||||
var static_url = "";
|
||||
|
||||
/*
|
||||
@@ -180,7 +182,7 @@ function simple_ajax_form_post(e, options) {
|
||||
return;
|
||||
}
|
||||
if (opts.reload_on_success) {
|
||||
if (opts.reload_mode == 'full') {
|
||||
if (opts.reload_mode === 'full') {
|
||||
window.location.reload();
|
||||
} else {
|
||||
histomanager.update(true);
|
||||
@@ -230,13 +232,13 @@ function gethref(obj) {
|
||||
* http://stackoverflow.com/questions/901115/get-query-string-values-in-javascript
|
||||
*/
|
||||
function parse_qs(raw) {
|
||||
if (raw === "") return {};
|
||||
if (raw === "") { return {}; }
|
||||
var res = {};
|
||||
|
||||
for (var i = 0; i < raw.length; i++) {
|
||||
var p = raw[i].split('=');
|
||||
|
||||
if (p.length != 2) continue;
|
||||
if (p.length !== 2) { continue; }
|
||||
res[p[0]] = decodeURIComponent(p[1].replace(/\+/g, " "));
|
||||
}
|
||||
return res;
|
||||
@@ -289,12 +291,12 @@ function simple_ajax_request(e, uoptions) {
|
||||
var defaults = {};
|
||||
var options = $.extend({}, defaults, uoptions);
|
||||
|
||||
if (e !== undefined) e.preventDefault();
|
||||
if (e !== undefined) { e.preventDefault(); }
|
||||
$.ajax({
|
||||
url: $this.attr("href"),
|
||||
dataType: 'json'
|
||||
}).done(function(data) {
|
||||
if (options.ok_cb) options.ok_cb(data);
|
||||
if (options.ok_cb) { options.ok_cb(data); }
|
||||
if (data) {
|
||||
$("body").notify("success", data, 2000);
|
||||
}
|
||||
@@ -306,7 +308,7 @@ function simple_ajax_request(e, uoptions) {
|
||||
* the status code received with a response is equal to 278.
|
||||
*/
|
||||
function ajax_login_redirect(xhr) {
|
||||
if (xhr.status != 278) {
|
||||
if (xhr.status !== 278) {
|
||||
return;
|
||||
}
|
||||
var params = "?next=" + window.location.pathname;
|
||||
@@ -359,5 +361,5 @@ $(document).ready(function() {
|
||||
$(document).on('click', 'a[data-toggle="ajaxmodal"]', modalbox);
|
||||
$(document).on('click', 'a[data-toggle="ajaxmodal-autowidth"]', modalbox_autowidth);
|
||||
$(document).on('click', '.activator', activate_widget);
|
||||
$(".help").popover({trigger: 'hover'}).click(function(e) {e.preventDefault();});
|
||||
$(".help").popover({trigger: 'hover'}).click(function(e) { e.preventDefault(); });
|
||||
});
|
||||
|
||||
@@ -254,10 +254,10 @@ History.prototype = {
|
||||
check: function() {
|
||||
var rawhash = this.get_raw_hash();
|
||||
|
||||
if (this.serialized == rawhash && this.force === undefined) {
|
||||
if (this.serialized === rawhash && this.force === undefined) {
|
||||
return;
|
||||
}
|
||||
delete(this.force);
|
||||
delete this.force;
|
||||
this.from_string(rawhash);
|
||||
|
||||
if (!this.serialized) {
|
||||
|
||||
Reference in New Issue
Block a user