1
0
mirror of https://github.com/janeczku/calibre-web synced 2025-10-20 18:17:40 +00:00

Merge branch 'master' into Develop

# Conflicts:
#	cps/admin.py
#	cps/converter.py
#	cps/subproc_wrapper.py
#	test/Calibre-Web TestSummary_Linux.html
This commit is contained in:
Ozzie Isaacs
2021-07-30 16:33:06 +02:00
38 changed files with 701 additions and 493 deletions

View File

@@ -662,33 +662,34 @@ function move_header_elements() {
}
});
$(".multi_selector").selectpicker();
if (! $._data($(".multi_head").get(0), "events") ) {
// Functions have to be here, otherwise the callbacks are not fired if visible columns are changed
$(".multi_head").on("click", function () {
var val = $(this).data("set");
var field = $(this).data("name");
var result = $('#user-table').bootstrapTable('getSelections').map(a => a.id);
var values = $("#" + field).val();
confirmDialog(
"restrictions",
"GeneralChangeModal",
0,
function () {
$.ajax({
method: "post",
url: window.location.pathname + "/../../ajax/editlistusers/" + field,
data: {"pk": result, "value": values, "action": val},
success: function (data) {
handleListServerResponse(data);
},
error: function (data) {
handleListServerResponse([{type: "danger", message: data.responseText}])
},
});
}
);
});
if ($(".multi_head").length) {
if (!$._data($(".multi_head").get(0), "events")) {
// Functions have to be here, otherwise the callbacks are not fired if visible columns are changed
$(".multi_head").on("click", function () {
var val = $(this).data("set");
var field = $(this).data("name");
var result = $('#user-table').bootstrapTable('getSelections').map(a => a.id);
var values = $("#" + field).val();
confirmDialog(
"restrictions",
"GeneralChangeModal",
0,
function () {
$.ajax({
method: "post",
url: window.location.pathname + "/../../ajax/editlistusers/" + field,
data: {"pk": result, "value": values, "action": val},
success: function (data) {
handleListServerResponse(data);
},
error: function (data) {
handleListServerResponse([{type: "danger", message: data.responseText}])
},
});
}
);
});
}
}
$("#user_delete_selection").click(function () {
@@ -700,38 +701,41 @@ function move_header_elements() {
$("#select_default_language").on("change", function () {
selectHeader(this, "default_language");
});
if (! $._data($(".check_head").get(0), "events") ) {
$(".check_head").on("change", function () {
var val = $(this).data("set");
var name = $(this).data("name");
var data = $(this).data("val");
checkboxHeader(val, name, data);
});
if ($(".check_head").length) {
if (!$._data($(".check_head").get(0), "events")) {
$(".check_head").on("change", function () {
var val = $(this).data("set");
var name = $(this).data("name");
var data = $(this).data("val");
checkboxHeader(val, name, data);
});
}
}
if (! $._data($(".button_head").get(0), "events") ) {
$(".button_head").on("click", function () {
var result = $('#user-table').bootstrapTable('getSelections').map(a => a.id);
confirmDialog(
"btndeluser",
"GeneralDeleteModal",
0,
function () {
$.ajax({
method: "post",
url: window.location.pathname + "/../../ajax/deleteuser",
data: {"userid": result},
success: function (data) {
selections = selections.filter((el) => !result.includes(el));
handleListServerResponse(data);
},
error: function (data) {
handleListServerResponse([{type: "danger", message: data.responseText}])
},
});
}
);
});
if ($(".button_head").length) {
if (!$._data($(".button_head").get(0), "events")) {
$(".button_head").on("click", function () {
var result = $('#user-table').bootstrapTable('getSelections').map(a => a.id);
confirmDialog(
"btndeluser",
"GeneralDeleteModal",
0,
function () {
$.ajax({
method: "post",
url: window.location.pathname + "/../../ajax/deleteuser",
data: {"userid": result},
success: function (data) {
selections = selections.filter((el) => !result.includes(el));
handleListServerResponse(data);
},
error: function (data) {
handleListServerResponse([{type: "danger", message: data.responseText}])
},
});
}
);
});
}
}
}