Commit 50ba2e32 authored by Ozzieisaacs's avatar Ozzieisaacs

Merge branch 'master' into Develop

# Conflicts:
#	cps/shelf.py
parents 5255085d c1e2a98f
...@@ -30,7 +30,7 @@ Calibre-Web is a web app providing a clean interface for browsing, reading and d ...@@ -30,7 +30,7 @@ Calibre-Web is a web app providing a clean interface for browsing, reading and d
## Quick start ## Quick start
1. Install dependencies by running `pip3 install --target vendor -r requirements.txt`. 1. Install dependencies by running `pip3 install --target vendor -r requirements.txt` (python3.x) or `pip install --target vendor -r requirements.txt` (python2.7).
2. Execute the command: `python cps.py` (or `nohup python cps.py` - recommended if you want to exit the terminal window) 2. Execute the command: `python cps.py` (or `nohup python cps.py` - recommended if you want to exit the terminal window)
3. Point your browser to `http://localhost:8083` or `http://localhost:8083/opds` for the OPDS catalog 3. Point your browser to `http://localhost:8083` or `http://localhost:8083/opds` for the OPDS catalog
4. Set `Location of Calibre database` to the path of the folder where your Calibre library (metadata.db) lives, push "submit" button\ 4. Set `Location of Calibre database` to the path of the folder where your Calibre library (metadata.db) lives, push "submit" button\
......
...@@ -50,7 +50,7 @@ def oauth_required(f): ...@@ -50,7 +50,7 @@ def oauth_required(f):
def inner(*args, **kwargs): def inner(*args, **kwargs):
if config.config_login_type == constants.LOGIN_OAUTH: if config.config_login_type == constants.LOGIN_OAUTH:
return f(*args, **kwargs) return f(*args, **kwargs)
if request.is_xhr: if request.headers.get('X-Requested-With') == 'XMLHttpRequest':
data = {'status': 'error', 'message': 'Not Found'} data = {'status': 'error', 'message': 'Not Found'}
response = make_response(json.dumps(data, ensure_ascii=False)) response = make_response(json.dumps(data, ensure_ascii=False))
response.headers["Content-Type"] = "application/json; charset=utf-8" response.headers["Content-Type"] = "application/json; charset=utf-8"
......
...@@ -146,7 +146,7 @@ class WebServer(object): ...@@ -146,7 +146,7 @@ class WebServer(object):
self.unix_socket_file = None self.unix_socket_file = None
def _start_tornado(self): def _start_tornado(self):
if os.name == 'nt': if os.name == 'nt' and sys.version_info > (3, 7):
import asyncio import asyncio
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
log.info('Starting Tornado server on %s', _readable_listen_address(self.listen_address, self.listen_port)) log.info('Starting Tornado server on %s', _readable_listen_address(self.listen_address, self.listen_port))
......
...@@ -40,17 +40,18 @@ log = logger.create() ...@@ -40,17 +40,18 @@ log = logger.create()
@shelf.route("/shelf/add/<int:shelf_id>/<int:book_id>") @shelf.route("/shelf/add/<int:shelf_id>/<int:book_id>")
@login_required @login_required
def add_to_shelf(shelf_id, book_id): def add_to_shelf(shelf_id, book_id):
xhr = request.headers.get('X-Requested-With') == 'XMLHttpRequest'
shelf = ub.session.query(ub.Shelf).filter(ub.Shelf.id == shelf_id).first() shelf = ub.session.query(ub.Shelf).filter(ub.Shelf.id == shelf_id).first()
if shelf is None: if shelf is None:
log.error("Invalid shelf specified: %s", shelf_id) log.error("Invalid shelf specified: %s", shelf_id)
if not request.is_xhr: if not xhr:
flash(_(u"Invalid shelf specified"), category="error") flash(_(u"Invalid shelf specified"), category="error")
return redirect(url_for('web.index')) return redirect(url_for('web.index'))
return "Invalid shelf specified", 400 return "Invalid shelf specified", 400
if not shelf.is_public and not shelf.user_id == int(current_user.id): if not shelf.is_public and not shelf.user_id == int(current_user.id):
log.error("User %s not allowed to add a book to %s", current_user, shelf) log.error("User %s not allowed to add a book to %s", current_user, shelf)
if not request.is_xhr: if not xhr:
flash(_(u"Sorry you are not allowed to add a book to the the shelf: %(shelfname)s", shelfname=shelf.name), flash(_(u"Sorry you are not allowed to add a book to the the shelf: %(shelfname)s", shelfname=shelf.name),
category="error") category="error")
return redirect(url_for('web.index')) return redirect(url_for('web.index'))
...@@ -58,7 +59,7 @@ def add_to_shelf(shelf_id, book_id): ...@@ -58,7 +59,7 @@ def add_to_shelf(shelf_id, book_id):
if shelf.is_public and not current_user.role_edit_shelfs(): if shelf.is_public and not current_user.role_edit_shelfs():
log.info("User %s not allowed to edit public shelves", current_user) log.info("User %s not allowed to edit public shelves", current_user)
if not request.is_xhr: if not xhr:
flash(_(u"You are not allowed to edit public shelves"), category="error") flash(_(u"You are not allowed to edit public shelves"), category="error")
return redirect(url_for('web.index')) return redirect(url_for('web.index'))
return "User is not allowed to edit public shelves", 403 return "User is not allowed to edit public shelves", 403
...@@ -67,7 +68,7 @@ def add_to_shelf(shelf_id, book_id): ...@@ -67,7 +68,7 @@ def add_to_shelf(shelf_id, book_id):
ub.BookShelf.book_id == book_id).first() ub.BookShelf.book_id == book_id).first()
if book_in_shelf: if book_in_shelf:
log.error("Book %s is already part of %s", book_id, shelf) log.error("Book %s is already part of %s", book_id, shelf)
if not request.is_xhr: if not xhr:
flash(_(u"Book is already part of the shelf: %(shelfname)s", shelfname=shelf.name), category="error") flash(_(u"Book is already part of the shelf: %(shelfname)s", shelfname=shelf.name), category="error")
return redirect(url_for('web.index')) return redirect(url_for('web.index'))
return "Book is already part of the shelf: %s" % shelf.name, 400 return "Book is already part of the shelf: %s" % shelf.name, 400
...@@ -81,7 +82,7 @@ def add_to_shelf(shelf_id, book_id): ...@@ -81,7 +82,7 @@ def add_to_shelf(shelf_id, book_id):
ins = ub.BookShelf(shelf=shelf.id, book_id=book_id, order=maxOrder + 1) ins = ub.BookShelf(shelf=shelf.id, book_id=book_id, order=maxOrder + 1)
ub.session.add(ins) ub.session.add(ins)
ub.session.commit() ub.session.commit()
if not request.is_xhr: if not xhr:
flash(_(u"Book has been added to shelf: %(sname)s", sname=shelf.name), category="success") flash(_(u"Book has been added to shelf: %(sname)s", sname=shelf.name), category="success")
if "HTTP_REFERER" in request.environ: if "HTTP_REFERER" in request.environ:
return redirect(request.environ["HTTP_REFERER"]) return redirect(request.environ["HTTP_REFERER"])
...@@ -147,10 +148,11 @@ def search_to_shelf(shelf_id): ...@@ -147,10 +148,11 @@ def search_to_shelf(shelf_id):
@shelf.route("/shelf/remove/<int:shelf_id>/<int:book_id>") @shelf.route("/shelf/remove/<int:shelf_id>/<int:book_id>")
@login_required @login_required
def remove_from_shelf(shelf_id, book_id): def remove_from_shelf(shelf_id, book_id):
xhr = request.headers.get('X-Requested-With') == 'XMLHttpRequest'
shelf = ub.session.query(ub.Shelf).filter(ub.Shelf.id == shelf_id).first() shelf = ub.session.query(ub.Shelf).filter(ub.Shelf.id == shelf_id).first()
if shelf is None: if shelf is None:
log.error("Invalid shelf specified: %s", shelf_id) log.error("Invalid shelf specified: %s", shelf_id)
if not request.is_xhr: if not xhr:
return redirect(url_for('web.index')) return redirect(url_for('web.index'))
return "Invalid shelf specified", 400 return "Invalid shelf specified", 400
...@@ -169,20 +171,20 @@ def remove_from_shelf(shelf_id, book_id): ...@@ -169,20 +171,20 @@ def remove_from_shelf(shelf_id, book_id):
if book_shelf is None: if book_shelf is None:
log.error("Book %s already removed from %s", book_id, shelf) log.error("Book %s already removed from %s", book_id, shelf)
if not request.is_xhr: if not xhr:
return redirect(url_for('web.index')) return redirect(url_for('web.index'))
return "Book already removed from shelf", 410 return "Book already removed from shelf", 410
ub.session.delete(book_shelf) ub.session.delete(book_shelf)
ub.session.commit() ub.session.commit()
if not request.is_xhr: if not xhr:
flash(_(u"Book has been removed from shelf: %(sname)s", sname=shelf.name), category="success") flash(_(u"Book has been removed from shelf: %(sname)s", sname=shelf.name), category="success")
return redirect(request.environ["HTTP_REFERER"]) return redirect(request.environ["HTTP_REFERER"])
return "", 204 return "", 204
else: else:
log.error("User %s not allowed to remove a book from %s", current_user, shelf) log.error("User %s not allowed to remove a book from %s", current_user, shelf)
if not request.is_xhr: if not xhr:
flash(_(u"Sorry you are not allowed to remove a book from this shelf: %(sname)s", sname=shelf.name), flash(_(u"Sorry you are not allowed to remove a book from this shelf: %(sname)s", sname=shelf.name),
category="error") category="error")
return redirect(url_for('web.index')) return redirect(url_for('web.index'))
...@@ -284,8 +286,14 @@ def show_shelf(shelf_type, shelf_id): ...@@ -284,8 +286,14 @@ def show_shelf(shelf_type, shelf_id):
books_in_shelf = ub.session.query(ub.BookShelf).filter(ub.BookShelf.shelf == shelf_id)\ books_in_shelf = ub.session.query(ub.BookShelf).filter(ub.BookShelf.shelf == shelf_id)\
.order_by(ub.BookShelf.order.asc()).all() .order_by(ub.BookShelf.order.asc()).all()
books_list = [ b.book_id for b in books_in_shelf] for book in books_in_shelf:
result = db.session.query(db.Books).filter(db.Books.id.in_(books_list)).filter(common_filters()).all() cur_book = db.session.query(db.Books).filter(db.Books.id == book.book_id).filter(common_filters()).first()
if cur_book:
result.append(cur_book)
else:
log.info('Not existing book %s in %s deleted', book.book_id, shelf)
ub.session.query(ub.BookShelf).filter(ub.BookShelf.book_id == book.book_id).delete()
ub.session.commit()
return render_title_template(page, entries=result, title=_(u"Shelf: '%(name)s'", name=shelf.name), return render_title_template(page, entries=result, title=_(u"Shelf: '%(name)s'", name=shelf.name),
shelf=shelf, page="shelf") shelf=shelf, page="shelf")
else: else:
...@@ -315,11 +323,13 @@ def order_shelf(shelf_id): ...@@ -315,11 +323,13 @@ def order_shelf(shelf_id):
ub.Shelf.id == shelf_id))).first() ub.Shelf.id == shelf_id))).first()
result = list() result = list()
if shelf: if shelf:
books_in_shelf = ub.session.query(ub.BookShelf).filter(ub.BookShelf.shelf == shelf_id) \ books_in_shelf2 = ub.session.query(ub.BookShelf).filter(ub.BookShelf.shelf == shelf_id) \
.order_by(ub.BookShelf.order.asc()).all() .order_by(ub.BookShelf.order.asc()).all()
books_list = [ b.book_id for b in books_in_shelf] for book in books_in_shelf2:
# cover, title, series, name, all author names, cur_book = db.session.query(db.Books).filter(db.Books.id == book.book_id).filter(common_filters()).first()
result = db.session.query(db.Books).filter(db.Books.id.in_(books_list)).filter(common_filters()).all() result.append(cur_book)
#books_list = [ b.book_id for b in books_in_shelf2]
#result = db.session.query(db.Books).filter(db.Books.id.in_(books_list)).filter(common_filters()).all()
return render_title_template('shelf_order.html', entries=result, return render_title_template('shelf_order.html', entries=result,
title=_(u"Change order of Shelf: '%(name)s'", name=shelf.name), title=_(u"Change order of Shelf: '%(name)s'", name=shelf.name),
shelf=shelf, page="shelforder") shelf=shelf, page="shelforder")
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
* Google Books api document: https://developers.google.com/books/docs/v1/using * Google Books api document: https://developers.google.com/books/docs/v1/using
* Douban Books api document: https://developers.douban.com/wiki/?title=book_v2 (Chinese Only) * Douban Books api document: https://developers.douban.com/wiki/?title=book_v2 (Chinese Only)
*/ */
/* global _, i18nMsg, tinymce */ /* global _, i18nMsg, tinymce */
var dbResults = []; var dbResults = [];
var ggResults = []; var ggResults = [];
...@@ -55,9 +55,9 @@ $(function () { ...@@ -55,9 +55,9 @@ $(function () {
$(".cover img").attr("src", book.cover); $(".cover img").attr("src", book.cover);
$("#cover_url").val(book.cover); $("#cover_url").val(book.cover);
$("#pubdate").val(book.publishedDate); $("#pubdate").val(book.publishedDate);
$("#publisher").val(book.publisher) $("#publisher").val(book.publisher);
if (book.series != undefined) { if (typeof book.series !== "undefined") {
$("#series").val(book.series) $("#series").val(book.series);
} }
} }
...@@ -72,16 +72,18 @@ $(function () { ...@@ -72,16 +72,18 @@ $(function () {
} }
function formatDate (date) { function formatDate (date) {
var d = new Date(date), var d = new Date(date),
month = '' + (d.getMonth() + 1), month = "" + (d.getMonth() + 1),
day = '' + d.getDate(), day = "" + d.getDate(),
year = d.getFullYear(); year = d.getFullYear();
if (month.length < 2) if (month.length < 2) {
month = '0' + month; month = "0" + month;
if (day.length < 2) }
day = '0' + day; if (day.length < 2) {
day = "0" + day;
return [year, month, day].join('-'); }
return [year, month, day].join("-");
} }
if (ggDone && ggResults.length > 0) { if (ggDone && ggResults.length > 0) {
...@@ -116,16 +118,17 @@ $(function () { ...@@ -116,16 +118,17 @@ $(function () {
} }
if (dbDone && dbResults.length > 0) { if (dbDone && dbResults.length > 0) {
dbResults.forEach(function(result) { dbResults.forEach(function(result) {
if (result.series){ var seriesTitle = "";
var series_title = result.series.title if (result.series) {
seriesTitle = result.series.title;
} }
var date_fomers = result.pubdate.split("-") var dateFomers = result.pubdate.split("-");
var publishedYear = parseInt(date_fomers[0]) var publishedYear = parseInt(dateFomers[0]);
var publishedMonth = parseInt(date_fomers[1]) var publishedMonth = parseInt(dateFomers[1]);
var publishedDate = new Date(publishedYear, publishedMonth-1, 1) var publishedDate = new Date(publishedYear, publishedMonth - 1, 1);
publishedDate = formatDate(publishedDate);
publishedDate = formatDate(publishedDate)
var book = { var book = {
id: result.id, id: result.id,
title: result.title, title: result.title,
...@@ -137,7 +140,7 @@ $(function () { ...@@ -137,7 +140,7 @@ $(function () {
return tag.title.toLowerCase().replace(/,/g, "_"); return tag.title.toLowerCase().replace(/,/g, "_");
}), }),
rating: result.rating.average || 0, rating: result.rating.average || 0,
series: series_title || "", series: seriesTitle || "",
cover: result.image, cover: result.image,
url: "https://book.douban.com/subject/" + result.id, url: "https://book.douban.com/subject/" + result.id,
source: { source: {
...@@ -183,7 +186,7 @@ $(function () { ...@@ -183,7 +186,7 @@ $(function () {
} }
function dbSearchBook (title) { function dbSearchBook (title) {
apikey="0df993c66c0c636e29ecbb5344252a4a" var apikey = "0df993c66c0c636e29ecbb5344252a4a";
$.ajax({ $.ajax({
url: douban + dbSearch + "?apikey=" + apikey + "&q=" + title + "&fields=all&count=10", url: douban + dbSearch + "?apikey=" + apikey + "&q=" + title + "&fields=all&count=10",
type: "GET", type: "GET",
...@@ -193,7 +196,7 @@ $(function () { ...@@ -193,7 +196,7 @@ $(function () {
dbResults = data.books; dbResults = data.books;
}, },
error: function error() { error: function error() {
$("#meta-info").html("<p class=\"text-danger\">" + msg.search_error + "!</p>"+ $("#meta-info")[0].innerHTML) $("#meta-info").html("<p class=\"text-danger\">" + msg.search_error + "!</p>" + $("#meta-info")[0].innerHTML);
}, },
complete: function complete() { complete: function complete() {
dbDone = true; dbDone = true;
......
This diff is collapsed.
...@@ -29,7 +29,7 @@ function sendData(path) { ...@@ -29,7 +29,7 @@ function sendData(path) {
var maxElements; var maxElements;
var tmp = []; var tmp = [];
elements = Sortable.utils.find(sortTrue, "div"); elements = $(".list-group-item");
maxElements = elements.length; maxElements = elements.length;
var form = document.createElement("form"); var form = document.createElement("form");
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
{% endfor %} {% endfor %}
</div> </div>
<button onclick="sendData('{{ url_for('shelf.order_shelf', shelf_id=shelf.id) }}')" class="btn btn-default" id="ChangeOrder">{{_('Change order')}}</button> <button onclick="sendData('{{ url_for('shelf.order_shelf', shelf_id=shelf.id) }}')" class="btn btn-default" id="ChangeOrder">{{_('Change order')}}</button>
<a href="{{ url_for('shelf.show_shelf', shelf_id=shelf.id) }}" class="btn btn-default">{{_('Back')}}</a> <a href="{{ url_for('shelf.show_shelf', shelf_id=shelf.id) }}" id="shelf_back" class="btn btn-default">{{_('Back')}}</a>
</div> </div>
{% endblock %} {% endblock %}
......
...@@ -6,7 +6,7 @@ msgid "" ...@@ -6,7 +6,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Calibre-Web\n" "Project-Id-Version: Calibre-Web\n"
"Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n" "Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n"
"POT-Creation-Date: 2020-01-27 18:16+0100\n" "POT-Creation-Date: 2020-02-01 15:02+0100\n"
"PO-Revision-Date: 2020-01-08 11:37+0000\n" "PO-Revision-Date: 2020-01-08 11:37+0000\n"
"Last-Translator: Lukas Heroudek <lukas.heroudek@gmail.com>\n" "Last-Translator: Lukas Heroudek <lukas.heroudek@gmail.com>\n"
"Language: cs_CZ\n" "Language: cs_CZ\n"
...@@ -79,7 +79,7 @@ msgstr "Byl nalezen existující účet pro tuto e-mailovou adresu nebo přezdí ...@@ -79,7 +79,7 @@ msgstr "Byl nalezen existující účet pro tuto e-mailovou adresu nebo přezdí
#: cps/admin.py:489 #: cps/admin.py:489
#, python-format #, python-format
msgid "User '%(user)s' created" msgid "User '%(user)s' created"
msgstr "Uživatel ‘%(user)s’ vytvořen" msgstr "Uživatel '%(user)s' vytvořen"
#: cps/admin.py:509 #: cps/admin.py:509
msgid "Edit e-mail server settings" msgid "Edit e-mail server settings"
...@@ -205,7 +205,7 @@ msgstr "není nakonfigurováno" ...@@ -205,7 +205,7 @@ msgstr "není nakonfigurováno"
#: cps/editbooks.py:214 cps/editbooks.py:396 #: cps/editbooks.py:214 cps/editbooks.py:396
msgid "Error opening eBook. File does not exist or file is not accessible" msgid "Error opening eBook. File does not exist or file is not accessible"
msgstr "Chyba otevírání eKnihy. Soubor neexistuje nebo není přístupný" msgstr "Chyba otevírání eknihy. Soubor neexistuje nebo není přístupný"
#: cps/editbooks.py:242 #: cps/editbooks.py:242
msgid "edit metadata" msgid "edit metadata"
...@@ -214,11 +214,11 @@ msgstr "upravit metadata" ...@@ -214,11 +214,11 @@ msgstr "upravit metadata"
#: cps/editbooks.py:321 cps/editbooks.py:569 #: cps/editbooks.py:321 cps/editbooks.py:569
#, python-format #, python-format
msgid "File extension '%(ext)s' is not allowed to be uploaded to this server" msgid "File extension '%(ext)s' is not allowed to be uploaded to this server"
msgstr "Soubor s příponou ‘%(ext)s’ nelze odeslat na tento server" msgstr "Soubor s příponou '%(ext)s' nelze odeslat na tento server"
#: cps/editbooks.py:325 cps/editbooks.py:573 #: cps/editbooks.py:325 cps/editbooks.py:573
msgid "File to be uploaded must have an extension" msgid "File to be uploaded must have an extension"
msgstr "Soubor, který má být odeslán, musí mít příponu" msgstr "Soubor, který má být odeslán musí mít příponu"
#: cps/editbooks.py:337 cps/editbooks.py:607 #: cps/editbooks.py:337 cps/editbooks.py:607
#, python-format #, python-format
...@@ -296,7 +296,7 @@ msgstr "Při převodu této knihy došlo k chybě: %(res)s" ...@@ -296,7 +296,7 @@ msgstr "Při převodu této knihy došlo k chybě: %(res)s"
#: cps/gdrive.py:62 #: cps/gdrive.py:62
msgid "Google Drive setup not completed, try to deactivate and activate Google Drive again" msgid "Google Drive setup not completed, try to deactivate and activate Google Drive again"
msgstr "Google Drive nastavení nebylo dokončeno, zkuste znovu deaktivovat a aktivovat Google Drive" msgstr "Google Drive nastavení nebylo dokončeno, zkuste znovu deaktivovat a aktivovat Google Drive"
#: cps/gdrive.py:104 #: cps/gdrive.py:104
msgid "Callback domain is not verified, please follow steps to verify domain in google developer console" msgid "Callback domain is not verified, please follow steps to verify domain in google developer console"
...@@ -366,17 +366,17 @@ msgstr "Požadovaný soubor nelze přečíst. Možná nesprávná oprávnění?" ...@@ -366,17 +366,17 @@ msgstr "Požadovaný soubor nelze přečíst. Možná nesprávná oprávnění?"
#: cps/helper.py:322 #: cps/helper.py:322
#, python-format #, python-format
msgid "Rename title from: '%(src)s' to '%(dest)s' failed with error: %(error)s" msgid "Rename title from: '%(src)s' to '%(dest)s' failed with error: %(error)s"
msgstr "Přejmenování názvu z: ‘%(src)s‘ na ‘%(dest)s' selhalo chybou: %(error)s" msgstr "Přejmenování názvu z: '%(src)s' na '%(dest)s' selhalo chybou: %(error)s"
#: cps/helper.py:332 #: cps/helper.py:332
#, python-format #, python-format
msgid "Rename author from: '%(src)s' to '%(dest)s' failed with error: %(error)s" msgid "Rename author from: '%(src)s' to '%(dest)s' failed with error: %(error)s"
msgstr "Přejmenovat autora z: ‘%(src)s‘ na ‘%(dest)s’ selhalo chybou: %(error)s" msgstr "Přejmenovat autora z: '%(src)s' na '%(dest)s' selhalo chybou: %(error)s"
#: cps/helper.py:346 #: cps/helper.py:346
#, python-format #, python-format
msgid "Rename file in path '%(src)s' to '%(dest)s' failed with error: %(error)s" msgid "Rename file in path '%(src)s' to '%(dest)s' failed with error: %(error)s"
msgstr "Přejmenování souboru v cestě ‘%(src)s‘ na ‘%(dest)s‘ selhalo chybou: %(error)s" msgstr "Přejmenování souboru v cestě '%(src)s' na '%(dest)s' selhalo chybou: %(error)s"
#: cps/helper.py:372 cps/helper.py:382 cps/helper.py:390 #: cps/helper.py:372 cps/helper.py:382 cps/helper.py:390
#, python-format #, python-format
...@@ -528,7 +528,7 @@ msgstr "Lituji, nejste oprávněni odebrat knihu z této police: %(sname)s" ...@@ -528,7 +528,7 @@ msgstr "Lituji, nejste oprávněni odebrat knihu z této police: %(sname)s"
#: cps/shelf.py:207 cps/shelf.py:231 #: cps/shelf.py:207 cps/shelf.py:231
#, python-format #, python-format
msgid "A shelf with the name '%(title)s' already exists." msgid "A shelf with the name '%(title)s' already exists."
msgstr "Police s názvem ‘%(title)s’ již existuje." msgstr "Police s názvem '%(title)s' již existuje."
#: cps/shelf.py:212 #: cps/shelf.py:212
#, python-format #, python-format
...@@ -555,7 +555,7 @@ msgstr "Upravit polici" ...@@ -555,7 +555,7 @@ msgstr "Upravit polici"
#: cps/shelf.py:289 #: cps/shelf.py:289
#, python-format #, python-format
msgid "Shelf: '%(name)s'" msgid "Shelf: '%(name)s'"
msgstr "Police: ’%(name)s’" msgstr "Police: '%(name)s'"
#: cps/shelf.py:292 #: cps/shelf.py:292
msgid "Error opening shelf. Shelf does not exist or is not accessible" msgid "Error opening shelf. Shelf does not exist or is not accessible"
...@@ -564,7 +564,7 @@ msgstr "Chyba otevírání police. Police neexistuje nebo není přístupná" ...@@ -564,7 +564,7 @@ msgstr "Chyba otevírání police. Police neexistuje nebo není přístupná"
#: cps/shelf.py:323 #: cps/shelf.py:323
#, python-format #, python-format
msgid "Change order of Shelf: '%(name)s'" msgid "Change order of Shelf: '%(name)s'"
msgstr "Změnit pořadí Police: ‘%(name)s’" msgstr "Změnit pořadí Police: '%(name)s'"
#: cps/ub.py:57 #: cps/ub.py:57
msgid "Recently Added" msgid "Recently Added"
...@@ -858,7 +858,7 @@ msgstr "Nelze aktivovat ověření LDAP" ...@@ -858,7 +858,7 @@ msgstr "Nelze aktivovat ověření LDAP"
#: cps/web.py:1151 cps/web.py:1278 #: cps/web.py:1151 cps/web.py:1278
#, python-format #, python-format
msgid "you are now logged in as: '%(nickname)s'" msgid "you are now logged in as: '%(nickname)s'"
msgstr "nyní jste přihlášeni jako: ‘%(nickname)s’" msgstr "nyní jste přihlášeni jako: '%(nickname)s'"
#: cps/web.py:1156 #: cps/web.py:1156
msgid "Could not login. LDAP server down, please contact your administrator" msgid "Could not login. LDAP server down, please contact your administrator"
...@@ -1153,7 +1153,7 @@ msgstr "Převést formát knihy:" ...@@ -1153,7 +1153,7 @@ msgstr "Převést formát knihy:"
#: cps/templates/book_edit.html:30 #: cps/templates/book_edit.html:30
msgid "Convert from:" msgid "Convert from:"
msgstr "Převest z:" msgstr "Převést z:"
#: cps/templates/book_edit.html:32 cps/templates/book_edit.html:39 #: cps/templates/book_edit.html:32 cps/templates/book_edit.html:39
msgid "select an option" msgid "select an option"
...@@ -1165,7 +1165,7 @@ msgstr "Převést do:" ...@@ -1165,7 +1165,7 @@ msgstr "Převést do:"
#: cps/templates/book_edit.html:46 #: cps/templates/book_edit.html:46
msgid "Convert book" msgid "Convert book"
msgstr "Převest knihu" msgstr "Převést knihu"
#: cps/templates/book_edit.html:55 cps/templates/search_form.html:6 #: cps/templates/book_edit.html:55 cps/templates/search_form.html:6
msgid "Book Title" msgid "Book Title"
...@@ -1341,7 +1341,7 @@ msgstr "Server port" ...@@ -1341,7 +1341,7 @@ msgstr "Server port"
#: cps/templates/config_edit.html:91 #: cps/templates/config_edit.html:91
msgid "SSL certfile location (leave it empty for non-SSL Servers)" msgid "SSL certfile location (leave it empty for non-SSL Servers)"
msgstr "Umístění certifikátu SSL (ponechejte prázdné u serverů jiných než SSL)" msgstr "Umístění certifikátu SSL (ponechte prázdné pro servery jiné než SSL)"
#: cps/templates/config_edit.html:95 #: cps/templates/config_edit.html:95
msgid "SSL Keyfile location (leave it empty for non-SSL Servers)" msgid "SSL Keyfile location (leave it empty for non-SSL Servers)"
...@@ -1405,7 +1405,7 @@ msgstr "Povolit veřejnou registraci" ...@@ -1405,7 +1405,7 @@ msgstr "Povolit veřejnou registraci"
#: cps/templates/config_edit.html:170 #: cps/templates/config_edit.html:170
msgid "Enable remote login (\"magic link\")" msgid "Enable remote login (\"magic link\")"
msgstr "Povolit vzdálené přihlášení (\\“magic link\\”)" msgstr "Povolit vzdálené přihlášení (\\\"magic link\\\")"
#: cps/templates/config_edit.html:175 #: cps/templates/config_edit.html:175
msgid "Use Goodreads" msgid "Use Goodreads"
...@@ -1495,12 +1495,12 @@ msgstr "Obtain %(provider)s OAuth Credential" ...@@ -1495,12 +1495,12 @@ msgstr "Obtain %(provider)s OAuth Credential"
#: cps/templates/config_edit.html:263 #: cps/templates/config_edit.html:263
#, python-format #, python-format
msgid "%(provider)s OAuth Client Id" msgid "%(provider)s OAuth Client Id"
msgstr "%(provider)s OAuth Client Id" msgstr "%(provider)s OAuth Klient Id"
#: cps/templates/config_edit.html:267 #: cps/templates/config_edit.html:267
#, python-format #, python-format
msgid "%(provider)s OAuth Client Secret" msgid "%(provider)s OAuth Client Secret"
msgstr "%(provider)s OAuth Client Secret" msgstr "%(provider)s OAuth Klient Tajemství"
#: cps/templates/config_edit.html:276 #: cps/templates/config_edit.html:276
msgid "Allow Reverse Proxy Authentication" msgid "Allow Reverse Proxy Authentication"
...@@ -1532,7 +1532,7 @@ msgstr "Nastavení převaděče eknih" ...@@ -1532,7 +1532,7 @@ msgstr "Nastavení převaděče eknih"
#: cps/templates/config_edit.html:312 #: cps/templates/config_edit.html:312
msgid "Path to convertertool" msgid "Path to convertertool"
msgstr "Cesta k převáděči" msgstr "Cesta k převaděči"
#: cps/templates/config_edit.html:318 #: cps/templates/config_edit.html:318
msgid "Location of Unrar binary" msgid "Location of Unrar binary"
...@@ -1577,7 +1577,7 @@ msgstr "Regulární výraz pro ignorování sloupců" ...@@ -1577,7 +1577,7 @@ msgstr "Regulární výraz pro ignorování sloupců"
#: cps/templates/config_view_edit.html:46 #: cps/templates/config_view_edit.html:46
msgid "Link read/unread status to Calibre column" msgid "Link read/unread status to Calibre column"
msgstr "Propojit stav čtení/nepřečtení do sloupce Calibre" msgstr "Propojit stav čtení/nepřečtení do sloupce Calibre"
#: cps/templates/config_view_edit.html:55 #: cps/templates/config_view_edit.html:55
msgid "Regular expression for title sorting" msgid "Regular expression for title sorting"
...@@ -1625,7 +1625,7 @@ msgstr "Povolit úpravy veřejných polic" ...@@ -1625,7 +1625,7 @@ msgstr "Povolit úpravy veřejných polic"
#: cps/templates/config_view_edit.html:119 #: cps/templates/config_view_edit.html:119
msgid "Default visibilities for new users" msgid "Default visibilities for new users"
msgstr "Výchozí viditelnosti pro nové uživatele" msgstr "Výchozí zobrazení pro nové uživatele"
#: cps/templates/config_view_edit.html:135 cps/templates/user_edit.html:76 #: cps/templates/config_view_edit.html:135 cps/templates/user_edit.html:76
msgid "Show random books in detail view" msgid "Show random books in detail view"
...@@ -2337,7 +2337,7 @@ msgstr "Nedávná stahování" ...@@ -2337,7 +2337,7 @@ msgstr "Nedávná stahování"
#~ msgstr "Prohlížeč PDF.js" #~ msgstr "Prohlížeč PDF.js"
#~ msgid "Preparing document for printing..." #~ msgid "Preparing document for printing..."
#~ msgstr "Příprava dokumentu pro tisk" #~ msgstr "Příprava dokumentu pro tisk..."
#~ msgid "Using your another device, visit" #~ msgid "Using your another device, visit"
#~ msgstr "Pomocí jiného zařízení navštivte" #~ msgstr "Pomocí jiného zařízení navštivte"
...@@ -3315,7 +3315,7 @@ msgstr "Nedávná stahování" ...@@ -3315,7 +3315,7 @@ msgstr "Nedávná stahování"
#~ msgstr "Selkup" #~ msgstr "Selkup"
#~ msgid "Irish; Old (to 900)" #~ msgid "Irish; Old (to 900)"
#~ msgstr "Irlandese antico (fino al 900)" #~ msgstr "Irlandese antico (fino al 900)"
#~ msgid "Shan" #~ msgid "Shan"
#~ msgstr "Shan" #~ msgstr "Shan"
......
...@@ -7,7 +7,7 @@ msgid "" ...@@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Calibre-Web\n" "Project-Id-Version: Calibre-Web\n"
"Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n" "Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n"
"POT-Creation-Date: 2020-01-27 18:16+0100\n" "POT-Creation-Date: 2020-02-01 15:02+0100\n"
"PO-Revision-Date: 2020-01-18 12:52+0100\n" "PO-Revision-Date: 2020-01-18 12:52+0100\n"
"Last-Translator: Ozzie Isaacs\n" "Last-Translator: Ozzie Isaacs\n"
"Language: de\n" "Language: de\n"
......
...@@ -8,7 +8,7 @@ msgid "" ...@@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Calibre-Web\n" "Project-Id-Version: Calibre-Web\n"
"Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n" "Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n"
"POT-Creation-Date: 2020-01-27 18:16+0100\n" "POT-Creation-Date: 2020-02-01 15:02+0100\n"
"PO-Revision-Date: 2019-07-26 11:44+0100\n" "PO-Revision-Date: 2019-07-26 11:44+0100\n"
"Last-Translator: minakmostoles <xxx@xxx.com>\n" "Last-Translator: minakmostoles <xxx@xxx.com>\n"
"Language: es\n" "Language: es\n"
......
...@@ -7,7 +7,7 @@ msgid "" ...@@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Calibre-Web\n" "Project-Id-Version: Calibre-Web\n"
"Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n" "Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n"
"POT-Creation-Date: 2020-01-27 18:16+0100\n" "POT-Creation-Date: 2020-02-01 15:02+0100\n"
"PO-Revision-Date: 2020-01-12 13:56+0100\n" "PO-Revision-Date: 2020-01-12 13:56+0100\n"
"Last-Translator: Samuli Valavuo <svalavuo@gmail.com>\n" "Last-Translator: Samuli Valavuo <svalavuo@gmail.com>\n"
"Language: fi\n" "Language: fi\n"
......
...@@ -20,7 +20,7 @@ msgid "" ...@@ -20,7 +20,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Calibre-Web\n" "Project-Id-Version: Calibre-Web\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2020-01-27 18:16+0100\n" "POT-Creation-Date: 2020-02-01 15:02+0100\n"
"PO-Revision-Date: 2019-08-21 15:20+0100\n" "PO-Revision-Date: 2019-08-21 15:20+0100\n"
"Last-Translator: Nicolas Roudninski <nicoroud@gmail.com>\n" "Last-Translator: Nicolas Roudninski <nicoroud@gmail.com>\n"
"Language: fr\n" "Language: fr\n"
......
...@@ -7,7 +7,7 @@ msgid "" ...@@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PROJECT VERSION\n" "Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2020-01-27 18:16+0100\n" "POT-Creation-Date: 2020-02-01 15:02+0100\n"
"PO-Revision-Date: 2019-04-06 23:36+0200\n" "PO-Revision-Date: 2019-04-06 23:36+0200\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language: hu\n" "Language: hu\n"
......
This diff is collapsed.
...@@ -7,7 +7,7 @@ msgid "" ...@@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Calibre-Web\n" "Project-Id-Version: Calibre-Web\n"
"Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n" "Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n"
"POT-Creation-Date: 2020-01-27 18:16+0100\n" "POT-Creation-Date: 2020-02-01 15:02+0100\n"
"PO-Revision-Date: 2018-02-07 02:20-0500\n" "PO-Revision-Date: 2018-02-07 02:20-0500\n"
"Last-Translator: white <space_white@yahoo.com>\n" "Last-Translator: white <space_white@yahoo.com>\n"
"Language: ja\n" "Language: ja\n"
......
...@@ -8,7 +8,7 @@ msgid "" ...@@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Calibre-Web\n" "Project-Id-Version: Calibre-Web\n"
"Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n" "Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n"
"POT-Creation-Date: 2020-01-27 18:16+0100\n" "POT-Creation-Date: 2020-02-01 15:02+0100\n"
"PO-Revision-Date: 2018-08-27 17:06+0700\n" "PO-Revision-Date: 2018-08-27 17:06+0700\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language: km_KH\n" "Language: km_KH\n"
......
...@@ -8,7 +8,7 @@ msgid "" ...@@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Calibre-Web (GPLV3)\n" "Project-Id-Version: Calibre-Web (GPLV3)\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2020-01-27 18:16+0100\n" "POT-Creation-Date: 2020-02-01 15:02+0100\n"
"PO-Revision-Date: 2019-06-17 22:37+0200\n" "PO-Revision-Date: 2019-06-17 22:37+0200\n"
"Last-Translator: Marcel Maas <marcel.maas@outlook.com>\n" "Last-Translator: Marcel Maas <marcel.maas@outlook.com>\n"
"Language: nl\n" "Language: nl\n"
......
This diff is collapsed.
...@@ -8,7 +8,7 @@ msgid "" ...@@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Calibre-Web\n" "Project-Id-Version: Calibre-Web\n"
"Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n" "Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n"
"POT-Creation-Date: 2020-01-27 18:16+0100\n" "POT-Creation-Date: 2020-02-01 15:02+0100\n"
"PO-Revision-Date: 2020-01-21 23:03+0400\n" "PO-Revision-Date: 2020-01-21 23:03+0400\n"
"Last-Translator: ZIZA\n" "Last-Translator: ZIZA\n"
"Language: ru\n" "Language: ru\n"
......
...@@ -7,7 +7,7 @@ msgid "" ...@@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Calibre-Web\n" "Project-Id-Version: Calibre-Web\n"
"Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n" "Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n"
"POT-Creation-Date: 2020-01-27 18:16+0100\n" "POT-Creation-Date: 2020-02-01 15:02+0100\n"
"PO-Revision-Date: 2020-01-18 11:22+0100\n" "PO-Revision-Date: 2020-01-18 11:22+0100\n"
"Last-Translator: Jonatan Nyberg <jonatan.nyberg.karl@gmail.com>\n" "Last-Translator: Jonatan Nyberg <jonatan.nyberg.karl@gmail.com>\n"
"Language: sv\n" "Language: sv\n"
......
...@@ -6,7 +6,7 @@ msgid "" ...@@ -6,7 +6,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Calibre-web\n" "Project-Id-Version: Calibre-web\n"
"Report-Msgid-Bugs-To: https://github.com/janeczku/calibre-web\n" "Report-Msgid-Bugs-To: https://github.com/janeczku/calibre-web\n"
"POT-Creation-Date: 2020-01-27 18:16+0100\n" "POT-Creation-Date: 2020-02-01 15:02+0100\n"
"PO-Revision-Date: 2017-04-30 00:47+0300\n" "PO-Revision-Date: 2017-04-30 00:47+0300\n"
"Last-Translator: ABIS Team <biblio.if.abis@gmail.com>\n" "Last-Translator: ABIS Team <biblio.if.abis@gmail.com>\n"
"Language: uk\n" "Language: uk\n"
......
...@@ -7,7 +7,7 @@ msgid "" ...@@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Calibre-Web\n" "Project-Id-Version: Calibre-Web\n"
"Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n" "Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n"
"POT-Creation-Date: 2020-01-27 18:16+0100\n" "POT-Creation-Date: 2020-02-01 15:02+0100\n"
"PO-Revision-Date: 2017-01-06 17:00+0000\n" "PO-Revision-Date: 2017-01-06 17:00+0000\n"
"Last-Translator: dalin <dalin.lin@gmail.com>\n" "Last-Translator: dalin <dalin.lin@gmail.com>\n"
"Language: zh_Hans_CN\n" "Language: zh_Hans_CN\n"
......
...@@ -151,7 +151,7 @@ def load_user_from_auth_header(header_val): ...@@ -151,7 +151,7 @@ def load_user_from_auth_header(header_val):
header_val = base64.b64decode(header_val).decode('utf-8') header_val = base64.b64decode(header_val).decode('utf-8')
basic_username = header_val.split(':')[0] basic_username = header_val.split(':')[0]
basic_password = header_val.split(':')[1] basic_password = header_val.split(':')[1]
except TypeError: except (TypeError, UnicodeDecodeError):
pass pass
user = _fetch_user_by_name(basic_username) user = _fetch_user_by_name(basic_username)
if user and check_password_hash(str(user.password), basic_password): if user and check_password_hash(str(user.password), basic_password):
...@@ -173,7 +173,7 @@ def remote_login_required(f): ...@@ -173,7 +173,7 @@ def remote_login_required(f):
def inner(*args, **kwargs): def inner(*args, **kwargs):
if config.config_remote_login: if config.config_remote_login:
return f(*args, **kwargs) return f(*args, **kwargs)
if request.is_xhr: if request.headers.get('X-Requested-With') == 'XMLHttpRequest':
data = {'status': 'error', 'message': 'Forbidden'} data = {'status': 'error', 'message': 'Forbidden'}
response = make_response(json.dumps(data, ensure_ascii=False)) response = make_response(json.dumps(data, ensure_ascii=False))
response.headers["Content-Type"] = "application/json; charset=utf-8" response.headers["Content-Type"] = "application/json; charset=utf-8"
...@@ -1469,7 +1469,7 @@ def show_book(book_id): ...@@ -1469,7 +1469,7 @@ def show_book(book_id):
audioentries.append(media_format.format.lower()) audioentries.append(media_format.format.lower())
return render_title_template('detail.html', entry=entries, audioentries=audioentries, cc=cc, return render_title_template('detail.html', entry=entries, audioentries=audioentries, cc=cc,
is_xhr=request.is_xhr, title=entries.title, books_shelfs=book_in_shelfs, is_xhr=request.headers.get('X-Requested-With')=='XMLHttpRequest', title=entries.title, books_shelfs=book_in_shelfs,
have_read=have_read, kindle_list=kindle_list, reader_list=reader_list, page="book") have_read=have_read, kindle_list=kindle_list, reader_list=reader_list, page="book")
else: else:
log.debug(u"Error opening eBook. File does not exist or file is not accessible:") log.debug(u"Error opening eBook. File does not exist or file is not accessible:")
......
...@@ -8,7 +8,7 @@ msgid "" ...@@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PROJECT VERSION\n" "Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2020-01-27 18:16+0100\n" "POT-Creation-Date: 2020-02-01 15:02+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment