wip: UI refactoring

* Displaying more information when editing a domain (adminstrators, dates)
* Various fixes

see #204
This commit is contained in:
Antoine Nguyen
2012-04-24 21:03:53 +02:00
parent 370c6cb086
commit 3ee42b141a
10 changed files with 131 additions and 21 deletions
+22
View File
@@ -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;
}
+12
View File
@@ -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
View File
@@ -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);
}