mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-12-04 12:24:09 +01:00
wip: UI refactoring
* Displaying more information when editing a domain (adminstrators, dates) * Various fixes see #204
This commit is contained in:
@@ -2,3 +2,25 @@
|
||||
text-align: center;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
span.title {
|
||||
margin-left: 40px;
|
||||
margin-bottom: 10px;
|
||||
float: left;
|
||||
font-weight: bold;
|
||||
width: 180px;
|
||||
}
|
||||
|
||||
table#domadmins th#actions {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
table#domadmins td[name="actions"] {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.search {
|
||||
width: 85%;
|
||||
-webkit-border-radius:14px;-moz-border-radius:14px;border-radius:14px;
|
||||
padding-left: 14px;
|
||||
}
|
||||
@@ -7,6 +7,18 @@ function domainform_cb() {
|
||||
error_cb: domainform_cb
|
||||
});
|
||||
});
|
||||
$("a[name=removeperm]").click(function(e) {
|
||||
var $tr = $(this).parent().parent();
|
||||
simple_ajax_request.apply(this, [e, {
|
||||
ok_cb: function(resp) {
|
||||
$tr.remove();
|
||||
if (!$("#domadmins").children("tr").length) {
|
||||
$("#admins").html('<div class="alert alert-info">'
|
||||
+ gettext("No domain administrator defined") + "</div>");
|
||||
}
|
||||
}
|
||||
}]);
|
||||
});
|
||||
}
|
||||
|
||||
function accountform_init() {
|
||||
|
||||
+9
-3
@@ -186,15 +186,21 @@ function get_target(e, tag) {
|
||||
/*
|
||||
* Send a simple AJAX request.
|
||||
*/
|
||||
function simple_ajax_request(e) {
|
||||
function simple_ajax_request(e, uoptions) {
|
||||
var $this = $(this);
|
||||
e.preventDefault();
|
||||
var defaults = {};
|
||||
var options = $.extend({}, defaults, uoptions);
|
||||
|
||||
if (e != undefined) e.preventDefault();
|
||||
$.ajax({
|
||||
url: $this.attr("href"),
|
||||
dataType: 'json',
|
||||
success: function(data) {
|
||||
if (data.status == "ok") {
|
||||
$("body").notify("success", data.respmsg, 2000);
|
||||
if (options.ok_cb) options.ok_cb(data);
|
||||
if (options.respmsg) {
|
||||
$("body").notify("success", data.respmsg, 2000);
|
||||
}
|
||||
} else {
|
||||
$("body").notify("error", data.respmsg);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user