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
This commit is contained in:
parent
146ee8c26f
commit
46fd7a42c1
4 changed files with 53 additions and 17 deletions
|
@ -357,4 +357,7 @@ table.dataTable tr.odd td.sorting_1 {
|
|||
|
||||
table.dataTable thead th {
|
||||
border-color: #aaa !important;
|
||||
}
|
||||
}
|
||||
|
||||
.userPropertiesContainer {border-color:#ddd;}
|
||||
.userPrefs {border-color:#ddd;}
|
||||
|
|
|
@ -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&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">✔ 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">✔ 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('✔ 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}
|
||||
|
||||
|
|
|
@ -1144,4 +1144,13 @@ a.group_perm {
|
|||
font-size:16px;
|
||||
margin-left:-8px;
|
||||
cursor:pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.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;}
|
||||
|
||||
|
|
|
@ -333,4 +333,7 @@ table.dataTable tr.odd td.sorting_1 {
|
|||
|
||||
table.dataTable thead th {
|
||||
border-color: #333 !important;
|
||||
}
|
||||
}
|
||||
|
||||
.userPropertiesContainer {border-color:#333;}
|
||||
.userPrefs {border-color:#333;}
|
||||
|
|
Loading…
Add table
Reference in a new issue