1
0
mirror of https://github.com/janeczku/calibre-web synced 2025-10-21 18:47:39 +00:00

Read and archive bit visible in book table

This commit is contained in:
Ozzie Isaacs
2021-10-24 21:22:08 +02:00
parent 516e76de4f
commit f6a2b8a9ef
7 changed files with 124 additions and 44 deletions

View File

@@ -631,14 +631,21 @@ function singleUserFormatter(value, row) {
}
function checkboxFormatter(value, row){
if(value & this.column)
if (value & this.column)
return '<input type="checkbox" class="chk" data-pk="' + row.id + '" data-name="' + this.field + '" checked onchange="checkboxChange(this, ' + row.id + ', \'' + this.name + '\', ' + this.column + ')">';
else
return '<input type="checkbox" class="chk" data-pk="' + row.id + '" data-name="' + this.field + '" onchange="checkboxChange(this, ' + row.id + ', \'' + this.name + '\', ' + this.column + ')">';
}
function bookCheckboxFormatter(value, row){
if (value)
return '<input type="checkbox" class="chk" data-pk="' + row.id + '" data-name="' + this.field + '" checked onchange="BookCheckboxChange(this, ' + row.id + ', \'' + this.name + '\')">';
else
return '<input type="checkbox" class="chk" data-pk="' + row.id + '" data-name="' + this.field + '" onchange="BookCheckboxChange(this, ' + row.id + ', \'' + this.name + '\')">';
}
function singlecheckboxFormatter(value, row){
if(value)
if (value)
return '<input type="checkbox" class="chk" data-pk="' + row.id + '" data-name="' + this.field + '" checked onchange="checkboxChange(this, ' + row.id + ', \'' + this.name + '\', 0)">';
else
return '<input type="checkbox" class="chk" data-pk="' + row.id + '" data-name="' + this.field + '" onchange="checkboxChange(this, ' + row.id + ', \'' + this.name + '\', 0)">';
@@ -790,7 +797,7 @@ function handleListServerResponse (data) {
function checkboxChange(checkbox, userId, field, field_index) {
$.ajax({
method: "post",
url: window.location.pathname + "/../../ajax/editlistusers/" + field,
url: getPath() + "/ajax/editlistusers/" + field,
data: {"pk": userId, "field_index": field_index, "value": checkbox.checked},
error: function(data) {
handleListServerResponse([{type:"danger", message:data.responseText}])
@@ -799,6 +806,19 @@ function checkboxChange(checkbox, userId, field, field_index) {
});
}
function BookCheckboxChange(checkbox, userId, field) {
$.ajax({
method: "post",
url: getPath() + "/ajax/editbooks/" + field,
data: {"pk": userId, "value": checkbox.checked},
error: function(data) {
handleListServerResponse([{type:"danger", message:data.responseText}])
},
success: handleListServerResponse
});
}
function selectHeader(element, field) {
if (element.value !== "None") {
confirmDialog(element.id, "GeneralChangeModal", 0, function () {