aboutsummaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2013-11-13 19:43:49 +0000
committerplegall <plg@piwigo.org>2013-11-13 19:43:49 +0000
commit46fd7a42c16b6aa4f0c6ee138c1708f6dc21cb6e (patch)
tree3a8aecb6df6af20af6ed02a076cdd02a04137ab2 /admin
parent146ee8c26f6e18d720e4d38e4c6dbdb883156e81 (diff)
feature 1668: delete single user, better colors for admin dark theme.
git-svn-id: http://piwigo.org/svn/trunk@25479 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--admin/themes/clear/theme.css5
-rw-r--r--admin/themes/default/template/user_list.tpl49
-rw-r--r--admin/themes/default/theme.css11
-rw-r--r--admin/themes/roma/theme.css5
4 files changed, 53 insertions, 17 deletions
diff --git a/admin/themes/clear/theme.css b/admin/themes/clear/theme.css
index 6592c6a03..9ffcf8968 100644
--- a/admin/themes/clear/theme.css
+++ b/admin/themes/clear/theme.css
@@ -357,4 +357,7 @@ table.dataTable tr.odd td.sorting_1 {
table.dataTable thead th {
border-color: #aaa !important;
-} \ No newline at end of file
+}
+
+.userPropertiesContainer {border-color:#ddd;}
+.userPrefs {border-color:#ddd;}
diff --git a/admin/themes/default/template/user_list.tpl b/admin/themes/default/template/user_list.tpl
index 5b7f3cb0e..5ef4bbcd0 100644
--- a/admin/themes/default/template/user_list.tpl
+++ b/admin/themes/default/template/user_list.tpl
@@ -112,10 +112,10 @@ jQuery(document).ready(function() {
var userDetails = '<form>';
userDetails += '<div class="userActions">';
userDetails += '<a class="icon-key" href="#">Change password</a>';
- userDetails += '<br><a href="#" class="icon-lock">Permissions</a>';
- userDetails += '<br><a href="#" class="icon-trash">Delete</a>';
+ userDetails += '<br><a target="_blank" href="admin.php?page=user_perm&amp;user_id='+userId+'" class="icon-lock">Permissions</a>';
+ userDetails += '<br><span class="userDelete"><img class="loading" src="themes/default/images/ajax-loader-small.gif" style="display:none;"><a href="#" class="icon-trash" data-user_id="'+userId+'">Delete</a></span>';
userDetails += '</div>';
- userDetails += '<strong>'+user.username+'</strong> <span class="icon-pencil"></span>';
+ userDetails += '<strong class="username">'+user.username+'</strong> <span class="icon-pencil"></span>';
userDetails += '<br><br>';
userDetails += sprintf(registeredOn_pattern, user.registration_date_string, user.registration_date_since);
@@ -226,8 +226,8 @@ jQuery(document).ready(function() {
userDetails += '</div>';
userDetails += '<div style="clear:both"></div></div>';
- userDetails += '<span class="infos" style="display:none">&#x2714; User updated</span>';
- userDetails += '<input type="submit" value="{/literal}{'Save Settings'|translate}{literal}" style="display:none;" data-user_id="'+userId+'">';
+ userDetails += '<span class="infos" style="display:none">&#x2714; User '+user.username+' updated</span>';
+ userDetails += '<input type="submit" value="{/literal}{'Update user'|translate}{literal}" style="display:none;" data-user_id="'+userId+'">';
userDetails += '<img class="submitWait" src="themes/default/images/ajax-loader-small.gif" style="display:none">'
userDetails += '</form>';
@@ -253,6 +253,36 @@ jQuery(document).ready(function() {
jQuery('#user'+userId+' .infos').hide();
});
+ jQuery(document).on('click', '.userDelete a', function() {
+ if (!confirm("{/literal}{'Are you sure?'|translate|escape:javascript}{literal}")) {
+ return false;
+ }
+
+ var userId = jQuery(this).data('user_id');
+ var username = jQuery('#user'+userId+' .username').html();
+
+ jQuery.ajax({
+ url: "ws.php?format=json&method=pwg.users.delete",
+ type:"POST",
+ data: {
+ user_id:userId,
+ pwg_token:pwg_token
+ },
+ beforeSend: function() {
+ jQuery('#user'+userId+' .userDelete .loading').show();
+ },
+ success:function(data) {
+ oTable.fnDraw();
+ jQuery('#showAddUser .infos').html('&#x2714; User '+username+' deleted').show();
+ },
+ error:function(XMLHttpRequest, textStatus, errorThrows) {
+ jQuery('#user'+userId+' .userDelete .loading').hide();
+ }
+ });
+
+ return false;
+ });
+
jQuery(document).on('click', '.userProperties input[type=submit]', function() {
var userId = jQuery(this).data('user_id');
@@ -593,15 +623,6 @@ table.dataTable {clear:right;padding-top:10px;}
#addUserForm p {margin-left:0;}
#applyActionBlock .actionButtons {margin-left:0;}
span.infos, span.errors {background-image:none; padding:2px 5px; margin:0;border-radius:5px;}
-
-.userProperties {max-width:730px;}
-.userPropertiesContainer {border-top:1px solid #ddd;margin-top:1em;}
-.userPropertiesSet {width:350px;float:left;padding-top:5px}
-.userPropertiesSetTitle {font-weight:bold;margin-bottom:1em;}
-.userPrefs {border-left:1px solid #ddd;padding-left:10px;}
-.userProperty {width:220px;float:left;margin-bottom:15px;}
-
-.userActions {float:right;text-align:right;}
</style>
{/literal}
diff --git a/admin/themes/default/theme.css b/admin/themes/default/theme.css
index 1f7ad9bda..07b1f1ee7 100644
--- a/admin/themes/default/theme.css
+++ b/admin/themes/default/theme.css
@@ -1144,4 +1144,13 @@ a.group_perm {
font-size:16px;
margin-left:-8px;
cursor:pointer;
-} \ No newline at end of file
+}
+
+.userProperties {max-width:730px;}
+.userPropertiesContainer {border-top:1px solid #ddd;margin-top:1em;}
+.userPropertiesSet {width:350px;float:left;padding-top:5px}
+.userPropertiesSetTitle {font-weight:bold;margin-bottom:1em;}
+.userPrefs {border-left:1px solid #ddd;padding-left:10px;}
+.userProperty {width:220px;float:left;margin-bottom:15px;}
+.userActions {float:right;text-align:right;}
+
diff --git a/admin/themes/roma/theme.css b/admin/themes/roma/theme.css
index 5c5473f03..3aa84f79d 100644
--- a/admin/themes/roma/theme.css
+++ b/admin/themes/roma/theme.css
@@ -333,4 +333,7 @@ table.dataTable tr.odd td.sorting_1 {
table.dataTable thead th {
border-color: #333 !important;
-} \ No newline at end of file
+}
+
+.userPropertiesContainer {border-color:#333;}
+.userPrefs {border-color:#333;}