mirror of
https://github.com/janeczku/calibre-web
synced 2025-10-27 21:37:40 +00:00
Add UI support for archived books.
Archived books will no longer appear in any book lists or searches, and may only be restored from the Archive view.
This commit is contained in:
@@ -216,6 +216,8 @@ if ( $( 'body.book' ).length > 0 ) {
|
||||
.prependTo( '[aria-label^="Download, send"]' );
|
||||
$( '#have_read_cb' )
|
||||
.after( '<label class="block-label readLbl" for="#have_read_cb"></label>' );
|
||||
$( '#archived_cb' )
|
||||
.after( '<label class="block-label readLbl" for="#archived_cb"></label>' );
|
||||
$( '#shelf-actions' ).prependTo( '[aria-label^="Download, send"]' );
|
||||
|
||||
|
||||
@@ -586,6 +588,20 @@ $( '#have_read_cb:checked' ).attr({
|
||||
'data-viewport': '.btn-toolbar' })
|
||||
.addClass('readunread-btn-tooltip');
|
||||
|
||||
$( '#archived_cb' ).attr({
|
||||
'data-toggle': 'tooltip',
|
||||
'title': $( '#archived_cb').attr('data-unchecked'),
|
||||
'data-placement': 'bottom',
|
||||
'data-viewport': '.btn-toolbar' })
|
||||
.addClass('readunread-btn-tooltip');
|
||||
|
||||
$( '#archived_cb:checked' ).attr({
|
||||
'data-toggle': 'tooltip',
|
||||
'title': $( '#archived_cb').attr('data-checked'),
|
||||
'data-placement': 'bottom',
|
||||
'data-viewport': '.btn-toolbar' })
|
||||
.addClass('readunread-btn-tooltip');
|
||||
|
||||
$( 'button#delete' ).attr({
|
||||
'data-toggle-two': 'tooltip',
|
||||
'title': $( 'button#delete' ).text(), //'Delete'
|
||||
@@ -601,6 +617,14 @@ $( '#have_read_cb' ).click(function() {
|
||||
}
|
||||
});
|
||||
|
||||
$( '#archived_cb' ).click(function() {
|
||||
if ( $( '#archived_cb:checked' ).length > 0 ) {
|
||||
$( this ).attr('data-original-title', $('#archived_cb').attr('data-checked'));
|
||||
} else {
|
||||
$( this).attr('data-original-title', $('#archived_cb').attr('data-unchecked'));
|
||||
}
|
||||
});
|
||||
|
||||
$( '.btn-group[aria-label="Edit/Delete book"] a' ).attr({
|
||||
'data-toggle': 'tooltip',
|
||||
'title': $( '#edit_book' ).text(), // 'Edit'
|
||||
|
||||
@@ -25,6 +25,14 @@ $("#have_read_cb").on("change", function() {
|
||||
$(this).closest("form").submit();
|
||||
});
|
||||
|
||||
$(function() {
|
||||
$("#archived_form").ajaxForm();
|
||||
});
|
||||
|
||||
$("#archived_cb").on("change", function() {
|
||||
$(this).closest("form").submit();
|
||||
});
|
||||
|
||||
(function() {
|
||||
var templates = {
|
||||
add: _.template(
|
||||
|
||||
Reference in New Issue
Block a user