- moved the configuration interface elements (logs, users, webadmins) to tabs; this makes useability a tiny bit better
- "enabled" in the user config is now a checkbox that can be toggled in order to activate or deactivate the user
This commit is contained in:
+32
-1
@@ -17,6 +17,10 @@ $(function () {
|
||||
alert('Error: ' + textStatus);
|
||||
}
|
||||
|
||||
function checkFormatter(value, row, index) {
|
||||
return '<input type="checkbox" '+(parseInt(value)===1?'checked':'')+' />';
|
||||
}
|
||||
|
||||
// ------------------------- USERS definitions -------------------------
|
||||
var $userTable = $('#table-users');
|
||||
var $modalUserAdd = $('#modal-user-add');
|
||||
@@ -53,6 +57,23 @@ $(function () {
|
||||
});
|
||||
}
|
||||
|
||||
function genericSetField(field, new_value, pk) {
|
||||
$.ajax({
|
||||
url: gridsUrl,
|
||||
data: {
|
||||
set_user: true,
|
||||
name: field,
|
||||
value: new_value,
|
||||
pk : pk
|
||||
},
|
||||
method: 'POST',
|
||||
success: function() {
|
||||
refreshTable($userTable);
|
||||
},
|
||||
error: onAjaxError
|
||||
});
|
||||
}
|
||||
|
||||
var userEditable = {
|
||||
url: gridsUrl,
|
||||
params: function (params) {
|
||||
@@ -131,6 +152,7 @@ $(function () {
|
||||
$userTable.bootstrapTable({
|
||||
url: gridsUrl,
|
||||
sortable: false,
|
||||
checkboxHeader: false,
|
||||
queryParams: function (params) {
|
||||
params.select = 'user';
|
||||
return params;
|
||||
@@ -143,7 +165,16 @@ $(function () {
|
||||
{ title: "Mail", field: "user_mail", editable: userEditable },
|
||||
{ title: "Phone", field: "user_phone", editable: userEditable },
|
||||
{ title: "Online", field: "user_online" },
|
||||
{ title: "Enabled", field: "user_enable" },
|
||||
{
|
||||
title: "Enabled",
|
||||
field: "user_enable",
|
||||
formatter : checkFormatter,
|
||||
events: {
|
||||
'click input': function (e, value, row) {
|
||||
genericSetField('user_enable', $(this).is(':checked') ? '1' : '0', row.user_id);
|
||||
}
|
||||
}
|
||||
},
|
||||
{ title: "Start Date", field: "user_start_date", editable: userDateEditable },
|
||||
{ title: "End Date", field: "user_end_date", editable: userDateEditable },
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user