From 0f7d272e13ac8c90afdaedb7cdf2d44f770e649c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Heroudek?= Date: Tue, 28 Jan 2020 10:03:40 +0000 Subject: [PATCH 1/9] Update messages.po --- cps/translations/cs/LC_MESSAGES/messages.po | 46 ++++++++++----------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/cps/translations/cs/LC_MESSAGES/messages.po b/cps/translations/cs/LC_MESSAGES/messages.po index 4e8bf425..6708e822 100644 --- a/cps/translations/cs/LC_MESSAGES/messages.po +++ b/cps/translations/cs/LC_MESSAGES/messages.po @@ -79,7 +79,7 @@ msgstr "Byl nalezen existující účet pro tuto e-mailovou adresu nebo přezdí #: cps/admin.py:489 #, python-format msgid "User '%(user)s' created" -msgstr "Uživatel ‘%(user)s’ vytvořen" +msgstr "Uživatel '%(user)s' vytvořen" #: cps/admin.py:509 msgid "Edit e-mail server settings" @@ -205,7 +205,7 @@ msgstr "není nakonfigurováno" #: cps/editbooks.py:214 cps/editbooks.py:396 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 msgid "edit metadata" @@ -214,11 +214,11 @@ msgstr "upravit metadata" #: cps/editbooks.py:321 cps/editbooks.py:569 #, python-format 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 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 #, python-format @@ -296,7 +296,7 @@ msgstr "Při převodu této knihy došlo k chybě: %(res)s" #: cps/gdrive.py:62 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 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í?" #: cps/helper.py:322 #, python-format 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 #, python-format 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 #, python-format 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 #, python-format @@ -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 #, python-format 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 #, python-format @@ -555,7 +555,7 @@ msgstr "Upravit polici" #: cps/shelf.py:289 #, python-format msgid "Shelf: '%(name)s'" -msgstr "Police: ’%(name)s’" +msgstr "Police: '%(name)s'" #: cps/shelf.py:292 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á" #: cps/shelf.py:323 #, python-format 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 msgid "Recently Added" @@ -858,7 +858,7 @@ msgstr "Nelze aktivovat ověření LDAP" #: cps/web.py:1151 cps/web.py:1278 #, python-format 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 msgid "Could not login. LDAP server down, please contact your administrator" @@ -1153,7 +1153,7 @@ msgstr "Převést formát knihy:" #: cps/templates/book_edit.html:30 msgid "Convert from:" -msgstr "Převest z:" +msgstr "Převést z:" #: cps/templates/book_edit.html:32 cps/templates/book_edit.html:39 msgid "select an option" @@ -1165,7 +1165,7 @@ msgstr "Převést do:" #: cps/templates/book_edit.html:46 msgid "Convert book" -msgstr "Převest knihu" +msgstr "Převést knihu" #: cps/templates/book_edit.html:55 cps/templates/search_form.html:6 msgid "Book Title" @@ -1341,7 +1341,7 @@ msgstr "Server port" #: cps/templates/config_edit.html:91 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 msgid "SSL Keyfile location (leave it empty for non-SSL Servers)" @@ -1405,7 +1405,7 @@ msgstr "Povolit veřejnou registraci" #: cps/templates/config_edit.html:170 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 msgid "Use Goodreads" @@ -1495,12 +1495,12 @@ msgstr "Obtain %(provider)s OAuth Credential" #: cps/templates/config_edit.html:263 #, python-format msgid "%(provider)s OAuth Client Id" -msgstr "%(provider)s OAuth Client Id" +msgstr "%(provider)s OAuth Klient Id" #: cps/templates/config_edit.html:267 #, python-format msgid "%(provider)s OAuth Client Secret" -msgstr "%(provider)s OAuth Client Secret" +msgstr "%(provider)s OAuth Klient Tajemství" #: cps/templates/config_edit.html:276 msgid "Allow Reverse Proxy Authentication" @@ -1532,7 +1532,7 @@ msgstr "Nastavení převaděče eknih" #: cps/templates/config_edit.html:312 msgid "Path to convertertool" -msgstr "Cesta k převáděči" +msgstr "Cesta k převaděči" #: cps/templates/config_edit.html:318 msgid "Location of Unrar binary" @@ -1577,7 +1577,7 @@ msgstr "Regulární výraz pro ignorování sloupců" #: cps/templates/config_view_edit.html:46 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 msgid "Regular expression for title sorting" @@ -1625,7 +1625,7 @@ msgstr "Povolit úpravy veřejných polic" #: cps/templates/config_view_edit.html:119 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 msgid "Show random books in detail view" @@ -2337,7 +2337,7 @@ msgstr "Nedávná stahování" #~ msgstr "Prohlížeč PDF.js" #~ msgid "Preparing document for printing..." -#~ msgstr "Příprava dokumentu pro tisk …" +#~ msgstr "Příprava dokumentu pro tisk..." #~ msgid "Using your another device, visit" #~ msgstr "Pomocí jiného zařízení navštivte" @@ -3315,7 +3315,7 @@ msgstr "Nedávná stahování" #~ msgstr "Selkup" #~ msgid "Irish; Old (to 900)" -#~ msgstr "Irlandese antico (fino al ’900)" +#~ msgstr "Irlandese antico (fino al 900)" #~ msgid "Shan" #~ msgstr "Shan" From 0bb0cbaef02f65f058d782a14faadbf88d851f2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jerzy=20Pi=C4=85tek?= Date: Tue, 28 Jan 2020 22:28:58 +0100 Subject: [PATCH 2/9] Updated polish translations --- cps/translations/pl/LC_MESSAGES/messages.po | 196 ++++++++++---------- 1 file changed, 98 insertions(+), 98 deletions(-) diff --git a/cps/translations/pl/LC_MESSAGES/messages.po b/cps/translations/pl/LC_MESSAGES/messages.po index 3ab96c1d..45646953 100644 --- a/cps/translations/pl/LC_MESSAGES/messages.po +++ b/cps/translations/pl/LC_MESSAGES/messages.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "POT-Creation-Date: 2020-01-27 18:16+0100\n" "PO-Revision-Date: 2019-08-18 22:06+0200\n" -"Last-Translator: Radosław Kierznowski \n" +"Last-Translator: Jerzy Piątek \n" "Language: pl\n" "Language-Team: \n" "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n" @@ -48,7 +48,7 @@ msgstr "Nieznany" #: cps/admin.py:129 msgid "Admin page" -msgstr " Panel administratora" +msgstr "Panel administratora" #: cps/admin.py:148 cps/templates/admin.html:115 msgid "UI Configuration" @@ -100,7 +100,7 @@ msgstr "Wystąpił błąd podczas wysyłania e-maila testowego: %(res)s" #: cps/admin.py:540 msgid "Please configure your e-mail address first..." -msgstr "" +msgstr "Najpierw skonfiguruj swój adres e-mail..." #: cps/admin.py:542 msgid "E-mail server settings updated" @@ -126,7 +126,7 @@ msgstr "Edytuj użytkownika %(nick)s" #: cps/admin.py:622 cps/web.py:1324 msgid "This username is already taken" -msgstr "" +msgstr "Nazwa użytkownika jest już zajęta" #: cps/admin.py:637 #, python-format @@ -194,7 +194,7 @@ msgstr "" #: cps/admin.py:722 cps/updater.py:274 cps/updater.py:461 msgid "Connection error" -msgstr "" +msgstr "Błąd połączenia" #: cps/admin.py:723 cps/updater.py:276 cps/updater.py:463 msgid "Timeout while establishing connection" @@ -206,7 +206,7 @@ msgstr "" #: cps/converter.py:31 msgid "not configured" -msgstr "" +msgstr "nie skonfigurowane" #: cps/editbooks.py:214 cps/editbooks.py:396 msgid "Error opening eBook. File does not exist or file is not accessible" @@ -265,11 +265,11 @@ msgstr "Błąd podczas edycji książki, sprawdź plik logu, aby uzyskać szczeg #: cps/editbooks.py:581 #, python-format msgid "File %(filename)s could not saved to temp dir" -msgstr "" +msgstr "Nie można zapisać pliku %(filename)s w katalogu tymczasowym" #: cps/editbooks.py:598 msgid "Uploaded book probably exists in the library, consider to change before upload new: " -msgstr "" +msgstr "Przesłana książka prawdopodobnie istnieje w bibliotece, rozważ zmianę przed przesłaniem nowej: " #: cps/editbooks.py:613 #, python-format @@ -479,7 +479,7 @@ msgstr "" #: cps/shelf.py:47 cps/shelf.py:99 msgid "Invalid shelf specified" -msgstr "" +msgstr "Podano niewłaściwą półkę" #: cps/shelf.py:54 #, python-format @@ -488,12 +488,12 @@ msgstr "" #: cps/shelf.py:62 msgid "You are not allowed to edit public shelves" -msgstr "" +msgstr "Nie masz uprawnień do edytowania publicznej półki" #: cps/shelf.py:71 #, python-format msgid "Book is already part of the shelf: %(shelfname)s" -msgstr "" +msgstr "Książka jest już dodana do półki" #: cps/shelf.py:85 #, python-format @@ -503,26 +503,26 @@ msgstr "Książka została dodana do półki: %(sname)s" #: cps/shelf.py:104 #, python-format msgid "You are not allowed to add a book to the the shelf: %(name)s" -msgstr "" +msgstr "Nie masz uprawnień do dodania ksiażki do półki: %(name)s" #: cps/shelf.py:109 msgid "User is not allowed to edit public shelves" -msgstr "" +msgstr "Użytkownik nie ma uprawnień do edytowania publicznych półek" #: cps/shelf.py:127 #, python-format msgid "Books are already part of the shelf: %(name)s" -msgstr "" +msgstr "Książki są już dodane do półki: %(name)s" #: cps/shelf.py:141 #, python-format msgid "Books have been added to shelf: %(sname)s" -msgstr "" +msgstr "Książki zostały dodane do półki %(sname)s" #: cps/shelf.py:143 #, python-format msgid "Could not add books to shelf: %(sname)s" -msgstr "" +msgstr "Nie można dodać książek do półki: %(sname)s" #: cps/shelf.py:180 #, python-format @@ -532,7 +532,7 @@ msgstr "Książka została usunięta z półki: %(sname)s" #: cps/shelf.py:186 #, python-format msgid "Sorry you are not allowed to remove a book from this shelf: %(sname)s" -msgstr "" +msgstr "Niestety nie możesz usunąć książki z tej półki %(sname)s" #: cps/shelf.py:207 cps/shelf.py:231 #, python-format @@ -568,7 +568,7 @@ msgstr "Półka: '%(name)s'" #: cps/shelf.py:292 msgid "Error opening shelf. Shelf does not exist or is not accessible" -msgstr "" +msgstr "Błąd otwierania półki. Półka nie istnieje lub jest niedostępna" #: cps/shelf.py:323 #, python-format @@ -615,7 +615,7 @@ msgstr "Nieprzeczytane książki" #: cps/ub.py:73 msgid "Show unread" -msgstr "" +msgstr "Pokaż nieprzeczytane" #: cps/ub.py:74 msgid "Discover" @@ -688,28 +688,28 @@ msgstr "" #: cps/updater.py:259 cps/updater.py:365 msgid "No update available. You already have the latest version installed" -msgstr "" +msgstr "Brak dostępnej aktualizacji. Masz już zainstalowaną najnowszą wersję" #: cps/updater.py:285 msgid "A new update is available. Click on the button below to update to the latest version." -msgstr "" +msgstr "Dostępna jest nowa aktualizacja. Kliknij przycisk poniżej, aby zaktualizować do najnowszej wersji." #: cps/updater.py:338 msgid "Could not fetch update information" -msgstr "" +msgstr "Nie można pobrać informacji o aktualizacji" #: cps/updater.py:352 msgid "No release information available" -msgstr "" +msgstr "Brak dostępnych informacji o wersji" #: cps/updater.py:405 cps/updater.py:414 #, python-format msgid "A new update is available. Click on the button below to update to version: %(version)s" -msgstr "" +msgstr "Dostępna jest nowa aktualizacja. Kliknij przycisk poniżej, aby zaktualizować do wersji: %(version)s" #: cps/updater.py:424 msgid "Click on the button below to update to the latest stable version." -msgstr "" +msgstr "Kliknij przycisk poniżej, aby zaktualizować do najnowszej stabilnej wersji." #: cps/web.py:486 msgid "Recently Added Books" @@ -796,7 +796,7 @@ msgstr "Lista kategorii" #: cps/templates/layout.html:73 cps/web.py:807 msgid "Tasks" -msgstr " Zadania" +msgstr "Zadania" #: cps/templates/feed.xml:33 cps/templates/layout.html:44 #: cps/templates/layout.html:45 cps/web.py:827 cps/web.py:829 @@ -841,7 +841,7 @@ msgstr "Najpierw skonfiguruj adres e-mail Kindla..." #: cps/web.py:1084 msgid "E-Mail server is not configured, please contact your administrator!" -msgstr "" +msgstr "Serwer e-mail nie jest skonfigurowany, skontaktuj się z administratorem!" #: cps/web.py:1085 cps/web.py:1091 cps/web.py:1116 cps/web.py:1120 #: cps/web.py:1125 cps/web.py:1129 @@ -879,11 +879,11 @@ msgstr "Błędna nazwa użytkownika lub hasło" #: cps/web.py:1167 msgid "New Password was send to your email address" -msgstr "" +msgstr "Nowe hasło zostało wysłane na Twój adres e-mail" #: cps/web.py:1173 msgid "Please enter valid username to reset password" -msgstr "" +msgstr "Wprowadź prawidłową nazwę użytkownika, aby zresetować hasło" #: cps/web.py:1179 #, python-format @@ -957,7 +957,7 @@ msgstr "DLS" # ??? #: cps/templates/admin.html:16 cps/templates/layout.html:76 msgid "Admin" -msgstr " Panel administratora" +msgstr "Panel administratora" # ??? #: cps/templates/admin.html:17 cps/templates/detail.html:18 @@ -1040,7 +1040,7 @@ msgstr "Publiczna rejestracja" #: cps/templates/admin.html:100 cps/templates/remote_login.html:4 msgid "Remote login" -msgstr "" +msgstr "Zdalne logowanie" #: cps/templates/admin.html:104 msgid "Reverse proxy login" @@ -1048,7 +1048,7 @@ msgstr "" #: cps/templates/admin.html:109 msgid "Reverse proxy header name" -msgstr "" +msgstr "Nazwa nagłówka reverse proxy" #: cps/templates/admin.html:121 msgid "Administration" @@ -1127,7 +1127,7 @@ msgstr "" #: cps/templates/author.html:23 msgid "In Library" -msgstr "" +msgstr "W Bibliotece" # ??? #: cps/templates/author.html:34 cps/templates/list.html:14 @@ -1144,7 +1144,7 @@ msgstr "" #: cps/templates/author.html:94 msgid "More by" -msgstr "" +msgstr "Więcej według" #: cps/templates/book_edit.html:12 msgid "Delete Book" @@ -1213,7 +1213,7 @@ msgstr "" #: cps/templates/book_edit.html:87 msgid "Upload Cover from local drive" -msgstr "" +msgstr "Prześlij okładkę z dysku lokalnego" #: cps/templates/book_edit.html:92 cps/templates/detail.html:165 msgid "Publishing date" @@ -1320,15 +1320,15 @@ msgstr "Użyć dysku Google?" #: cps/templates/config_edit.html:31 msgid "Google Drive config problem" -msgstr "" +msgstr "Problem z konfiguracją Dysku Google" #: cps/templates/config_edit.html:37 msgid "Authenticate Google Drive" -msgstr "" +msgstr "Uwierzytelnij Dysk Google" #: cps/templates/config_edit.html:41 msgid "Please hit submit to continue with setup" -msgstr "" +msgstr "Kliknij przycisk, aby kontynuować instalację" #: cps/templates/config_edit.html:44 msgid "Please finish Google Drive setup after login" @@ -1369,11 +1369,11 @@ msgstr "Kanał aktualizacji" #: cps/templates/config_edit.html:101 msgid "Stable" -msgstr "" +msgstr "Stabilna" #: cps/templates/config_edit.html:102 msgid "Stable (Automatic)" -msgstr "" +msgstr "Stablina (Automatycznie)" #: cps/templates/config_edit.html:103 msgid "Nightly" @@ -1425,15 +1425,15 @@ msgstr "Włącz zdalne logowanie (\"magic link\")" #: cps/templates/config_edit.html:175 msgid "Use Goodreads" -msgstr "" +msgstr "Użyj Goodreads" #: cps/templates/config_edit.html:176 msgid "Obtain an API Key" -msgstr "" +msgstr "Uzyskaj klucz API" #: cps/templates/config_edit.html:180 msgid "Goodreads API Key" -msgstr "" +msgstr "Klucz API Goodreads " #: cps/templates/config_edit.html:184 msgid "Goodreads API Secret" @@ -1441,55 +1441,55 @@ msgstr "" #: cps/templates/config_edit.html:191 msgid "Login type" -msgstr "" +msgstr "Rodzaj logowania" #: cps/templates/config_edit.html:193 msgid "Use standard Authentication" -msgstr "" +msgstr "Użyj standardowego uwierzytelnienia" #: cps/templates/config_edit.html:195 msgid "Use LDAP Authentication" -msgstr "" +msgstr "Użyj uwierzytelniania LDAP" #: cps/templates/config_edit.html:198 msgid "Use OAuth" -msgstr "" +msgstr "Uzyj OAuth" #: cps/templates/config_edit.html:205 msgid "LDAP Server Host Name or IP Address" -msgstr "" +msgstr "Nazwa hosta lub adres IP serwera LDAP" #: cps/templates/config_edit.html:209 msgid "LDAP Server Port" -msgstr "" +msgstr "Port serwera LDAP" #: cps/templates/config_edit.html:213 msgid "LDAP schema (ldap or ldaps)" -msgstr "" +msgstr "Schemat LDAP (ldap lub ldaps)" #: cps/templates/config_edit.html:217 msgid "LDAP Admin username" -msgstr "" +msgstr "Nazwa administratora LDAP" #: cps/templates/config_edit.html:221 msgid "LDAP Admin password" -msgstr "" +msgstr "Hasło administratora LDAP" #: cps/templates/config_edit.html:226 msgid "LDAP Server use SSL" -msgstr "" +msgstr "Serwer LDAP korzysta z protokołu SSL" #: cps/templates/config_edit.html:230 msgid "LDAP Server use TLS" -msgstr "" +msgstr "Serwer LDAP korzysta z TLS" #: cps/templates/config_edit.html:234 msgid "LDAP Server Certificate" -msgstr "" +msgstr "Certyfikat serwera LDAP" #: cps/templates/config_edit.html:238 msgid "LDAP SSL Certificate Path" -msgstr "" +msgstr "Ścieżka certyfikatu SSL LDAP" #: cps/templates/config_edit.html:243 msgid "LDAP Distinguished Name (DN)" @@ -1501,7 +1501,7 @@ msgstr "" #: cps/templates/config_edit.html:252 msgid "LDAP Server is OpenLDAP?" -msgstr "" +msgstr "Serwer LDAP to OpenLDAP?" #: cps/templates/config_edit.html:260 #, python-format @@ -1524,7 +1524,7 @@ msgstr "" #: cps/templates/config_edit.html:280 msgid "Reverse Proxy Header Name" -msgstr "" +msgstr "Nazwa nagłowka reverse proxy" #: cps/templates/config_edit.html:292 msgid "External binaries" @@ -1552,7 +1552,7 @@ msgstr "Lokalizacja do pliku konwertera" #: cps/templates/config_edit.html:318 msgid "Location of Unrar binary" -msgstr "" +msgstr "Lokalizacja pliku binarnego Unrar" #: cps/templates/config_edit.html:334 cps/templates/layout.html:84 #: cps/templates/login.html:4 @@ -1565,7 +1565,7 @@ msgstr "Konfiguracja Widoku" #: cps/templates/config_view_edit.html:19 cps/templates/shelf_edit.html:7 msgid "Title" -msgstr "Nazwa serwera" +msgstr "Nazwa" #: cps/templates/config_view_edit.html:27 msgid "No. of random books to show" @@ -1573,7 +1573,7 @@ msgstr "Liczba losowych książek do pokazania" #: cps/templates/config_view_edit.html:31 msgid "No. of authors to show before hiding (0=disable hiding)" -msgstr "" +msgstr "Liczba autorów do pokazania przed ukryciem (0=wyłącza ukrywanie)" #: cps/templates/config_view_edit.html:35 cps/templates/readcbr.html:112 msgid "Theme" @@ -1657,7 +1657,7 @@ msgstr "Czytaj w przeglądarce" #: cps/templates/detail.html:72 msgid "Listen in browser" -msgstr "" +msgstr "Słuchaj w przeglądarce" #: cps/templates/detail.html:117 msgid "Book" @@ -1733,27 +1733,27 @@ msgstr "Zapisz ustawienia i wyślij testową wiadomość e-mail" #: cps/templates/email_edit.html:43 msgid "Allowed domains for registering" -msgstr "" +msgstr "Domeny dozwolone do rejestracji" #: cps/templates/email_edit.html:46 cps/templates/email_edit.html:72 msgid "Add Domain" -msgstr "" +msgstr "Dodaj domenę" #: cps/templates/email_edit.html:49 cps/templates/email_edit.html:75 msgid "Add" -msgstr "" +msgstr "Dodaj" #: cps/templates/email_edit.html:54 cps/templates/email_edit.html:64 msgid "Enter domainname" -msgstr "" +msgstr "Podaj nazwę domeny" #: cps/templates/email_edit.html:60 msgid "Denied domains for registering" -msgstr "" +msgstr "Nie można zarejestrowac domen" #: cps/templates/email_edit.html:90 msgid "Do you really want to delete this domain rule?" -msgstr "" +msgstr "Czy naprawdę chcesz usunąć tę regułę domeny?" #: cps/templates/feed.xml:21 cps/templates/layout.html:176 msgid "Next" @@ -1792,7 +1792,7 @@ msgstr "Popularne publikacje z tego katalogu bazujące na ocenach." #: cps/templates/index.xml:31 msgid "Recently added Books" -msgstr "" +msgstr "Ostatnio dodane książki" #: cps/templates/index.xml:35 msgid "The latest Books" @@ -1820,11 +1820,11 @@ msgstr "Książki sortowane według serii" #: cps/templates/index.xml:93 msgid "Books ordered by Languages" -msgstr "" +msgstr "Ksiązki posortowane według języka" #: cps/templates/index.xml:100 msgid "Books ordered by file formats" -msgstr "" +msgstr "Ksiązki posortowane według formatu" #: cps/templates/index.xml:103 cps/templates/layout.html:137 msgid "Public Shelves" @@ -1925,7 +1925,7 @@ msgstr "Zapamiętaj mnie" #: cps/templates/login.html:22 msgid "Forgot password" -msgstr "" +msgstr "Zapomniałem hasła" #: cps/templates/login.html:25 msgid "Log in with magic link" @@ -1933,19 +1933,19 @@ msgstr "Zaloguj się za pomocą \"magic link\"" #: cps/templates/logviewer.html:6 msgid "Show Calibre-Web log: " -msgstr "" +msgstr "Pokaż log Calibre-Web" #: cps/templates/logviewer.html:8 msgid "Calibre-Web log: " -msgstr "" +msgstr "Log Calibre-Web" #: cps/templates/logviewer.html:8 msgid "Stream output, can't be displayed" -msgstr "" +msgstr "Nie można wyświetlić wyjścia" #: cps/templates/logviewer.html:12 msgid "Show access log: " -msgstr "" +msgstr "Pokaż log dostępu" #: cps/templates/osd.xml:5 msgid "Calibre-Web ebook catalog" @@ -1958,27 +1958,27 @@ msgstr "Tekst pływający, gdy paski boczne są otwarte." #: cps/templates/readcbr.html:88 msgid "Keyboard Shortcuts" -msgstr "" +msgstr "Skróty klawiaturowe" #: cps/templates/readcbr.html:91 msgid "Previous Page" -msgstr "" +msgstr "Poprzednia strona" #: cps/templates/readcbr.html:92 msgid "Next Page" -msgstr "" +msgstr "Następna strona" #: cps/templates/readcbr.html:93 msgid "Scale to Best" -msgstr "" +msgstr "Skaluj do najlepszego" #: cps/templates/readcbr.html:94 msgid "Scale to Width" -msgstr "" +msgstr "Skaluj do szerokości" #: cps/templates/readcbr.html:95 msgid "Scale to Height" -msgstr "" +msgstr "Skaluj do wysokości" #: cps/templates/readcbr.html:96 msgid "Scale to Native" @@ -1986,11 +1986,11 @@ msgstr "" #: cps/templates/readcbr.html:97 msgid "Rotate Right" -msgstr "" +msgstr "Obróć w prawo" #: cps/templates/readcbr.html:98 msgid "Rotate Left" -msgstr "" +msgstr "Obróć w lewo" #: cps/templates/readcbr.html:99 msgid "Flip Image" @@ -1998,27 +1998,27 @@ msgstr "" #: cps/templates/readcbr.html:115 msgid "Light" -msgstr "" +msgstr "Jasny" #: cps/templates/readcbr.html:116 msgid "Dark" -msgstr "" +msgstr "Ciemny" #: cps/templates/readcbr.html:121 msgid "Scale" -msgstr "" +msgstr "Skaluj" #: cps/templates/readcbr.html:124 msgid "Best" -msgstr "" +msgstr "Najlepszy" #: cps/templates/readcbr.html:125 msgid "Width" -msgstr "" +msgstr "Szerokość" #: cps/templates/readcbr.html:126 msgid "Height" -msgstr "" +msgstr "Wysokość" #: cps/templates/readcbr.html:127 msgid "Native" @@ -2026,7 +2026,7 @@ msgstr "" #: cps/templates/readcbr.html:132 msgid "Rotate" -msgstr "" +msgstr "Obrót" #: cps/templates/readcbr.html:143 msgid "Flip" @@ -2042,7 +2042,7 @@ msgstr "Pionowo" #: cps/templates/readcbr.html:152 msgid "Direction" -msgstr "" +msgstr "Kierunek" #: cps/templates/readcbr.html:155 msgid "Left to Right" @@ -2050,11 +2050,11 @@ msgstr "od lewej do prawej" #: cps/templates/readcbr.html:156 msgid "Right to Left" -msgstr "od prawej do lewej" +msgstr "Od prawej do lewej" #: cps/templates/readpdf.html:29 msgid "PDF reader" -msgstr "czytnik PDF" +msgstr "Czytnik PDF" #: cps/templates/readtxt.html:6 msgid "Basic txt Reader" @@ -2078,11 +2078,11 @@ msgstr "Twój adres e-mail" #: cps/templates/remote_login.html:6 msgid "Use your other device, login and visit " -msgstr "" +msgstr "Użyj innego urządzenia, zaloguj się i odwiedź" #: cps/templates/remote_login.html:9 msgid "Once you do so, you will automatically get logged in on this device." -msgstr "" +msgstr "Gdy to zrobisz, automatycznie zalogujesz się na tym urządzeniu." #: cps/templates/remote_login.html:12 msgid "The link will expire after 10 minutes." @@ -2122,11 +2122,11 @@ msgstr "Wyklucz języki" #: cps/templates/search_form.html:95 msgid "Extensions" -msgstr "" +msgstr "Rozszerzenia" #: cps/templates/search_form.html:105 msgid "Exclude Extensions" -msgstr "" +msgstr "Wyklucz rozszerzenia" #: cps/templates/search_form.html:117 msgid "Rating bigger than" From 9247ded71078a7f257d631c9f5fb0433ea73d282 Mon Sep 17 00:00:00 2001 From: ElQuimm <50202052+ElQuimm@users.noreply.github.com> Date: Wed, 29 Jan 2020 21:41:54 +0100 Subject: [PATCH 3/9] Update - italian version of message.po --- cps/translations/it/LC_MESSAGES/messages.po | 102 ++++++++++---------- 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/cps/translations/it/LC_MESSAGES/messages.po b/cps/translations/it/LC_MESSAGES/messages.po index 0d20414d..2fb50cf4 100644 --- a/cps/translations/it/LC_MESSAGES/messages.po +++ b/cps/translations/it/LC_MESSAGES/messages.po @@ -165,7 +165,7 @@ msgstr "Decomprimo il pacchetto di aggiornamento" #: cps/admin.py:717 msgid "Replacing files" -msgstr "Sostituzione files" +msgstr "Sostituisco i file" #: cps/admin.py:718 msgid "Database connections are closed" @@ -177,7 +177,7 @@ msgstr "Arresta il server" #: cps/admin.py:720 msgid "Update finished, please press okay and reload page" -msgstr "Aggiornamento completato, prego premere ok e ricaricare la pagina" +msgstr "Aggiornamento completato, prego premi ok e ricarica la pagina" #: cps/admin.py:721 cps/admin.py:722 cps/admin.py:723 cps/admin.py:724 msgid "Update failed:" @@ -268,7 +268,7 @@ msgstr "Probabilmnete il libro caricato esiste già nella libreria; considera di #: cps/editbooks.py:613 #, python-format msgid "Failed to store file %(file)s (Permission denied)." -msgstr "Impossibile salvare il file %(file)s (autorizzazione negata)" +msgstr "Impossibile salvare il file %(file)s (autorizzazione negata)." #: cps/editbooks.py:619 #, python-format @@ -305,7 +305,7 @@ msgstr "Callback domain non è stato verificato. Per favore intraprendi il neces #: cps/helper.py:80 #, python-format msgid "%(format)s format not found for book id: %(book)d" -msgstr "%(format)s formato non trovato per il libro: %(book)d" +msgstr "Formato %(format)s non trovato per il libro: %(book)d" #: cps/helper.py:92 #, python-format @@ -341,7 +341,7 @@ msgstr "Inizia con Calibre-Web" #: cps/helper.py:135 #, python-format msgid "Registration e-mail for user: %(name)s" -msgstr "E-mail di registrazione per l'utente: %(name)s" +msgstr "E-mail di registrazione dell'utente: %(name)s" #: cps/helper.py:149 cps/helper.py:151 cps/helper.py:153 cps/helper.py:161 #: cps/helper.py:163 cps/helper.py:165 @@ -386,15 +386,15 @@ msgstr "File %(file)s non trovato su Google Drive" #: cps/helper.py:411 #, python-format msgid "Book path %(path)s not found on Google Drive" -msgstr "Non ho trovato la cartella %(path)s su Google Drive" +msgstr "Non ho trovato la cartella %(path)s del libro su Google Drive" #: cps/helper.py:643 msgid "Waiting" -msgstr "Attendere" +msgstr "Attendi" #: cps/helper.py:645 msgid "Failed" -msgstr "Fallito" +msgstr "Non riuscito" #: cps/helper.py:647 msgid "Started" @@ -431,19 +431,19 @@ msgstr "Registra con %(provider)s" #: cps/oauth_bb.py:155 msgid "Failed to log in with GitHub." -msgstr "Fallito l'accesso con GitHub." +msgstr "Accesso con GitHub non riuscito." #: cps/oauth_bb.py:160 msgid "Failed to fetch user info from GitHub." -msgstr "Fallito il recupero delle informazioni dell'utente da GitHub." +msgstr "Il recupero delle informazioni dell'utente da GitHub non è riuscito." #: cps/oauth_bb.py:171 msgid "Failed to log in with Google." -msgstr "Fallito l'accesso con Google." +msgstr "Accesso con Google non riuscito." #: cps/oauth_bb.py:176 msgid "Failed to fetch user info from Google." -msgstr "Fallito il recupero delle informazioni da Google." +msgstr "Il recupero delle informazioni dell'utente da Google non è riuscito." #: cps/oauth_bb.py:274 #, python-format @@ -453,7 +453,7 @@ msgstr "Scollegato da %(oauth)s con successo." #: cps/oauth_bb.py:278 #, python-format msgid "Unlink to %(oauth)s failed." -msgstr "Scollegamento da %(oauth)s fallito.\"" +msgstr "Scollegamento da %(oauth)s fallito." #: cps/oauth_bb.py:281 #, python-format @@ -462,11 +462,11 @@ msgstr "Non collegato a %(oauth)s." #: cps/oauth_bb.py:309 msgid "GitHub Oauth error, please retry later." -msgstr "GitHub Oauth error, per favore riprova più tardi." +msgstr "GitHub errore Oauth, per favore riprova più tardi." #: cps/oauth_bb.py:328 msgid "Google Oauth error, please retry later." -msgstr "Google Oauth error, per favore riprova più tardi." +msgstr "Google errore Oauth, per favore riprova più tardi." #: cps/shelf.py:47 cps/shelf.py:99 msgid "Invalid shelf specified" @@ -572,7 +572,7 @@ msgstr "Aggiunto recentemente" #: cps/ub.py:59 msgid "Show recent books" -msgstr "Mostra i libri recenti" +msgstr "Mostra i libri più recenti" #: cps/templates/index.xml:17 cps/ub.py:60 msgid "Hot Books" @@ -614,7 +614,7 @@ msgstr "Per scoprire" #: cps/ub.py:76 msgid "Show random books" -msgstr "Mostra libro a caso" +msgstr "Mostra libri a caso" #: cps/templates/index.xml:75 cps/ub.py:77 msgid "Categories" @@ -667,11 +667,11 @@ msgstr "Mostra la selezione della valutazione" #: cps/templates/index.xml:96 cps/ub.py:97 msgid "File formats" -msgstr "Formati dei file" +msgstr "Formato file" #: cps/ub.py:99 msgid "Show file formats selection" -msgstr "Mostra la selezione dei formati dei file" +msgstr "Mostra la selezione del formato dei file" #: cps/updater.py:252 cps/updater.py:359 cps/updater.py:372 msgid "Unexpected data while reading update information" @@ -708,11 +708,11 @@ msgstr "Libri aggiunti di recente" #: cps/web.py:514 msgid "Best rated books" -msgstr "I libri con le migliori valutazioni" +msgstr "Libri con le migliori valutazioni" #: cps/templates/index.xml:38 cps/web.py:522 msgid "Random Books" -msgstr "Libri a caso" +msgstr "Libri casuali" #: cps/web.py:548 msgid "Books" @@ -763,19 +763,19 @@ msgstr "Lingua: %(name)s" #: cps/web.py:705 msgid "Publisher list" -msgstr "Lista degli editori" +msgstr "Elenco degli editori" #: cps/web.py:721 msgid "Series list" -msgstr "Lista delle serie" +msgstr "Elenco delle serie" #: cps/web.py:735 msgid "Ratings list" -msgstr "Lista delle valutazioni" +msgstr "Elenco delle valutazioni" #: cps/web.py:748 msgid "File formats list" -msgstr "Lista dei formati di file" +msgstr "Elenco dei formati" #: cps/web.py:776 msgid "Available languages" @@ -783,7 +783,7 @@ msgstr "Lingue disponibili" #: cps/web.py:793 msgid "Category list" -msgstr "Elenco categorie" +msgstr "Elenco delle categorie" #: cps/templates/layout.html:73 cps/web.py:807 msgid "Tasks" @@ -895,7 +895,7 @@ msgstr "Il token è scaduto" #: cps/web.py:1240 msgid "Success! Please return to your device" -msgstr "Successo! Torna al tuo dispositivo" +msgstr "Riuscito! Torna al tuo dispositivo" #: cps/web.py:1317 cps/web.py:1360 cps/web.py:1366 #, python-format @@ -1045,7 +1045,7 @@ msgstr "Amministrazione" #: cps/templates/admin.html:122 msgid "View Logfiles" -msgstr "Visualizza LogFiles" +msgstr "Visualizza LogFile" #: cps/templates/admin.html:123 msgid "Reconnect to Calibre DB" @@ -1217,7 +1217,7 @@ msgstr "Lingua" #: cps/templates/book_edit.html:113 cps/templates/search_form.html:137 msgid "Yes" -msgstr "Si" +msgstr "Sì" #: cps/templates/book_edit.html:114 cps/templates/search_form.html:138 msgid "No" @@ -1377,7 +1377,7 @@ msgstr "Livello di Log" #: cps/templates/config_edit.html:131 msgid "Location and name of logfile (calibre-web.log for no entry)" -msgstr "Percorso e nome del logfile (senza indicazioni sarà calibre-web.log)" +msgstr "Percorso e nome del Logfile (senza indicazioni sarà calibre-web.log)" #: cps/templates/config_edit.html:136 msgid "Enable Access Log" @@ -1385,11 +1385,11 @@ msgstr "Abilita l'Access Log" #: cps/templates/config_edit.html:139 msgid "Location and name of access logfile (access.log for no entry)" -msgstr "Percorso e nome del logfile di accesso (senza indicazioni sarà access.log)" +msgstr "Percorso e nome del Logfile di accesso (senza indicazioni sarà access.log)" #: cps/templates/config_edit.html:150 msgid "Feature Configuration" -msgstr "Configurazione della caratteristica" +msgstr "Ulteriori opzioni" #: cps/templates/config_edit.html:158 msgid "Enable uploading" @@ -1528,7 +1528,7 @@ msgstr "Utilizza il convertitore di Calibre" #: cps/templates/config_edit.html:308 msgid "E-Book converter settings" -msgstr "Configurazione del convertitore di e-book" +msgstr "Configurazione del convertitore di libri" #: cps/templates/config_edit.html:312 msgid "Path to convertertool" @@ -1585,7 +1585,7 @@ msgstr "Espressione regolare per ordinare la visualizzazione del titolo" #: cps/templates/config_view_edit.html:59 msgid "Tags for Mature Content" -msgstr "Tags per i libri per adulti" +msgstr "Tags dei libri per adulti" #: cps/templates/config_view_edit.html:73 msgid "Default settings for new users" @@ -1629,7 +1629,7 @@ msgstr "Visibilità di base per i nuovi utenti" #: cps/templates/config_view_edit.html:135 cps/templates/user_edit.html:76 msgid "Show random books in detail view" -msgstr "Mostra libri a caso nella vista dettagliata" +msgstr "Mostra libri scelti alleatoriamente nella vista dettagliata" #: cps/templates/config_view_edit.html:139 cps/templates/user_edit.html:89 msgid "Show mature content" @@ -1705,7 +1705,7 @@ msgstr "password SMTP" #: cps/templates/email_edit.html:35 msgid "From e-mail" -msgstr "Dall'email" +msgstr "E-mail mittente" #: cps/templates/email_edit.html:38 msgid "Save settings" @@ -1717,7 +1717,7 @@ msgstr "Salva le impostazioni e invia e-mail di test" #: cps/templates/email_edit.html:43 msgid "Allowed domains for registering" -msgstr "Dominii autorizzti alla registrazione" +msgstr "Dominii autorizzati alla registrazione" #: cps/templates/email_edit.html:46 cps/templates/email_edit.html:72 msgid "Add Domain" @@ -1749,7 +1749,7 @@ msgstr "Crea-segnala un problema" #: cps/templates/http_error.html:44 msgid "Back to home" -msgstr "Ritorno alla pagina principale" +msgstr "Ritorna alla pagina principale" #: cps/templates/index.html:5 msgid "Discover (Random Books)" @@ -1781,7 +1781,7 @@ msgstr "Gli ultimi libri" #: cps/templates/index.xml:42 msgid "Show Random Books" -msgstr "Mostra libri casuali" +msgstr "Mostra libri casualmente" #: cps/templates/index.xml:65 msgid "Books ordered by Author" @@ -1854,7 +1854,7 @@ msgstr "Registra" #: cps/templates/layout.html:116 cps/templates/layout.html:223 msgid "Uploading..." -msgstr "Carica" +msgstr "Carico..." #: cps/templates/layout.html:117 msgid "please don't refresh the page" @@ -1912,11 +1912,11 @@ msgstr "Accedi con magic link" #: cps/templates/logviewer.html:6 msgid "Show Calibre-Web log: " -msgstr "" +msgstr "Mostra il log di Calibre-Web: " #: cps/templates/logviewer.html:8 msgid "Calibre-Web log: " -msgstr "Mostra il log Calibre-Web" +msgstr "Calibre-Web" log: " #: cps/templates/logviewer.html:8 msgid "Stream output, can't be displayed" @@ -1924,7 +1924,7 @@ msgstr "Flusso attivo, non può essere visualizzato" #: cps/templates/logviewer.html:12 msgid "Show access log: " -msgstr "Mostra il log di accesso" +msgstr "Mostra il log di accesso: " #: cps/templates/osd.xml:5 msgid "Calibre-Web ebook catalog" @@ -2072,7 +2072,7 @@ msgstr "Nessun risultato per:" #: cps/templates/search.html:6 msgid "Please try a different search" -msgstr "Prova una ricerca diversa" +msgstr "Prova una ricerca differente" #: cps/templates/search.html:8 msgid "Results for:" @@ -2116,7 +2116,7 @@ msgstr "Valutazione inferiore a" #: cps/templates/shelf.html:10 msgid "Delete this Shelf" -msgstr "Cancellare questo scaffale" +msgstr "Cancella questo scaffale" #: cps/templates/shelf.html:11 msgid "Edit Shelf" @@ -2144,7 +2144,7 @@ msgstr "Riordina tramite drag and drop" #: cps/templates/stats.html:7 msgid "Calibre library statistics" -msgstr "Statistiche libreria Calibre" +msgstr "Statistiche della libreria di Calibre" #: cps/templates/stats.html:12 msgid "Books in this Library" @@ -2220,11 +2220,11 @@ msgstr "E-mail di Kindle" #: cps/templates/user_edit.html:41 msgid "Show books with language" -msgstr "Mostra libri per lingua" +msgstr "Mostra libri in " #: cps/templates/user_edit.html:43 msgid "Show all" -msgstr "Mostra tutto" +msgstr "Mostra libri in tutte le lingue presenti" #: cps/templates/user_edit.html:53 msgid "OAuth Settings" @@ -3513,7 +3513,7 @@ msgstr "Download recenti" #~ msgstr "La copertina non è un file in formato jpg: non posso salvare" #~ msgid "Preparing document for printing..." -#~ msgstr "Preparo documento per la stampa..." +#~ msgstr "Preparo il documento per la stampa..." #~ msgid "Using your another device, visit" #~ msgstr "Utilizza il tuo altro dispositivo, visita" @@ -3522,10 +3522,10 @@ msgstr "Download recenti" #~ msgstr "e accedi" #~ msgid "Using your another device, login and visit " -#~ msgstr "Utilizza il tuo altro apparecchio, collegati e visita" +#~ msgstr "Utilizza il tuo altro apparecchio, collegati e visita " #~ msgid "Newest Books" -#~ msgstr "I libri più nuovi" +#~ msgstr "I libri più recenti" #~ msgid "Oldest Books" #~ msgstr "I libri più vecchi" From 4087e685f4fb5568410831dd312eec286a0e7067 Mon Sep 17 00:00:00 2001 From: Ozzieisaacs Date: Sat, 1 Feb 2020 13:40:29 +0100 Subject: [PATCH 4/9] Fix auto detection of locale --- cps/__init__.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cps/__init__.py b/cps/__init__.py index abcc4cbb..6c241d4f 100755 --- a/cps/__init__.py +++ b/cps/__init__.py @@ -116,14 +116,13 @@ def get_locale(): if user.nickname != 'Guest': # if the account is the guest account bypass the config lang settings return user.locale - preferred = set() + preferred = list() if request.accept_languages: for x in request.accept_languages.values(): try: - preferred.add(str(LC.parse(x.replace('-', '_')))) + preferred.append(str(LC.parse(x.replace('-', '_')))) except (UnknownLocaleError, ValueError) as e: - log.warning('Could not parse locale "%s": %s', x, e) - # preferred.append('en') + log.debug('Could not parse locale "%s": %s', x, e) return negotiate_locale(preferred or ['en'], _BABEL_TRANSLATIONS) From b33a2ac90d2964075d3bc8ef21d49005a81de46d Mon Sep 17 00:00:00 2001 From: Ozzieisaacs Date: Sun, 2 Feb 2020 07:47:27 +0100 Subject: [PATCH 5/9] Fix #1170 Auth-digest Header no longer crashs calibre-web Fix #1161 Shelfs are reordering again Update Sortable.js to 2.10.1 Code cosmetics --- cps/shelf.py | 17 +++++++--- cps/static/js/get_meta.js | 51 ++++++++++++++++-------------- cps/static/js/libs/Sortable.min.js | 4 +-- cps/static/js/shelforder.js | 2 +- cps/web.py | 2 +- 5 files changed, 44 insertions(+), 32 deletions(-) diff --git a/cps/shelf.py b/cps/shelf.py index 1d24c4f1..ff58395d 100644 --- a/cps/shelf.py +++ b/cps/shelf.py @@ -284,8 +284,14 @@ def show_shelf(shelf_type, shelf_id): books_in_shelf = ub.session.query(ub.BookShelf).filter(ub.BookShelf.shelf == shelf_id)\ .order_by(ub.BookShelf.order.asc()).all() - books_list = [ b.book_id for b in books_in_shelf] - result = db.session.query(db.Books).filter(db.Books.id.in_(books_list)).filter(common_filters()).all() + for book in books_in_shelf: + 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), shelf=shelf, page="shelf") else: @@ -317,8 +323,11 @@ def order_shelf(shelf_id): if shelf: books_in_shelf2 = ub.session.query(ub.BookShelf).filter(ub.BookShelf.shelf == shelf_id) \ .order_by(ub.BookShelf.order.asc()).all() - 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() + for book in books_in_shelf2: + cur_book = db.session.query(db.Books).filter(db.Books.id == book.book_id).filter(common_filters()).first() + 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, title=_(u"Change order of Shelf: '%(name)s'", name=shelf.name), shelf=shelf, page="shelforder") diff --git a/cps/static/js/get_meta.js b/cps/static/js/get_meta.js index a453b092..77c53f51 100644 --- a/cps/static/js/get_meta.js +++ b/cps/static/js/get_meta.js @@ -19,7 +19,7 @@ * 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) */ -/* global _, i18nMsg, tinymce */ +/* global _, i18nMsg, tinymce */ var dbResults = []; var ggResults = []; @@ -55,9 +55,9 @@ $(function () { $(".cover img").attr("src", book.cover); $("#cover_url").val(book.cover); $("#pubdate").val(book.publishedDate); - $("#publisher").val(book.publisher) - if (book.series != undefined) { - $("#series").val(book.series) + $("#publisher").val(book.publisher); + if (typeof book.series !== "undefined") { + $("#series").val(book.series); } } @@ -72,16 +72,18 @@ $(function () { } function formatDate (date) { var d = new Date(date), - month = '' + (d.getMonth() + 1), - day = '' + d.getDate(), + month = "" + (d.getMonth() + 1), + day = "" + d.getDate(), year = d.getFullYear(); - - if (month.length < 2) - month = '0' + month; - if (day.length < 2) - day = '0' + day; - - return [year, month, day].join('-'); + + if (month.length < 2) { + month = "0" + month; + } + if (day.length < 2) { + day = "0" + day; + } + + return [year, month, day].join("-"); } if (ggDone && ggResults.length > 0) { @@ -116,16 +118,17 @@ $(function () { } if (dbDone && dbResults.length > 0) { dbResults.forEach(function(result) { - if (result.series){ - var series_title = result.series.title + var seriesTitle = ""; + if (result.series) { + seriesTitle = result.series.title; } - var date_fomers = result.pubdate.split("-") - var publishedYear = parseInt(date_fomers[0]) - var publishedMonth = parseInt(date_fomers[1]) - var publishedDate = new Date(publishedYear, publishedMonth-1, 1) + var dateFomers = result.pubdate.split("-"); + var publishedYear = parseInt(dateFomers[0]); + var publishedMonth = parseInt(dateFomers[1]); + var publishedDate = new Date(publishedYear, publishedMonth - 1, 1); + + publishedDate = formatDate(publishedDate); - publishedDate = formatDate(publishedDate) - var book = { id: result.id, title: result.title, @@ -137,7 +140,7 @@ $(function () { return tag.title.toLowerCase().replace(/,/g, "_"); }), rating: result.rating.average || 0, - series: series_title || "", + series: seriesTitle || "", cover: result.image, url: "https://book.douban.com/subject/" + result.id, source: { @@ -183,7 +186,7 @@ $(function () { } function dbSearchBook (title) { - apikey="0df993c66c0c636e29ecbb5344252a4a" + var apikey = "0df993c66c0c636e29ecbb5344252a4a"; $.ajax({ url: douban + dbSearch + "?apikey=" + apikey + "&q=" + title + "&fields=all&count=10", type: "GET", @@ -193,7 +196,7 @@ $(function () { dbResults = data.books; }, error: function error() { - $("#meta-info").html("

" + msg.search_error + "!

"+ $("#meta-info")[0].innerHTML) + $("#meta-info").html("

" + msg.search_error + "!

" + $("#meta-info")[0].innerHTML); }, complete: function complete() { dbDone = true; diff --git a/cps/static/js/libs/Sortable.min.js b/cps/static/js/libs/Sortable.min.js index e95d2a30..eba06149 100644 --- a/cps/static/js/libs/Sortable.min.js +++ b/cps/static/js/libs/Sortable.min.js @@ -1,2 +1,2 @@ -/*! Sortable 1.4.2 - MIT | git://github.com/rubaxa/Sortable.git */ -!function(a){"use strict";"function"==typeof define&&define.amd?define(a):"undefined"!=typeof module&&"undefined"!=typeof module.exports?module.exports=a():"undefined"!=typeof Package?Sortable=a():window.Sortable=a()}(function(){"use strict";function a(a,b){if(!a||!a.nodeType||1!==a.nodeType)throw"Sortable: `el` must be HTMLElement, and not "+{}.toString.call(a);this.el=a,this.options=b=r({},b),a[L]=this;var c={group:Math.random(),sort:!0,disabled:!1,store:null,handle:null,scroll:!0,scrollSensitivity:30,scrollSpeed:10,draggable:/[uo]l/i.test(a.nodeName)?"li":">*",ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",ignore:"a, img",filter:null,animation:0,setData:function(a,b){a.setData("Text",b.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1};for(var d in c)!(d in b)&&(b[d]=c[d]);V(b);for(var f in this)"_"===f.charAt(0)&&(this[f]=this[f].bind(this));this.nativeDraggable=b.forceFallback?!1:P,e(a,"mousedown",this._onTapStart),e(a,"touchstart",this._onTapStart),this.nativeDraggable&&(e(a,"dragover",this),e(a,"dragenter",this)),T.push(this._onDragOver),b.store&&this.sort(b.store.get(this))}function b(a){v&&v.state!==a&&(h(v,"display",a?"none":""),!a&&v.state&&w.insertBefore(v,s),v.state=a)}function c(a,b,c){if(a){c=c||N,b=b.split(".");var d=b.shift().toUpperCase(),e=new RegExp("\\s("+b.join("|")+")(?=\\s)","g");do if(">*"===d&&a.parentNode===c||(""===d||a.nodeName.toUpperCase()==d)&&(!b.length||((" "+a.className+" ").match(e)||[]).length==b.length))return a;while(a!==c&&(a=a.parentNode))}return null}function d(a){a.dataTransfer&&(a.dataTransfer.dropEffect="move"),a.preventDefault()}function e(a,b,c){a.addEventListener(b,c,!1)}function f(a,b,c){a.removeEventListener(b,c,!1)}function g(a,b,c){if(a)if(a.classList)a.classList[c?"add":"remove"](b);else{var d=(" "+a.className+" ").replace(K," ").replace(" "+b+" "," ");a.className=(d+(c?" "+b:"")).replace(K," ")}}function h(a,b,c){var d=a&&a.style;if(d){if(void 0===c)return N.defaultView&&N.defaultView.getComputedStyle?c=N.defaultView.getComputedStyle(a,""):a.currentStyle&&(c=a.currentStyle),void 0===b?c:c[b];b in d||(b="-webkit-"+b),d[b]=c+("string"==typeof c?"":"px")}}function i(a,b,c){if(a){var d=a.getElementsByTagName(b),e=0,f=d.length;if(c)for(;f>e;e++)c(d[e],e);return d}return[]}function j(a,b,c,d,e,f,g){var h=N.createEvent("Event"),i=(a||b[L]).options,j="on"+c.charAt(0).toUpperCase()+c.substr(1);h.initEvent(c,!0,!0),h.to=b,h.from=e||b,h.item=d||b,h.clone=v,h.oldIndex=f,h.newIndex=g,b.dispatchEvent(h),i[j]&&i[j].call(a,h)}function k(a,b,c,d,e,f){var g,h,i=a[L],j=i.options.onMove;return g=N.createEvent("Event"),g.initEvent("move",!0,!0),g.to=b,g.from=a,g.dragged=c,g.draggedRect=d,g.related=e||b,g.relatedRect=f||b.getBoundingClientRect(),a.dispatchEvent(g),j&&(h=j.call(i,g)),h}function l(a){a.draggable=!1}function m(){R=!1}function n(a,b){var c=a.lastElementChild,d=c.getBoundingClientRect();return(b.clientY-(d.top+d.height)>5||b.clientX-(d.right+d.width)>5)&&c}function o(a){for(var b=a.tagName+a.className+a.src+a.href+a.textContent,c=b.length,d=0;c--;)d+=b.charCodeAt(c);return d.toString(36)}function p(a){var b=0;if(!a||!a.parentNode)return-1;for(;a&&(a=a.previousElementSibling);)"TEMPLATE"!==a.nodeName.toUpperCase()&&b++;return b}function q(a,b){var c,d;return function(){void 0===c&&(c=arguments,d=this,setTimeout(function(){1===c.length?a.call(d,c[0]):a.apply(d,c),c=void 0},b))}}function r(a,b){if(a&&b)for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a}var s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J={},K=/\s+/g,L="Sortable"+(new Date).getTime(),M=window,N=M.document,O=M.parseInt,P=!!("draggable"in N.createElement("div")),Q=function(a){return a=N.createElement("x"),a.style.cssText="pointer-events:auto","auto"===a.style.pointerEvents}(),R=!1,S=Math.abs,T=([].slice,[]),U=q(function(a,b,c){if(c&&b.scroll){var d,e,f,g,h=b.scrollSensitivity,i=b.scrollSpeed,j=a.clientX,k=a.clientY,l=window.innerWidth,m=window.innerHeight;if(z!==c&&(y=b.scroll,z=c,y===!0)){y=c;do if(y.offsetWidth=l-j)-(h>=j),g=(h>=m-k)-(h>=k),(f||g)&&(d=M)),(J.vx!==f||J.vy!==g||J.el!==d)&&(J.el=d,J.vx=f,J.vy=g,clearInterval(J.pid),d&&(J.pid=setInterval(function(){d===M?M.scrollTo(M.pageXOffset+f*i,M.pageYOffset+g*i):(g&&(d.scrollTop+=g*i),f&&(d.scrollLeft+=f*i))},24)))}},30),V=function(a){var b=a.group;b&&"object"==typeof b||(b=a.group={name:b}),["pull","put"].forEach(function(a){a in b||(b[a]=!0)}),a.groups=" "+b.name+(b.put.join?" "+b.put.join(" "):"")+" "};return a.prototype={constructor:a,_onTapStart:function(a){var b=this,d=this.el,e=this.options,f=a.type,g=a.touches&&a.touches[0],h=(g||a).target,i=h,k=e.filter;if(!("mousedown"===f&&0!==a.button||e.disabled)&&(h=c(h,e.draggable,d))){if(D=p(h),"function"==typeof k){if(k.call(this,a,h,this))return j(b,i,"filter",h,d,D),void a.preventDefault()}else if(k&&(k=k.split(",").some(function(a){return a=c(i,a.trim(),d),a?(j(b,a,"filter",h,d,D),!0):void 0})))return void a.preventDefault();(!e.handle||c(i,e.handle,d))&&this._prepareDragStart(a,g,h)}},_prepareDragStart:function(a,b,c){var d,f=this,h=f.el,j=f.options,k=h.ownerDocument;c&&!s&&c.parentNode===h&&(G=a,w=h,s=c,t=s.parentNode,x=s.nextSibling,F=j.group,d=function(){f._disableDelayedDrag(),s.draggable=!0,g(s,f.options.chosenClass,!0),f._triggerDragStart(b)},j.ignore.split(",").forEach(function(a){i(s,a.trim(),l)}),e(k,"mouseup",f._onDrop),e(k,"touchend",f._onDrop),e(k,"touchcancel",f._onDrop),j.delay?(e(k,"mouseup",f._disableDelayedDrag),e(k,"touchend",f._disableDelayedDrag),e(k,"touchcancel",f._disableDelayedDrag),e(k,"mousemove",f._disableDelayedDrag),e(k,"touchmove",f._disableDelayedDrag),f._dragStartTimer=setTimeout(d,j.delay)):d())},_disableDelayedDrag:function(){var a=this.el.ownerDocument;clearTimeout(this._dragStartTimer),f(a,"mouseup",this._disableDelayedDrag),f(a,"touchend",this._disableDelayedDrag),f(a,"touchcancel",this._disableDelayedDrag),f(a,"mousemove",this._disableDelayedDrag),f(a,"touchmove",this._disableDelayedDrag)},_triggerDragStart:function(a){a?(G={target:s,clientX:a.clientX,clientY:a.clientY},this._onDragStart(G,"touch")):this.nativeDraggable?(e(s,"dragend",this),e(w,"dragstart",this._onDragStart)):this._onDragStart(G,!0);try{N.selection?N.selection.empty():window.getSelection().removeAllRanges()}catch(b){}},_dragStarted:function(){w&&s&&(g(s,this.options.ghostClass,!0),a.active=this,j(this,w,"start",s,w,D))},_emulateDragOver:function(){if(H){if(this._lastX===H.clientX&&this._lastY===H.clientY)return;this._lastX=H.clientX,this._lastY=H.clientY,Q||h(u,"display","none");var a=N.elementFromPoint(H.clientX,H.clientY),b=a,c=" "+this.options.group.name,d=T.length;if(b)do{if(b[L]&&b[L].options.groups.indexOf(c)>-1){for(;d--;)T[d]({clientX:H.clientX,clientY:H.clientY,target:a,rootEl:b});break}a=b}while(b=b.parentNode);Q||h(u,"display","")}},_onTouchMove:function(b){if(G){a.active||this._dragStarted(),this._appendGhost();var c=b.touches?b.touches[0]:b,d=c.clientX-G.clientX,e=c.clientY-G.clientY,f=b.touches?"translate3d("+d+"px,"+e+"px,0)":"translate("+d+"px,"+e+"px)";I=!0,H=c,h(u,"webkitTransform",f),h(u,"mozTransform",f),h(u,"msTransform",f),h(u,"transform",f),b.preventDefault()}},_appendGhost:function(){if(!u){var a,b=s.getBoundingClientRect(),c=h(s),d=this.options;u=s.cloneNode(!0),g(u,d.ghostClass,!1),g(u,d.fallbackClass,!0),h(u,"top",b.top-O(c.marginTop,10)),h(u,"left",b.left-O(c.marginLeft,10)),h(u,"width",b.width),h(u,"height",b.height),h(u,"opacity","0.8"),h(u,"position","fixed"),h(u,"zIndex","100000"),h(u,"pointerEvents","none"),d.fallbackOnBody&&N.body.appendChild(u)||w.appendChild(u),a=u.getBoundingClientRect(),h(u,"width",2*b.width-a.width),h(u,"height",2*b.height-a.height)}},_onDragStart:function(a,b){var c=a.dataTransfer,d=this.options;this._offUpEvents(),"clone"==F.pull&&(v=s.cloneNode(!0),h(v,"display","none"),w.insertBefore(v,s)),b?("touch"===b?(e(N,"touchmove",this._onTouchMove),e(N,"touchend",this._onDrop),e(N,"touchcancel",this._onDrop)):(e(N,"mousemove",this._onTouchMove),e(N,"mouseup",this._onDrop)),this._loopId=setInterval(this._emulateDragOver,50)):(c&&(c.effectAllowed="move",d.setData&&d.setData.call(this,c,s)),e(N,"drop",this),setTimeout(this._dragStarted,0))},_onDragOver:function(a){var d,e,f,g=this.el,i=this.options,j=i.group,l=j.put,o=F===j,p=i.sort;if(void 0!==a.preventDefault&&(a.preventDefault(),!i.dragoverBubble&&a.stopPropagation()),I=!0,F&&!i.disabled&&(o?p||(f=!w.contains(s)):F.pull&&l&&(F.name===j.name||l.indexOf&&~l.indexOf(F.name)))&&(void 0===a.rootEl||a.rootEl===this.el)){if(U(a,i,this.el),R)return;if(d=c(a.target,i.draggable,g),e=s.getBoundingClientRect(),f)return b(!0),void(v||x?w.insertBefore(s,v||x):p||w.appendChild(s));if(0===g.children.length||g.children[0]===u||g===a.target&&(d=n(g,a))){if(d){if(d.animated)return;r=d.getBoundingClientRect()}b(o),k(w,g,s,e,d,r)!==!1&&(s.contains(g)||(g.appendChild(s),t=g),this._animate(e,s),d&&this._animate(r,d))}else if(d&&!d.animated&&d!==s&&void 0!==d.parentNode[L]){A!==d&&(A=d,B=h(d),C=h(d.parentNode));var q,r=d.getBoundingClientRect(),y=r.right-r.left,z=r.bottom-r.top,D=/left|right|inline/.test(B.cssFloat+B.display)||"flex"==C.display&&0===C["flex-direction"].indexOf("row"),E=d.offsetWidth>s.offsetWidth,G=d.offsetHeight>s.offsetHeight,H=(D?(a.clientX-r.left)/y:(a.clientY-r.top)/z)>.5,J=d.nextElementSibling,K=k(w,g,s,e,d,r);if(K!==!1){if(R=!0,setTimeout(m,30),b(o),1===K||-1===K)q=1===K;else if(D){var M=s.offsetTop,N=d.offsetTop;q=M===N?d.previousElementSibling===s&&!E||H&&E:N>M}else q=J!==s&&!G||H&&G;s.contains(g)||(q&&!J?g.appendChild(s):d.parentNode.insertBefore(s,q?J:d)),t=s.parentNode,this._animate(e,s),this._animate(r,d)}}}},_animate:function(a,b){var c=this.options.animation;if(c){var d=b.getBoundingClientRect();h(b,"transition","none"),h(b,"transform","translate3d("+(a.left-d.left)+"px,"+(a.top-d.top)+"px,0)"),b.offsetWidth,h(b,"transition","all "+c+"ms"),h(b,"transform","translate3d(0,0,0)"),clearTimeout(b.animated),b.animated=setTimeout(function(){h(b,"transition",""),h(b,"transform",""),b.animated=!1},c)}},_offUpEvents:function(){var a=this.el.ownerDocument;f(N,"touchmove",this._onTouchMove),f(a,"mouseup",this._onDrop),f(a,"touchend",this._onDrop),f(a,"touchcancel",this._onDrop)},_onDrop:function(b){var c=this.el,d=this.options;clearInterval(this._loopId),clearInterval(J.pid),clearTimeout(this._dragStartTimer),f(N,"mousemove",this._onTouchMove),this.nativeDraggable&&(f(N,"drop",this),f(c,"dragstart",this._onDragStart)),this._offUpEvents(),b&&(I&&(b.preventDefault(),!d.dropBubble&&b.stopPropagation()),u&&u.parentNode.removeChild(u),s&&(this.nativeDraggable&&f(s,"dragend",this),l(s),g(s,this.options.ghostClass,!1),g(s,this.options.chosenClass,!1),w!==t?(E=p(s),E>=0&&(j(null,t,"sort",s,w,D,E),j(this,w,"sort",s,w,D,E),j(null,t,"add",s,w,D,E),j(this,w,"remove",s,w,D,E))):(v&&v.parentNode.removeChild(v),s.nextSibling!==x&&(E=p(s),E>=0&&(j(this,w,"update",s,w,D,E),j(this,w,"sort",s,w,D,E)))),a.active&&((null===E||-1===E)&&(E=D),j(this,w,"end",s,w,D,E),this.save())),w=s=t=u=x=v=y=z=G=H=I=E=A=B=F=a.active=null)},handleEvent:function(a){var b=a.type;"dragover"===b||"dragenter"===b?s&&(this._onDragOver(a),d(a)):("drop"===b||"dragend"===b)&&this._onDrop(a)},toArray:function(){for(var a,b=[],d=this.el.children,e=0,f=d.length,g=this.options;f>e;e++)a=d[e],c(a,g.draggable,this.el)&&b.push(a.getAttribute(g.dataIdAttr)||o(a));return b},sort:function(a){var b={},d=this.el;this.toArray().forEach(function(a,e){var f=d.children[e];c(f,this.options.draggable,d)&&(b[a]=f)},this),a.forEach(function(a){b[a]&&(d.removeChild(b[a]),d.appendChild(b[a]))})},save:function(){var a=this.options.store;a&&a.set(this)},closest:function(a,b){return c(a,b||this.options.draggable,this.el)},option:function(a,b){var c=this.options;return void 0===b?c[a]:(c[a]=b,void("group"===a&&V(c)))},destroy:function(){var a=this.el;a[L]=null,f(a,"mousedown",this._onTapStart),f(a,"touchstart",this._onTapStart),this.nativeDraggable&&(f(a,"dragover",this),f(a,"dragenter",this)),Array.prototype.forEach.call(a.querySelectorAll("[draggable]"),function(a){a.removeAttribute("draggable")}),T.splice(T.indexOf(this._onDragOver),1),this._onDrop(),this.el=a=null}},a.utils={on:e,off:f,css:h,find:i,is:function(a,b){return!!c(a,b,a)},extend:r,throttle:q,closest:c,toggleClass:g,index:p},a.create=function(b,c){return new a(b,c)},a.version="1.4.2",a}); \ No newline at end of file +/*! Sortable 1.10.2 - MIT | git://github.com/SortableJS/Sortable.git */ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).Sortable=e()}(this,function(){"use strict";function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function a(){return(a=Object.assign||function(t){for(var e=1;e"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){return!1}return!1}}function P(t,e,n,o){if(t){n=n||document;do{if(null!=e&&(">"===e[0]?t.parentNode===n&&h(t,e):h(t,e))||o&&t===n)return t;if(t===n)break}while(t=(i=t).host&&i!==document&&i.host.nodeType?i.host:i.parentNode)}var i;return null}var f,p=/\s+/g;function k(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var o=(" "+t.className+" ").replace(p," ").replace(" "+e+" "," ");t.className=(o+(n?" "+e:"")).replace(p," ")}}function R(t,e,n){var o=t&&t.style;if(o){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];e in o||-1!==e.indexOf("webkit")||(e="-webkit-"+e),o[e]=n+("string"==typeof n?"":"px")}}function v(t,e){var n="";if("string"==typeof t)n=t;else do{var o=R(t,"transform");o&&"none"!==o&&(n=o+" "+n)}while(!e&&(t=t.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function g(t,e,n){if(t){var o=t.getElementsByTagName(e),i=0,r=o.length;if(n)for(;i=e.left-n&&r<=e.right+n,i=a>=e.top-n&&a<=e.bottom+n;return n&&o&&i?l=t:void 0}}),l}((t=t.touches?t.touches[0]:t).clientX,t.clientY);if(e){var n={};for(var o in t)t.hasOwnProperty(o)&&(n[o]=t[o]);n.target=n.rootEl=e,n.preventDefault=void 0,n.stopPropagation=void 0,e[j]._onDragOver(n)}}}function kt(t){z&&z.parentNode[j]._isOutsideThisEl(t.target)}function Rt(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=a({},e),t[j]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Ot(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==Rt.supportPointer&&"PointerEvent"in window,emptyInsertThreshold:5};for(var o in O.initializePlugins(this,t,n),n)o in e||(e[o]=n[o]);for(var i in At(e),this)"_"===i.charAt(0)&&"function"==typeof this[i]&&(this[i]=this[i].bind(this));this.nativeDraggable=!e.forceFallback&&xt,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?u(t,"pointerdown",this._onTapStart):(u(t,"mousedown",this._onTapStart),u(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(u(t,"dragover",this),u(t,"dragenter",this)),bt.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),a(this,T())}function Xt(t,e,n,o,i,r,a,l){var s,c,u=t[j],d=u.options.onMove;return!window.CustomEvent||w||E?(s=document.createEvent("Event")).initEvent("move",!0,!0):s=new CustomEvent("move",{bubbles:!0,cancelable:!0}),s.to=e,s.from=t,s.dragged=n,s.draggedRect=o,s.related=i||e,s.relatedRect=r||X(e),s.willInsertAfter=l,s.originalEvent=a,t.dispatchEvent(s),d&&(c=d.call(u,s,a)),c}function Yt(t){t.draggable=!1}function Bt(){Dt=!1}function Ft(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,o=0;n--;)o+=e.charCodeAt(n);return o.toString(36)}function Ht(t){return setTimeout(t,0)}function Lt(t){return clearTimeout(t)}Rt.prototype={constructor:Rt,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(ht=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,z):this.options.direction},_onTapStart:function(e){if(e.cancelable){var n=this,o=this.el,t=this.options,i=t.preventOnFilter,r=e.type,a=e.touches&&e.touches[0]||e.pointerType&&"touch"===e.pointerType&&e,l=(a||e).target,s=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||l,c=t.filter;if(function(t){St.length=0;var e=t.getElementsByTagName("input"),n=e.length;for(;n--;){var o=e[n];o.checked&&St.push(o)}}(o),!z&&!(/mousedown|pointerdown/.test(r)&&0!==e.button||t.disabled||s.isContentEditable||(l=P(l,t.draggable,o,!1))&&l.animated||Z===l)){if(J=F(l),et=F(l,t.draggable),"function"==typeof c){if(c.call(this,e,l,this))return W({sortable:n,rootEl:s,name:"filter",targetEl:l,toEl:o,fromEl:o}),K("filter",n,{evt:e}),void(i&&e.cancelable&&e.preventDefault())}else if(c&&(c=c.split(",").some(function(t){if(t=P(s,t.trim(),o,!1))return W({sortable:n,rootEl:t,name:"filter",targetEl:l,fromEl:o,toEl:o}),K("filter",n,{evt:e}),!0})))return void(i&&e.cancelable&&e.preventDefault());t.handle&&!P(s,t.handle,o,!1)||this._prepareDragStart(e,a,l)}}},_prepareDragStart:function(t,e,n){var o,i=this,r=i.el,a=i.options,l=r.ownerDocument;if(n&&!z&&n.parentNode===r){var s=X(n);if(q=r,G=(z=n).parentNode,V=z.nextSibling,Z=n,ot=a.group,rt={target:Rt.dragged=z,clientX:(e||t).clientX,clientY:(e||t).clientY},ct=rt.clientX-s.left,ut=rt.clientY-s.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,z.style["will-change"]="all",o=function(){K("delayEnded",i,{evt:t}),Rt.eventCanceled?i._onDrop():(i._disableDelayedDragEvents(),!c&&i.nativeDraggable&&(z.draggable=!0),i._triggerDragStart(t,e),W({sortable:i,name:"choose",originalEvent:t}),k(z,a.chosenClass,!0))},a.ignore.split(",").forEach(function(t){g(z,t.trim(),Yt)}),u(l,"dragover",Pt),u(l,"mousemove",Pt),u(l,"touchmove",Pt),u(l,"mouseup",i._onDrop),u(l,"touchend",i._onDrop),u(l,"touchcancel",i._onDrop),c&&this.nativeDraggable&&(this.options.touchStartThreshold=4,z.draggable=!0),K("delayStart",this,{evt:t}),!a.delay||a.delayOnTouchOnly&&!e||this.nativeDraggable&&(E||w))o();else{if(Rt.eventCanceled)return void this._onDrop();u(l,"mouseup",i._disableDelayedDrag),u(l,"touchend",i._disableDelayedDrag),u(l,"touchcancel",i._disableDelayedDrag),u(l,"mousemove",i._delayedDragTouchMoveHandler),u(l,"touchmove",i._delayedDragTouchMoveHandler),a.supportPointer&&u(l,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(o,a.delay)}}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){z&&Yt(z),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;d(t,"mouseup",this._disableDelayedDrag),d(t,"touchend",this._disableDelayedDrag),d(t,"touchcancel",this._disableDelayedDrag),d(t,"mousemove",this._delayedDragTouchMoveHandler),d(t,"touchmove",this._delayedDragTouchMoveHandler),d(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?u(document,"pointermove",this._onTouchMove):u(document,e?"touchmove":"mousemove",this._onTouchMove):(u(z,"dragend",this),u(q,"dragstart",this._onDragStart));try{document.selection?Ht(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(t,e){if(vt=!1,q&&z){K("dragStarted",this,{evt:e}),this.nativeDraggable&&u(document,"dragover",kt);var n=this.options;t||k(z,n.dragClass,!1),k(z,n.ghostClass,!0),Rt.active=this,t&&this._appendGhost(),W({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(at){this._lastX=at.clientX,this._lastY=at.clientY,Nt();for(var t=document.elementFromPoint(at.clientX,at.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(at.clientX,at.clientY))!==e;)e=t;if(z.parentNode[j]._isOutsideThisEl(t),e)do{if(e[j]){if(e[j]._onDragOver({clientX:at.clientX,clientY:at.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break}t=e}while(e=e.parentNode);It()}},_onTouchMove:function(t){if(rt){var e=this.options,n=e.fallbackTolerance,o=e.fallbackOffset,i=t.touches?t.touches[0]:t,r=U&&v(U,!0),a=U&&r&&r.a,l=U&&r&&r.d,s=Ct&>&&b(gt),c=(i.clientX-rt.clientX+o.x)/(a||1)+(s?s[0]-Et[0]:0)/(a||1),u=(i.clientY-rt.clientY+o.y)/(l||1)+(s?s[1]-Et[1]:0)/(l||1);if(!Rt.active&&!vt){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))o.right+10||t.clientX<=o.right&&t.clientY>o.bottom&&t.clientX>=o.left:t.clientX>o.right&&t.clientY>o.top||t.clientX<=o.right&&t.clientY>o.bottom+10}(n,a,this)&&!g.animated){if(g===z)return A(!1);if(g&&l===n.target&&(s=g),s&&(i=X(s)),!1!==Xt(q,l,z,o,s,i,n,!!s))return O(),l.appendChild(z),G=l,N(),A(!0)}else if(s.parentNode===l){i=X(s);var v,m,b,y=z.parentNode!==l,w=!function(t,e,n){var o=n?t.left:t.top,i=n?t.right:t.bottom,r=n?t.width:t.height,a=n?e.left:e.top,l=n?e.right:e.bottom,s=n?e.width:e.height;return o===a||i===l||o+r/2===a+s/2}(z.animated&&z.toRect||o,s.animated&&s.toRect||i,a),E=a?"top":"left",D=Y(s,"top","top")||Y(z,"top","top"),S=D?D.scrollTop:void 0;if(ht!==s&&(m=i[E],yt=!1,wt=!w&&e.invertSwap||y),0!==(v=function(t,e,n,o,i,r,a,l){var s=o?t.clientY:t.clientX,c=o?n.height:n.width,u=o?n.top:n.left,d=o?n.bottom:n.right,h=!1;if(!a)if(l&&pt Date: Sat, 8 Feb 2020 11:33:31 +0100 Subject: [PATCH 6/9] Improved testability --- cps/templates/shelf_order.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cps/templates/shelf_order.html b/cps/templates/shelf_order.html index 26fa2e35..77192c8c 100644 --- a/cps/templates/shelf_order.html +++ b/cps/templates/shelf_order.html @@ -29,7 +29,7 @@ {% endfor %} - {{_('Back')}} + {{_('Back')}} {% endblock %} From 2535bbbcf17bb43db8878f5bb94f335e66074456 Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Sat, 8 Feb 2020 13:24:01 +0100 Subject: [PATCH 7/9] Fix #1180 working on windows with tornado and python <3.8 again --- cps/server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cps/server.py b/cps/server.py index 43792ecd..8f060719 100755 --- a/cps/server.py +++ b/cps/server.py @@ -146,7 +146,7 @@ class WebServer(object): self.unix_socket_file = None def _start_tornado(self): - if os.name == 'nt': + if os.name == 'nt' and sys.version_info > (3, 7): import asyncio asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) log.info('Starting Tornado server on %s', _readable_listen_address(self.listen_address, self.listen_port)) From 482e977af496d14b1cce0eac4ae0435280ac0cdd Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Sat, 8 Feb 2020 13:27:51 +0100 Subject: [PATCH 8/9] Clarified installation procedure --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a3e05cd3..91b3eb16 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Calibre-Web is a web app providing a clean interface for browsing, reading and d ## 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) 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\ From e04aa80fd602ef0969ad15f62133a96f6968ce26 Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Sat, 8 Feb 2020 14:39:46 +0100 Subject: [PATCH 9/9] Fix #1181 and Fix #1182 handle removed "is_xhr" on werkzeug version 1.0.0 --- README.md | 2 +- cps/oauth_bb.py | 2 +- cps/shelf.py | 20 +++++++++++--------- cps/web.py | 4 ++-- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index a3e05cd3..91b3eb16 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Calibre-Web is a web app providing a clean interface for browsing, reading and d ## 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) 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\ diff --git a/cps/oauth_bb.py b/cps/oauth_bb.py index 092473da..5fdb95d8 100644 --- a/cps/oauth_bb.py +++ b/cps/oauth_bb.py @@ -50,7 +50,7 @@ def oauth_required(f): def inner(*args, **kwargs): if config.config_login_type == constants.LOGIN_OAUTH: return f(*args, **kwargs) - if request.is_xhr: + if request.headers.get('X-Requested-With') == 'XMLHttpRequest': data = {'status': 'error', 'message': 'Not Found'} response = make_response(json.dumps(data, ensure_ascii=False)) response.headers["Content-Type"] = "application/json; charset=utf-8" diff --git a/cps/shelf.py b/cps/shelf.py index ff58395d..9d52434d 100644 --- a/cps/shelf.py +++ b/cps/shelf.py @@ -40,17 +40,18 @@ log = logger.create() @shelf.route("/shelf/add//") @login_required 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() if shelf is None: log.error("Invalid shelf specified: %s", shelf_id) - if not request.is_xhr: + if not xhr: flash(_(u"Invalid shelf specified"), category="error") return redirect(url_for('web.index')) return "Invalid shelf specified", 400 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) - 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), category="error") return redirect(url_for('web.index')) @@ -58,7 +59,7 @@ def add_to_shelf(shelf_id, book_id): if shelf.is_public and not current_user.role_edit_shelfs(): 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") return redirect(url_for('web.index')) return "User is not allowed to edit public shelves", 403 @@ -67,7 +68,7 @@ def add_to_shelf(shelf_id, book_id): ub.BookShelf.book_id == book_id).first() if book_in_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") return redirect(url_for('web.index')) return "Book is already part of the shelf: %s" % shelf.name, 400 @@ -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) ub.session.add(ins) 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") if "HTTP_REFERER" in request.environ: return redirect(request.environ["HTTP_REFERER"]) @@ -147,10 +148,11 @@ def search_to_shelf(shelf_id): @shelf.route("/shelf/remove//") @login_required 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() if shelf is None: log.error("Invalid shelf specified: %s", shelf_id) - if not request.is_xhr: + if not xhr: return redirect(url_for('web.index')) return "Invalid shelf specified", 400 @@ -169,20 +171,20 @@ def remove_from_shelf(shelf_id, book_id): if book_shelf is None: 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 "Book already removed from shelf", 410 ub.session.delete(book_shelf) 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") return redirect(request.environ["HTTP_REFERER"]) return "", 204 else: 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), category="error") return redirect(url_for('web.index')) diff --git a/cps/web.py b/cps/web.py index 1a78cc52..ab38f3d4 100644 --- a/cps/web.py +++ b/cps/web.py @@ -172,7 +172,7 @@ def remote_login_required(f): def inner(*args, **kwargs): if config.config_remote_login: return f(*args, **kwargs) - if request.is_xhr: + if request.headers.get('X-Requested-With') == 'XMLHttpRequest': data = {'status': 'error', 'message': 'Forbidden'} response = make_response(json.dumps(data, ensure_ascii=False)) response.headers["Content-Type"] = "application/json; charset=utf-8" @@ -1468,7 +1468,7 @@ def show_book(book_id): audioentries.append(media_format.format.lower()) 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") else: log.debug(u"Error opening eBook. File does not exist or file is not accessible:")