From 1d83a6a898861e12115540dee5c2a5120571d2de Mon Sep 17 00:00:00 2001 From: cbartondock Date: Fri, 16 Oct 2020 11:51:59 -0400 Subject: [PATCH 1/3] distinguish convert from and convert to extensions --- cps/constants.py | 3 ++- cps/editbooks.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cps/constants.py b/cps/constants.py index 89810e90..c1bcbe59 100644 --- a/cps/constants.py +++ b/cps/constants.py @@ -113,7 +113,8 @@ del env_CALIBRE_PORT EXTENSIONS_AUDIO = {'mp3', 'mp4', 'ogg', 'opus', 'wav', 'flac', 'm4a', 'm4b'} -EXTENSIONS_CONVERT = ['pdf', 'epub', 'mobi', 'azw3', 'docx', 'rtf', 'fb2', 'lit', 'lrf', 'txt', 'htmlz', 'rtf', 'odt'] +EXTENSIONS_CONVERT_FROM = ['pdf', 'epub', 'mobi', 'azw3', 'docx', 'rtf', 'fb2', 'lit', 'lrf', 'txt', 'htmlz', 'rtf', 'odt','cbz','cbr'] +EXTENSIONS_CONVERT_TO = ['pdf', 'epub', 'mobi', 'azw3', 'docx', 'rtf', 'fb2', 'lit', 'lrf', 'txt', 'htmlz', 'rtf', 'odt'] EXTENSIONS_UPLOAD = {'txt', 'pdf', 'epub', 'kepub', 'mobi', 'azw', 'azw3', 'cbr', 'cbz', 'cbt', 'djvu', 'prc', 'doc', 'docx', 'fb2', 'html', 'rtf', 'lit', 'odt', 'mp3', 'mp4', 'ogg', 'opus', 'wav', 'flac', 'm4a', 'm4b'} diff --git a/cps/editbooks.py b/cps/editbooks.py index 7f7764e5..be9adc55 100644 --- a/cps/editbooks.py +++ b/cps/editbooks.py @@ -308,7 +308,7 @@ def render_edit_book(book_id): kepub_possible=None if config.config_converterpath: for file in book.data: - if file.format.lower() in constants.EXTENSIONS_CONVERT: + if file.format.lower() in constants.EXTENSIONS_CONVERT_FROM: valid_source_formats.append(file.format.lower()) if config.config_kepubifypath and 'epub' in [file.format.lower() for file in book.data]: kepub_possible = True @@ -317,7 +317,7 @@ def render_edit_book(book_id): # Determine what formats don't already exist if config.config_converterpath: - allowed_conversion_formats = constants.EXTENSIONS_CONVERT[:] + allowed_conversion_formats = constants.EXTENSIONS_CONVERT_TO[:] for file in book.data: if file.format.lower() in allowed_conversion_formats: allowed_conversion_formats.remove(file.format.lower()) From 1be07a42dffbeed3ce2080a9499b64662a0408ce Mon Sep 17 00:00:00 2001 From: cbartondock Date: Fri, 16 Oct 2020 13:41:48 -0400 Subject: [PATCH 2/3] Flex display to fix columns issue --- cps/static/css/style.css | 11 ++++++++++- cps/templates/author.html | 2 +- cps/templates/discover.html | 2 +- cps/templates/grid.html | 2 +- cps/templates/index.html | 4 ++-- cps/templates/search.html | 2 +- cps/templates/shelf.html | 2 +- cps/templates/shelfdown.html | 2 +- 8 files changed, 18 insertions(+), 9 deletions(-) diff --git a/cps/static/css/style.css b/cps/static/css/style.css index 2294d326..3d6256b2 100644 --- a/cps/static/css/style.css +++ b/cps/static/css/style.css @@ -107,6 +107,11 @@ a, .danger,.book-remove, .editable-empty, .editable-empty:hover { color: #45b29d text-decoration: none; } +.row.display-flex { + display: flex; + flex-wrap: wrap; +} + .container-fluid img { display: block; max-width: 100%; @@ -116,7 +121,11 @@ a, .danger,.book-remove, .editable-empty, .editable-empty:hover { color: #45b29d .container-fluid .discover{ margin-bottom: 50px; } .container-fluid .new-books { border-top: 1px solid #ccc; } .container-fluid .new-books h2 { margin: 50px 0 0 0; } -.container-fluid .book { margin-top: 20px; } +.container-fluid .book { + margin-top: 20px; + display: flex; + flex-direction: column; +} .container-fluid .book .cover { height: 225px; diff --git a/cps/templates/author.html b/cps/templates/author.html index 0015d6e2..2a3ce371 100644 --- a/cps/templates/author.html +++ b/cps/templates/author.html @@ -34,7 +34,7 @@
{{_('All')}}
-
+
{% if entries[0] %} {% for entry in entries %}
diff --git a/cps/templates/discover.html b/cps/templates/discover.html index 9abe3666..3c858feb 100644 --- a/cps/templates/discover.html +++ b/cps/templates/discover.html @@ -2,7 +2,7 @@ {% block body %}

{{title}}

-
+
{% for entry in entries %}
diff --git a/cps/templates/grid.html b/cps/templates/grid.html index 4aa0b7df..ce2c05ac 100644 --- a/cps/templates/grid.html +++ b/cps/templates/grid.html @@ -23,7 +23,7 @@
{% if entries[0] %} -
+
{% for entry in entries %}
diff --git a/cps/templates/index.html b/cps/templates/index.html index e60f92fe..0326df1c 100644 --- a/cps/templates/index.html +++ b/cps/templates/index.html @@ -3,7 +3,7 @@ {% if g.user.show_detail_random() %}

{{_('Discover (Random Books)')}}

-
+
{% for entry in random %}
@@ -73,7 +73,7 @@
-
+
{% if entries[0] %} {% for entry in entries %}
diff --git a/cps/templates/search.html b/cps/templates/search.html index cba430a4..1bd6bf01 100644 --- a/cps/templates/search.html +++ b/cps/templates/search.html @@ -35,7 +35,7 @@
{% endif %} -
+
{% for entry in entries %}
diff --git a/cps/templates/shelf.html b/cps/templates/shelf.html index a2655f96..425e298c 100644 --- a/cps/templates/shelf.html +++ b/cps/templates/shelf.html @@ -12,7 +12,7 @@ {{ _('Change order') }} {% endif %} {% endif %} -
+
{% for entry in entries %}
diff --git a/cps/templates/shelfdown.html b/cps/templates/shelfdown.html index b4d1594a..9ec154be 100644 --- a/cps/templates/shelfdown.html +++ b/cps/templates/shelfdown.html @@ -29,7 +29,7 @@ {% block body %}

{{title}}

-
+
{% for entry in entries %}
From da9dfd166dba6e191d88e129a9b66cd24bc59a31 Mon Sep 17 00:00:00 2001 From: cbartondock Date: Fri, 16 Oct 2020 13:51:48 -0400 Subject: [PATCH 3/3] fixed incorrect cover widths --- cps/static/css/caliBlur.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cps/static/css/caliBlur.css b/cps/static/css/caliBlur.css index 92cf466e..39fd6944 100644 --- a/cps/static/css/caliBlur.css +++ b/cps/static/css/caliBlur.css @@ -1461,7 +1461,8 @@ body > div.container-fluid > div > div.col-sm-10 > div > form > a:hover { -webkit-box-shadow: 0 0 2px rgba(0, 0, 0, .35); box-shadow: 0 0 2px rgba(0, 0, 0, .35); position: relative; - z-index: -9 + z-index: -9; + width: 150px !important; } #books > .cover > a, #books_rand > .cover > a, .book.isotope-item > .cover > a, body > div.container-fluid > div.row-fluid > div.col-sm-10 > div.discover > form > div.col-sm-12 > div.col-sm-12 > div.col-sm-2 > a {