From: Jan Szejko Date: Mon, 26 Feb 2018 10:54:24 +0000 (+0100) Subject: add pictures in search X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/cad95a5f21346628d1dffa3b50ffa8f38baa5972?hp=6cc6ca1a2aaf47a116807c53c6a69e6e580bc599 add pictures in search --- diff --git a/doc/schema.xml b/doc/schema.xml index 38d6edaad..b36c76241 100644 --- a/doc/schema.xml +++ b/doc/schema.xml @@ -155,6 +155,9 @@ + + + diff --git a/src/catalogue/locale/de/LC_MESSAGES/django.po b/src/catalogue/locale/de/LC_MESSAGES/django.po index 6a7d47ac4..8e44e1e05 100644 --- a/src/catalogue/locale/de/LC_MESSAGES/django.po +++ b/src/catalogue/locale/de/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-12-15 10:27+0100\n" +"POT-Creation-Date: 2018-02-26 13:13+0100\n" "PO-Revision-Date: 2013-04-09 10:38+0100\n" "Last-Translator: Radek Czajka \n" "Language-Team: LANGUAGE \n" @@ -157,91 +157,99 @@ msgstr "Groß" msgid "Queue is full. Please try again later." msgstr "" -#: models/book.py:49 models/collection.py:14 +#: models/book.py:55 models/collection.py:14 msgid "title" msgstr "Titel" -#: models/book.py:50 models/tag.py:58 +#: models/book.py:56 models/tag.py:58 msgid "sort key" msgstr "Sortierschlüssel" -#: models/book.py:52 +#: models/book.py:58 #, fuzzy #| msgid "Results by authors" msgid "sort key by author" msgstr "Ergebnisse nach Autoren" -#: models/book.py:53 models/book.py:54 models/collection.py:15 +#: models/book.py:59 models/book.py:60 models/collection.py:15 #: models/collection.py:18 models/tag.py:57 msgid "slug" msgstr "Slug" -#: models/book.py:55 +#: models/book.py:61 msgid "language code" msgstr "Sprachenkode" -#: models/book.py:56 models/book.py:224 models/collection.py:16 -#: models/tag.py:61 models/tag.py:183 +#: models/book.py:62 models/book.py:240 models/collection.py:16 +#: models/tag.py:61 models/tag.py:186 msgid "description" msgstr "Beschreibung" -#: models/book.py:57 models/bookmedia.py:36 models/tag.py:68 models/tag.py:69 +#: models/book.py:63 models/bookmedia.py:36 models/tag.py:71 models/tag.py:72 msgid "creation date" msgstr "Erstellungsdatum" -#: models/book.py:58 +#: models/book.py:64 #, fuzzy #| msgid "creation date" msgid "change date" msgstr "Erstellungsdatum" -#: models/book.py:59 +#: models/book.py:65 msgid "parent number" msgstr "Elternnummer" -#: models/book.py:60 models/bookmedia.py:37 +#: models/book.py:66 models/bookmedia.py:37 msgid "extra information" msgstr "zusätzliche Informationen" -#: models/book.py:63 +#: models/book.py:69 msgid "print on demand" msgstr "" -#: models/book.py:64 +#: models/book.py:70 msgid "recommended" msgstr "" -#: models/book.py:68 +#: models/book.py:74 msgid "cover" msgstr "Umschlag" -#: models/book.py:74 +#: models/book.py:80 msgid "cover thumbnail" msgstr "" -#: models/book.py:102 models/collection.py:22 +#: models/book.py:85 +msgid "cover thumbnail for mobile app" +msgstr "" + +#: models/book.py:90 +msgid "cover for mobile app" +msgstr "" + +#: models/book.py:118 models/collection.py:22 msgid "book" msgstr "Buch" -#: models/book.py:103 +#: models/book.py:119 msgid "books" msgstr "Bücher" -#: models/book.py:362 +#: models/book.py:378 #, python-format msgid "Book \"%s\" does not exist." msgstr "Buch mit dem Slug = \"%s\" ist nicht vorhanden." -#: models/book.py:375 +#: models/book.py:391 #, python-format msgid "Book %s already exists" msgstr "Buch %s ist bereits vorhanden" -#: models/book.py:633 +#: models/book.py:658 msgid "This work needs modernisation" msgstr "" -#: models/book.py:680 models/bookmedia.py:29 +#: models/book.py:705 models/bookmedia.py:29 #, python-format msgid "%s file" msgstr "%s XML-Datei" @@ -343,7 +351,7 @@ msgstr "Buchregal" msgid "thing" msgstr "" -#: models/tag.py:35 models/tag.py:93 +#: models/tag.py:35 models/tag.py:96 msgid "tag" msgstr "Tag" @@ -359,7 +367,7 @@ msgstr "Objekt ID" msgid "category" msgstr "Kategorie" -#: models/tag.py:94 +#: models/tag.py:97 msgid "tags" msgstr "Tags" @@ -411,14 +419,10 @@ msgid "Editor's Platform" msgstr "Editor-Plattform" #: templates/catalogue/book_detail.html:71 -msgid "Book description on Lektury.Gazeta.pl" -msgstr "Buchbeschreibung in Lektury.Gazeta.pl" - -#: templates/catalogue/book_detail.html:76 msgid "Book description on Wikipedia" msgstr "Buchbeschreibung in Wikipedia" -#: templates/catalogue/book_detail.html:80 +#: templates/catalogue/book_detail.html:75 msgid "Mix this book" msgstr "Passe dieses Buch zusammen" @@ -540,7 +544,7 @@ msgid "Print on demand –" msgstr "" #: templates/catalogue/book_short.html:104 -#: templates/catalogue/custom_pdf_form.html:19 views.py:599 +#: templates/catalogue/custom_pdf_form.html:19 views.py:369 msgid "Download" msgstr "Herunterladen" @@ -654,7 +658,7 @@ msgstr[1] "" msgid "All collections" msgstr "Sammlungen" -#: templates/catalogue/custom_pdf_form.html:6 views.py:598 +#: templates/catalogue/custom_pdf_form.html:6 views.py:368 msgid "Download custom PDF" msgstr "PDF-Datei herunterladen" @@ -710,11 +714,11 @@ msgstr "Quelle des Bildes" msgid "Image on the Editor's Platform" msgstr "Bild auf dem Editor-Plattform" -#: templates/catalogue/picture_detail.html:82 +#: templates/catalogue/picture_detail.html:73 msgid "View XML source" msgstr "Siehe XML-Quelle" -#: templates/catalogue/picture_detail.html:85 +#: templates/catalogue/picture_detail.html:76 msgid "Work's themes " msgstr "Motive des Werkes" @@ -795,6 +799,16 @@ msgstr "Suchen" msgid "Did you mean" msgstr "Haben Sie gemeint" +#: templates/catalogue/search_multiple_hits.html:31 +#, fuzzy +#| msgid "books" +msgid "Books" +msgstr "Bücher" + +#: templates/catalogue/search_multiple_hits.html:42 +msgid "Pictures" +msgstr "" + #: templates/catalogue/search_no_hits.html:20 #: templates/catalogue/tagged_object_list.html:85 msgid "Sorry! Search cirteria did not match any resources." @@ -913,15 +927,11 @@ msgstr "Motive und Themen" msgid "No description." msgstr "Beschreibung" -#: templates/catalogue/tagged_object_list.html:109 -msgid "in Lektury.Gazeta.pl" -msgstr "in Lektury.Gazeta.pl" - -#: templates/catalogue/tagged_object_list.html:115 +#: templates/catalogue/tagged_object_list.html:110 msgid "in Wikipedia" msgstr "in Wikipedia" -#: templates/catalogue/tagged_object_list.html:121 +#: templates/catalogue/tagged_object_list.html:116 msgid "in Culture.pl" msgstr "" @@ -931,7 +941,7 @@ msgstr "" msgid "Loading" msgstr "Zeilenabstand" -#: views.py:564 +#: views.py:334 #, python-format msgid "" "An error occurred: %(exception)s\n" @@ -942,15 +952,21 @@ msgstr "" "\n" "%(tb)s" -#: views.py:566 +#: views.py:336 msgid "Book imported successfully" msgstr "Buch wurde erfolgreich importiert" -#: views.py:568 +#: views.py:338 #, python-format msgid "Error importing file: %r" msgstr "Fehler beim Importieren der Datei: %r" +#~ msgid "Book description on Lektury.Gazeta.pl" +#~ msgstr "Buchbeschreibung in Lektury.Gazeta.pl" + +#~ msgid "in Lektury.Gazeta.pl" +#~ msgstr "in Lektury.Gazeta.pl" + #~ msgid "Results by title" #~ msgstr "Ergebnisse nach Titeln" diff --git a/src/catalogue/locale/en/LC_MESSAGES/django.po b/src/catalogue/locale/en/LC_MESSAGES/django.po index 51d87073b..3f92d1b8c 100644 --- a/src/catalogue/locale/en/LC_MESSAGES/django.po +++ b/src/catalogue/locale/en/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-12-15 10:27+0100\n" +"POT-Creation-Date: 2018-02-26 13:13+0100\n" "PO-Revision-Date: 2013-04-09 10:38+0100\n" "Last-Translator: Radek Czajka \n" "Language-Team: LANGUAGE \n" @@ -157,91 +157,99 @@ msgstr "Big" msgid "Queue is full. Please try again later." msgstr "" -#: models/book.py:49 models/collection.py:14 +#: models/book.py:55 models/collection.py:14 msgid "title" msgstr "Title" -#: models/book.py:50 models/tag.py:58 +#: models/book.py:56 models/tag.py:58 msgid "sort key" msgstr "Sort key" -#: models/book.py:52 +#: models/book.py:58 #, fuzzy #| msgid "Results by authors" msgid "sort key by author" msgstr "Results by authors" -#: models/book.py:53 models/book.py:54 models/collection.py:15 +#: models/book.py:59 models/book.py:60 models/collection.py:15 #: models/collection.py:18 models/tag.py:57 msgid "slug" msgstr "Slug" -#: models/book.py:55 +#: models/book.py:61 msgid "language code" msgstr "language code" -#: models/book.py:56 models/book.py:224 models/collection.py:16 -#: models/tag.py:61 models/tag.py:183 +#: models/book.py:62 models/book.py:240 models/collection.py:16 +#: models/tag.py:61 models/tag.py:186 msgid "description" msgstr "Description" -#: models/book.py:57 models/bookmedia.py:36 models/tag.py:68 models/tag.py:69 +#: models/book.py:63 models/bookmedia.py:36 models/tag.py:71 models/tag.py:72 msgid "creation date" msgstr "creation date" -#: models/book.py:58 +#: models/book.py:64 #, fuzzy #| msgid "creation date" msgid "change date" msgstr "creation date" -#: models/book.py:59 +#: models/book.py:65 msgid "parent number" msgstr "Parent number" -#: models/book.py:60 models/bookmedia.py:37 +#: models/book.py:66 models/bookmedia.py:37 msgid "extra information" msgstr "Additional information" -#: models/book.py:63 +#: models/book.py:69 msgid "print on demand" msgstr "" -#: models/book.py:64 +#: models/book.py:70 msgid "recommended" msgstr "" -#: models/book.py:68 +#: models/book.py:74 msgid "cover" msgstr "cover" -#: models/book.py:74 +#: models/book.py:80 msgid "cover thumbnail" msgstr "" -#: models/book.py:102 models/collection.py:22 +#: models/book.py:85 +msgid "cover thumbnail for mobile app" +msgstr "" + +#: models/book.py:90 +msgid "cover for mobile app" +msgstr "" + +#: models/book.py:118 models/collection.py:22 msgid "book" msgstr "book" -#: models/book.py:103 +#: models/book.py:119 msgid "books" msgstr "Books" -#: models/book.py:362 +#: models/book.py:378 #, python-format msgid "Book \"%s\" does not exist." msgstr "Book with stub = \"%s\" does not exist." -#: models/book.py:375 +#: models/book.py:391 #, python-format msgid "Book %s already exists" msgstr "Book %s already exists" -#: models/book.py:633 +#: models/book.py:658 msgid "This work needs modernisation" msgstr "" -#: models/book.py:680 models/bookmedia.py:29 +#: models/book.py:705 models/bookmedia.py:29 #, python-format msgid "%s file" msgstr "%s file" @@ -342,7 +350,7 @@ msgstr "set" msgid "thing" msgstr "" -#: models/tag.py:35 models/tag.py:93 +#: models/tag.py:35 models/tag.py:96 msgid "tag" msgstr "tag" @@ -358,7 +366,7 @@ msgstr "object id" msgid "category" msgstr "Category" -#: models/tag.py:94 +#: models/tag.py:97 msgid "tags" msgstr "tags" @@ -410,14 +418,10 @@ msgid "Editor's Platform" msgstr "Editor's Platform" #: templates/catalogue/book_detail.html:71 -msgid "Book description on Lektury.Gazeta.pl" -msgstr "Book description on Lektury.Gazeta.pl" - -#: templates/catalogue/book_detail.html:76 msgid "Book description on Wikipedia" msgstr "Book description on Wikipedia" -#: templates/catalogue/book_detail.html:80 +#: templates/catalogue/book_detail.html:75 msgid "Mix this book" msgstr "Mix this book" @@ -542,7 +546,7 @@ msgid "Print on demand –" msgstr "" #: templates/catalogue/book_short.html:104 -#: templates/catalogue/custom_pdf_form.html:19 views.py:599 +#: templates/catalogue/custom_pdf_form.html:19 views.py:369 msgid "Download" msgstr "Download" @@ -656,7 +660,7 @@ msgstr[1] "" msgid "All collections" msgstr "collections" -#: templates/catalogue/custom_pdf_form.html:6 views.py:598 +#: templates/catalogue/custom_pdf_form.html:6 views.py:368 msgid "Download custom PDF" msgstr "Download custom PDF" @@ -713,11 +717,11 @@ msgstr "Source of the image" msgid "Image on the Editor's Platform" msgstr "Image on the Editor's Platform" -#: templates/catalogue/picture_detail.html:82 +#: templates/catalogue/picture_detail.html:73 msgid "View XML source" msgstr "View XML source" -#: templates/catalogue/picture_detail.html:85 +#: templates/catalogue/picture_detail.html:76 msgid "Work's themes " msgstr "Work's themes " @@ -797,6 +801,16 @@ msgstr "Search" msgid "Did you mean" msgstr "Did you mean" +#: templates/catalogue/search_multiple_hits.html:31 +#, fuzzy +#| msgid "books" +msgid "Books" +msgstr "Books" + +#: templates/catalogue/search_multiple_hits.html:42 +msgid "Pictures" +msgstr "" + #: templates/catalogue/search_no_hits.html:20 #: templates/catalogue/tagged_object_list.html:85 msgid "Sorry! Search cirteria did not match any resources." @@ -914,15 +928,11 @@ msgstr "Motifs and themes" msgid "No description." msgstr "Description" -#: templates/catalogue/tagged_object_list.html:109 -msgid "in Lektury.Gazeta.pl" -msgstr "in Lektury.Gazeta.pl" - -#: templates/catalogue/tagged_object_list.html:115 +#: templates/catalogue/tagged_object_list.html:110 msgid "in Wikipedia" msgstr "in Wikipedia" -#: templates/catalogue/tagged_object_list.html:121 +#: templates/catalogue/tagged_object_list.html:116 msgid "in Culture.pl" msgstr "" @@ -932,7 +942,7 @@ msgstr "" msgid "Loading" msgstr "Leading" -#: views.py:564 +#: views.py:334 #, python-format msgid "" "An error occurred: %(exception)s\n" @@ -943,15 +953,21 @@ msgstr "" "\n" "%(tb)s" -#: views.py:566 +#: views.py:336 msgid "Book imported successfully" msgstr "Book imported succesfully" -#: views.py:568 +#: views.py:338 #, python-format msgid "Error importing file: %r" msgstr "An error occured while importing file: %r" +#~ msgid "Book description on Lektury.Gazeta.pl" +#~ msgstr "Book description on Lektury.Gazeta.pl" + +#~ msgid "in Lektury.Gazeta.pl" +#~ msgstr "in Lektury.Gazeta.pl" + #~ msgid "Results by title" #~ msgstr "Results by title" diff --git a/src/catalogue/locale/es/LC_MESSAGES/django.po b/src/catalogue/locale/es/LC_MESSAGES/django.po index abefe573b..18fb2fadb 100644 --- a/src/catalogue/locale/es/LC_MESSAGES/django.po +++ b/src/catalogue/locale/es/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-12-15 10:27+0100\n" +"POT-Creation-Date: 2018-02-26 13:13+0100\n" "PO-Revision-Date: 2013-04-09 10:39+0100\n" "Last-Translator: Radek Czajka \n" "Language-Team: LANGUAGE \n" @@ -157,91 +157,99 @@ msgstr "Grande" msgid "Queue is full. Please try again later." msgstr "" -#: models/book.py:49 models/collection.py:14 +#: models/book.py:55 models/collection.py:14 msgid "title" msgstr "título" -#: models/book.py:50 models/tag.py:58 +#: models/book.py:56 models/tag.py:58 msgid "sort key" msgstr "clave de clasificación" -#: models/book.py:52 +#: models/book.py:58 #, fuzzy #| msgid "Results by authors" msgid "sort key by author" msgstr "Resultados por autor" -#: models/book.py:53 models/book.py:54 models/collection.py:15 +#: models/book.py:59 models/book.py:60 models/collection.py:15 #: models/collection.py:18 models/tag.py:57 msgid "slug" msgstr "slug" -#: models/book.py:55 +#: models/book.py:61 msgid "language code" msgstr "código de idioma" -#: models/book.py:56 models/book.py:224 models/collection.py:16 -#: models/tag.py:61 models/tag.py:183 +#: models/book.py:62 models/book.py:240 models/collection.py:16 +#: models/tag.py:61 models/tag.py:186 msgid "description" msgstr "descripción" -#: models/book.py:57 models/bookmedia.py:36 models/tag.py:68 models/tag.py:69 +#: models/book.py:63 models/bookmedia.py:36 models/tag.py:71 models/tag.py:72 msgid "creation date" msgstr "fecha de creación" -#: models/book.py:58 +#: models/book.py:64 #, fuzzy #| msgid "creation date" msgid "change date" msgstr "fecha de creación" -#: models/book.py:59 +#: models/book.py:65 msgid "parent number" msgstr "cifra matriz" -#: models/book.py:60 models/bookmedia.py:37 +#: models/book.py:66 models/bookmedia.py:37 msgid "extra information" msgstr "información adicional" -#: models/book.py:63 +#: models/book.py:69 msgid "print on demand" msgstr "" -#: models/book.py:64 +#: models/book.py:70 msgid "recommended" msgstr "" -#: models/book.py:68 +#: models/book.py:74 msgid "cover" msgstr "tapa" -#: models/book.py:74 +#: models/book.py:80 msgid "cover thumbnail" msgstr "" -#: models/book.py:102 models/collection.py:22 +#: models/book.py:85 +msgid "cover thumbnail for mobile app" +msgstr "" + +#: models/book.py:90 +msgid "cover for mobile app" +msgstr "" + +#: models/book.py:118 models/collection.py:22 msgid "book" msgstr "libro" -#: models/book.py:103 +#: models/book.py:119 msgid "books" msgstr "libros" -#: models/book.py:362 +#: models/book.py:378 #, fuzzy, python-format msgid "Book \"%s\" does not exist." msgstr "Libro con slug = \"%s\" no existe." -#: models/book.py:375 +#: models/book.py:391 #, python-format msgid "Book %s already exists" msgstr "Libro %s ya existe" -#: models/book.py:633 +#: models/book.py:658 msgid "This work needs modernisation" msgstr "" -#: models/book.py:680 models/bookmedia.py:29 +#: models/book.py:705 models/bookmedia.py:29 #, python-format msgid "%s file" msgstr "%s archivo" @@ -343,7 +351,7 @@ msgstr "colección" msgid "thing" msgstr "" -#: models/tag.py:35 models/tag.py:93 +#: models/tag.py:35 models/tag.py:96 msgid "tag" msgstr "tag" @@ -359,7 +367,7 @@ msgstr "id de objeto" msgid "category" msgstr "categoría" -#: models/tag.py:94 +#: models/tag.py:97 msgid "tags" msgstr "tags" @@ -411,10 +419,6 @@ msgid "Editor's Platform" msgstr "Plataforma de Editor" #: templates/catalogue/book_detail.html:71 -msgid "Book description on Lektury.Gazeta.pl" -msgstr "Descripción del libro en Lektury.Gazeta.pl" - -#: templates/catalogue/book_detail.html:76 msgid "Book description on Wikipedia" msgstr "Descripción del libro en Wikipedia" @@ -422,7 +426,7 @@ msgstr "Descripción del libro en Wikipedia" # ! relaciona lub combina - jeśli chodzi o powiązanie # ! prepara - jeśli chodzi o przygotowanie # (zmienić czasownik "mezcla" na któryś z powyższych jeśli kontekst jest inny) -#: templates/catalogue/book_detail.html:80 +#: templates/catalogue/book_detail.html:75 msgid "Mix this book" msgstr "Mezcla este libro" @@ -547,7 +551,7 @@ msgid "Print on demand –" msgstr "" #: templates/catalogue/book_short.html:104 -#: templates/catalogue/custom_pdf_form.html:19 views.py:599 +#: templates/catalogue/custom_pdf_form.html:19 views.py:369 msgid "Download" msgstr "Descargar" @@ -662,7 +666,7 @@ msgstr[1] "" msgid "All collections" msgstr "colecciones" -#: templates/catalogue/custom_pdf_form.html:6 views.py:598 +#: templates/catalogue/custom_pdf_form.html:6 views.py:368 msgid "Download custom PDF" msgstr "Descarga PDF personalizado" @@ -720,11 +724,11 @@ msgstr "Fuente de la imagen" msgid "Image on the Editor's Platform" msgstr "Imagen en la Plataforma de Editor" -#: templates/catalogue/picture_detail.html:82 +#: templates/catalogue/picture_detail.html:73 msgid "View XML source" msgstr "Ver código fuente XML" -#: templates/catalogue/picture_detail.html:85 +#: templates/catalogue/picture_detail.html:76 msgid "Work's themes " msgstr "Temas de las obras" @@ -803,6 +807,16 @@ msgstr "Buscar" msgid "Did you mean" msgstr "¿Te has referido a...?" +#: templates/catalogue/search_multiple_hits.html:31 +#, fuzzy +#| msgid "books" +msgid "Books" +msgstr "libros" + +#: templates/catalogue/search_multiple_hits.html:42 +msgid "Pictures" +msgstr "" + #: templates/catalogue/search_no_hits.html:20 #: templates/catalogue/tagged_object_list.html:85 msgid "Sorry! Search cirteria did not match any resources." @@ -925,15 +939,11 @@ msgstr "Motivos y temas" msgid "No description." msgstr "descripción" -#: templates/catalogue/tagged_object_list.html:109 -msgid "in Lektury.Gazeta.pl" -msgstr "en Lektury.Gazeta.pl" - -#: templates/catalogue/tagged_object_list.html:115 +#: templates/catalogue/tagged_object_list.html:110 msgid "in Wikipedia" msgstr "en Wikipedia" -#: templates/catalogue/tagged_object_list.html:121 +#: templates/catalogue/tagged_object_list.html:116 msgid "in Culture.pl" msgstr "" @@ -945,7 +955,7 @@ msgstr "Interlineado" # msgid "Today is %(month)s, %(day)s." # msgstr "Hoy es el %(día)s de %(mes)es" -#: views.py:564 +#: views.py:334 #, python-format msgid "" "An error occurred: %(exception)s\n" @@ -956,15 +966,21 @@ msgstr "" "\n" "%(tb)s" -#: views.py:566 +#: views.py:336 msgid "Book imported successfully" msgstr "El libro ha sido importado con éxito" -#: views.py:568 +#: views.py:338 #, python-format msgid "Error importing file: %r" msgstr "Ha ocurrido un error al cargar el archivo: %r" +#~ msgid "Book description on Lektury.Gazeta.pl" +#~ msgstr "Descripción del libro en Lektury.Gazeta.pl" + +#~ msgid "in Lektury.Gazeta.pl" +#~ msgstr "en Lektury.Gazeta.pl" + #~ msgid "Results by title" #~ msgstr "Resultados por título" diff --git a/src/catalogue/locale/fr/LC_MESSAGES/django.po b/src/catalogue/locale/fr/LC_MESSAGES/django.po index 5755ee327..36a29d95e 100644 --- a/src/catalogue/locale/fr/LC_MESSAGES/django.po +++ b/src/catalogue/locale/fr/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-12-15 10:27+0100\n" +"POT-Creation-Date: 2018-02-26 13:13+0100\n" "PO-Revision-Date: 2013-04-09 10:38+0100\n" "Last-Translator: Radek Czajka \n" "Language-Team: LANGUAGE \n" @@ -156,91 +156,99 @@ msgstr "Grand(e)(s)" msgid "Queue is full. Please try again later." msgstr "" -#: models/book.py:49 models/collection.py:14 +#: models/book.py:55 models/collection.py:14 msgid "title" msgstr "titre" -#: models/book.py:50 models/tag.py:58 +#: models/book.py:56 models/tag.py:58 msgid "sort key" msgstr "critère de tri" -#: models/book.py:52 +#: models/book.py:58 #, fuzzy #| msgid "Results by authors" msgid "sort key by author" msgstr "Résultats par l'auteur" -#: models/book.py:53 models/book.py:54 models/collection.py:15 +#: models/book.py:59 models/book.py:60 models/collection.py:15 #: models/collection.py:18 models/tag.py:57 msgid "slug" msgstr "ébauche" -#: models/book.py:55 +#: models/book.py:61 msgid "language code" msgstr "code de langue" -#: models/book.py:56 models/book.py:224 models/collection.py:16 -#: models/tag.py:61 models/tag.py:183 +#: models/book.py:62 models/book.py:240 models/collection.py:16 +#: models/tag.py:61 models/tag.py:186 msgid "description" msgstr "description" -#: models/book.py:57 models/bookmedia.py:36 models/tag.py:68 models/tag.py:69 +#: models/book.py:63 models/bookmedia.py:36 models/tag.py:71 models/tag.py:72 msgid "creation date" msgstr "date de création" -#: models/book.py:58 +#: models/book.py:64 #, fuzzy #| msgid "creation date" msgid "change date" msgstr "date de création" -#: models/book.py:59 +#: models/book.py:65 msgid "parent number" msgstr "nombre de parent" -#: models/book.py:60 models/bookmedia.py:37 +#: models/book.py:66 models/bookmedia.py:37 msgid "extra information" msgstr "information supplémentaire" -#: models/book.py:63 +#: models/book.py:69 msgid "print on demand" msgstr "" -#: models/book.py:64 +#: models/book.py:70 msgid "recommended" msgstr "" -#: models/book.py:68 +#: models/book.py:74 msgid "cover" msgstr "couverture" -#: models/book.py:74 +#: models/book.py:80 msgid "cover thumbnail" msgstr "" -#: models/book.py:102 models/collection.py:22 +#: models/book.py:85 +msgid "cover thumbnail for mobile app" +msgstr "" + +#: models/book.py:90 +msgid "cover for mobile app" +msgstr "" + +#: models/book.py:118 models/collection.py:22 msgid "book" msgstr "livre" -#: models/book.py:103 +#: models/book.py:119 msgid "books" msgstr "livres" -#: models/book.py:362 +#: models/book.py:378 #, python-format msgid "Book \"%s\" does not exist." msgstr "Livre \"%s\" n'existe pas." -#: models/book.py:375 +#: models/book.py:391 #, python-format msgid "Book %s already exists" msgstr "Livre %s existe déjà" -#: models/book.py:633 +#: models/book.py:658 msgid "This work needs modernisation" msgstr "" -#: models/book.py:680 models/bookmedia.py:29 +#: models/book.py:705 models/bookmedia.py:29 #, python-format msgid "%s file" msgstr "fichier %s" @@ -342,7 +350,7 @@ msgstr "série" msgid "thing" msgstr "" -#: models/tag.py:35 models/tag.py:93 +#: models/tag.py:35 models/tag.py:96 msgid "tag" msgstr "tag" @@ -358,7 +366,7 @@ msgstr "ID de l'objet" msgid "category" msgstr "catégorie" -#: models/tag.py:94 +#: models/tag.py:97 msgid "tags" msgstr "tags" @@ -410,14 +418,10 @@ msgid "Editor's Platform" msgstr "Plateforme d'éditeur" #: templates/catalogue/book_detail.html:71 -msgid "Book description on Lektury.Gazeta.pl" -msgstr "Description du livre sur Lektury.Gazeta.pl" - -#: templates/catalogue/book_detail.html:76 msgid "Book description on Wikipedia" msgstr "Description du livre sur Wikipédia" -#: templates/catalogue/book_detail.html:80 +#: templates/catalogue/book_detail.html:75 msgid "Mix this book" msgstr "Mixez ce livre" @@ -541,7 +545,7 @@ msgid "Print on demand –" msgstr "" #: templates/catalogue/book_short.html:104 -#: templates/catalogue/custom_pdf_form.html:19 views.py:599 +#: templates/catalogue/custom_pdf_form.html:19 views.py:369 msgid "Download" msgstr "Téléchargez" @@ -655,7 +659,7 @@ msgstr[1] "" msgid "All collections" msgstr "collections" -#: templates/catalogue/custom_pdf_form.html:6 views.py:598 +#: templates/catalogue/custom_pdf_form.html:6 views.py:368 msgid "Download custom PDF" msgstr "Téléchargez un PDF personnalisé" @@ -711,11 +715,11 @@ msgstr "Source d'image" msgid "Image on the Editor's Platform" msgstr "L'image sur la Plateforme d'éditeur" -#: templates/catalogue/picture_detail.html:82 +#: templates/catalogue/picture_detail.html:73 msgid "View XML source" msgstr "Voir source XML" -#: templates/catalogue/picture_detail.html:85 +#: templates/catalogue/picture_detail.html:76 msgid "Work's themes " msgstr "Les thèmes de l'oeuvre" @@ -796,6 +800,16 @@ msgstr "Rechercher" msgid "Did you mean" msgstr "Est-ce que vous cherchez" +#: templates/catalogue/search_multiple_hits.html:31 +#, fuzzy +#| msgid "books" +msgid "Books" +msgstr "livres" + +#: templates/catalogue/search_multiple_hits.html:42 +msgid "Pictures" +msgstr "" + #: templates/catalogue/search_no_hits.html:20 #: templates/catalogue/tagged_object_list.html:85 msgid "Sorry! Search cirteria did not match any resources." @@ -918,15 +932,11 @@ msgstr "Motifs et thèmes" msgid "No description." msgstr "description" -#: templates/catalogue/tagged_object_list.html:109 -msgid "in Lektury.Gazeta.pl" -msgstr "sur Lektury.Gazeta.pl" - -#: templates/catalogue/tagged_object_list.html:115 +#: templates/catalogue/tagged_object_list.html:110 msgid "in Wikipedia" msgstr "sur Wikipédia" -#: templates/catalogue/tagged_object_list.html:121 +#: templates/catalogue/tagged_object_list.html:116 msgid "in Culture.pl" msgstr "" @@ -938,7 +948,7 @@ msgstr "Interligne" # msgid "Today is %(month)s, %(day)s." # msgstr "Aujourd'hui nous sommes le" -#: views.py:564 +#: views.py:334 #, python-format msgid "" "An error occurred: %(exception)s\n" @@ -949,15 +959,21 @@ msgstr "" "\n" "%(tb)s" -#: views.py:566 +#: views.py:336 msgid "Book imported successfully" msgstr "Livre importé avec succès" -#: views.py:568 +#: views.py:338 #, python-format msgid "Error importing file: %r" msgstr "Erreur pendant l'importation du fichier: %r" +#~ msgid "Book description on Lektury.Gazeta.pl" +#~ msgstr "Description du livre sur Lektury.Gazeta.pl" + +#~ msgid "in Lektury.Gazeta.pl" +#~ msgstr "sur Lektury.Gazeta.pl" + #~ msgid "Results by title" #~ msgstr "Résultats par le titre" diff --git a/src/catalogue/locale/it/LC_MESSAGES/django.po b/src/catalogue/locale/it/LC_MESSAGES/django.po index e28079b54..8802ef8bb 100644 --- a/src/catalogue/locale/it/LC_MESSAGES/django.po +++ b/src/catalogue/locale/it/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-12-15 10:27+0100\n" +"POT-Creation-Date: 2018-02-26 13:13+0100\n" "PO-Revision-Date: 2013-04-09 10:39+0100\n" "Last-Translator: Radek Czajka \n" "Language-Team: LANGUAGE \n" @@ -157,91 +157,99 @@ msgstr "Grande" msgid "Queue is full. Please try again later." msgstr "" -#: models/book.py:49 models/collection.py:14 +#: models/book.py:55 models/collection.py:14 msgid "title" msgstr "titolo" -#: models/book.py:50 models/tag.py:58 +#: models/book.py:56 models/tag.py:58 msgid "sort key" msgstr "chiave di ordinamento" -#: models/book.py:52 +#: models/book.py:58 #, fuzzy #| msgid "Results by authors" msgid "sort key by author" msgstr "Risultati per autore" -#: models/book.py:53 models/book.py:54 models/collection.py:15 +#: models/book.py:59 models/book.py:60 models/collection.py:15 #: models/collection.py:18 models/tag.py:57 msgid "slug" msgstr "slug" -#: models/book.py:55 +#: models/book.py:61 msgid "language code" msgstr "codice della lingua" -#: models/book.py:56 models/book.py:224 models/collection.py:16 -#: models/tag.py:61 models/tag.py:183 +#: models/book.py:62 models/book.py:240 models/collection.py:16 +#: models/tag.py:61 models/tag.py:186 msgid "description" msgstr "descrizione" -#: models/book.py:57 models/bookmedia.py:36 models/tag.py:68 models/tag.py:69 +#: models/book.py:63 models/bookmedia.py:36 models/tag.py:71 models/tag.py:72 msgid "creation date" msgstr "data di creazione" -#: models/book.py:58 +#: models/book.py:64 #, fuzzy #| msgid "creation date" msgid "change date" msgstr "data di creazione" -#: models/book.py:59 +#: models/book.py:65 msgid "parent number" msgstr "numero del genitore" -#: models/book.py:60 models/bookmedia.py:37 +#: models/book.py:66 models/bookmedia.py:37 msgid "extra information" msgstr " ulteriori informazioni" -#: models/book.py:63 +#: models/book.py:69 msgid "print on demand" msgstr "" -#: models/book.py:64 +#: models/book.py:70 msgid "recommended" msgstr "" -#: models/book.py:68 +#: models/book.py:74 msgid "cover" msgstr "copertina" -#: models/book.py:74 +#: models/book.py:80 msgid "cover thumbnail" msgstr "" -#: models/book.py:102 models/collection.py:22 +#: models/book.py:85 +msgid "cover thumbnail for mobile app" +msgstr "" + +#: models/book.py:90 +msgid "cover for mobile app" +msgstr "" + +#: models/book.py:118 models/collection.py:22 msgid "book" msgstr "libro" -#: models/book.py:103 +#: models/book.py:119 msgid "books" msgstr "Libri" -#: models/book.py:362 +#: models/book.py:378 #, python-format msgid "Book \"%s\" does not exist." msgstr "Il libro \"%s\" non esiste." -#: models/book.py:375 +#: models/book.py:391 #, python-format msgid "Book %s already exists" msgstr "Il libro %s esiste già" -#: models/book.py:633 +#: models/book.py:658 msgid "This work needs modernisation" msgstr "" -#: models/book.py:680 models/bookmedia.py:29 +#: models/book.py:705 models/bookmedia.py:29 #, python-format msgid "%s file" msgstr "i %s di file" @@ -342,7 +350,7 @@ msgstr "raccolta" msgid "thing" msgstr "" -#: models/tag.py:35 models/tag.py:93 +#: models/tag.py:35 models/tag.py:96 msgid "tag" msgstr "tag" @@ -358,7 +366,7 @@ msgstr "" msgid "category" msgstr "categoria" -#: models/tag.py:94 +#: models/tag.py:97 msgid "tags" msgstr "i tag" @@ -410,14 +418,10 @@ msgid "Editor's Platform" msgstr " Piattaforma del editore" #: templates/catalogue/book_detail.html:71 -msgid "Book description on Lektury.Gazeta.pl" -msgstr "Descrizione del libro su Lektury.Gazeta.pl" - -#: templates/catalogue/book_detail.html:76 msgid "Book description on Wikipedia" msgstr "Descrizione del libro su Wikipedia" -#: templates/catalogue/book_detail.html:80 +#: templates/catalogue/book_detail.html:75 msgid "Mix this book" msgstr "Combina questo libro" @@ -544,7 +548,7 @@ msgid "Print on demand –" msgstr "" #: templates/catalogue/book_short.html:104 -#: templates/catalogue/custom_pdf_form.html:19 views.py:599 +#: templates/catalogue/custom_pdf_form.html:19 views.py:369 msgid "Download" msgstr "Scarica" @@ -658,7 +662,7 @@ msgstr[1] "" msgid "All collections" msgstr " raccolte" -#: templates/catalogue/custom_pdf_form.html:6 views.py:598 +#: templates/catalogue/custom_pdf_form.html:6 views.py:368 msgid "Download custom PDF" msgstr "Scarica PDF personalizzato" @@ -716,11 +720,11 @@ msgstr "Fonte dell'immagine" msgid "Image on the Editor's Platform" msgstr "Immagine sulla piattaforma del editore" -#: templates/catalogue/picture_detail.html:82 +#: templates/catalogue/picture_detail.html:73 msgid "View XML source" msgstr "Visualizza la fonte XML" -#: templates/catalogue/picture_detail.html:85 +#: templates/catalogue/picture_detail.html:76 msgid "Work's themes " msgstr "Temi dell'opera" @@ -800,6 +804,16 @@ msgstr "Cerca" msgid "Did you mean" msgstr "Volevi dire" +#: templates/catalogue/search_multiple_hits.html:31 +#, fuzzy +#| msgid "books" +msgid "Books" +msgstr "Libri" + +#: templates/catalogue/search_multiple_hits.html:42 +msgid "Pictures" +msgstr "" + #: templates/catalogue/search_no_hits.html:20 #: templates/catalogue/tagged_object_list.html:85 msgid "Sorry! Search cirteria did not match any resources." @@ -921,15 +935,11 @@ msgstr "Motivi e temi" msgid "No description." msgstr "descrizione" -#: templates/catalogue/tagged_object_list.html:109 -msgid "in Lektury.Gazeta.pl" -msgstr "su Lektury.Gazeta.pl" - -#: templates/catalogue/tagged_object_list.html:115 +#: templates/catalogue/tagged_object_list.html:110 msgid "in Wikipedia" msgstr "su Wikipedia" -#: templates/catalogue/tagged_object_list.html:121 +#: templates/catalogue/tagged_object_list.html:116 msgid "in Culture.pl" msgstr "" @@ -939,7 +949,7 @@ msgstr "" msgid "Loading" msgstr "Interlinea" -#: views.py:564 +#: views.py:334 #, python-format msgid "" "An error occurred: %(exception)s\n" @@ -950,15 +960,21 @@ msgstr "" "\n" "%(tb)s" -#: views.py:566 +#: views.py:336 msgid "Book imported successfully" msgstr "Libro scaricato con successo" -#: views.py:568 +#: views.py:338 #, python-format msgid "Error importing file: %r" msgstr "Errore dell'importazione del file: %r" +#~ msgid "Book description on Lektury.Gazeta.pl" +#~ msgstr "Descrizione del libro su Lektury.Gazeta.pl" + +#~ msgid "in Lektury.Gazeta.pl" +#~ msgstr "su Lektury.Gazeta.pl" + #~ msgid "Results by title" #~ msgstr "Risultati per titolo" diff --git a/src/catalogue/locale/lt/LC_MESSAGES/django.po b/src/catalogue/locale/lt/LC_MESSAGES/django.po index 94989fb78..6431022b6 100644 --- a/src/catalogue/locale/lt/LC_MESSAGES/django.po +++ b/src/catalogue/locale/lt/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-12-15 10:27+0100\n" +"POT-Creation-Date: 2018-02-26 13:13+0100\n" "PO-Revision-Date: 2013-04-09 10:40+0100\n" "Last-Translator: Radek Czajka \n" "Language-Team: LANGUAGE \n" @@ -157,92 +157,100 @@ msgstr "Didelis" msgid "Queue is full. Please try again later." msgstr "" -#: models/book.py:49 models/collection.py:14 +#: models/book.py:55 models/collection.py:14 msgid "title" msgstr "pavadinimas" -#: models/book.py:50 models/tag.py:58 +#: models/book.py:56 models/tag.py:58 msgid "sort key" msgstr "rikiavimo raktas" -#: models/book.py:52 +#: models/book.py:58 #, fuzzy #| msgid "Results by authors" msgid "sort key by author" msgstr "Rezultatai pagal autorius" -#: models/book.py:53 models/book.py:54 models/collection.py:15 +#: models/book.py:59 models/book.py:60 models/collection.py:15 #: models/collection.py:18 models/tag.py:57 msgid "slug" msgstr "slug" -#: models/book.py:55 +#: models/book.py:61 msgid "language code" msgstr "kalbos kodas" -#: models/book.py:56 models/book.py:224 models/collection.py:16 -#: models/tag.py:61 models/tag.py:183 +#: models/book.py:62 models/book.py:240 models/collection.py:16 +#: models/tag.py:61 models/tag.py:186 msgid "description" msgstr "aprašymas" -#: models/book.py:57 models/bookmedia.py:36 models/tag.py:68 models/tag.py:69 +#: models/book.py:63 models/bookmedia.py:36 models/tag.py:71 models/tag.py:72 msgid "creation date" msgstr "sukūrimo data" -#: models/book.py:58 +#: models/book.py:64 #, fuzzy #| msgid "creation date" msgid "change date" msgstr "sukūrimo data" # sprawdz -#: models/book.py:59 +#: models/book.py:65 msgid "parent number" msgstr "pirminis numeris" -#: models/book.py:60 models/bookmedia.py:37 +#: models/book.py:66 models/bookmedia.py:37 msgid "extra information" msgstr "papildomos informacijos" -#: models/book.py:63 +#: models/book.py:69 msgid "print on demand" msgstr "" -#: models/book.py:64 +#: models/book.py:70 msgid "recommended" msgstr "" -#: models/book.py:68 +#: models/book.py:74 msgid "cover" msgstr "viršelis" -#: models/book.py:74 +#: models/book.py:80 msgid "cover thumbnail" msgstr "" -#: models/book.py:102 models/collection.py:22 +#: models/book.py:85 +msgid "cover thumbnail for mobile app" +msgstr "" + +#: models/book.py:90 +msgid "cover for mobile app" +msgstr "" + +#: models/book.py:118 models/collection.py:22 msgid "book" msgstr "knyga" -#: models/book.py:103 +#: models/book.py:119 msgid "books" msgstr "knygos" -#: models/book.py:362 +#: models/book.py:378 #, python-format msgid "Book \"%s\" does not exist." msgstr "Knyga \"%s\" neegzistuoja." -#: models/book.py:375 +#: models/book.py:391 #, python-format msgid "Book %s already exists" msgstr "Knyga %s jau egzistuoja" -#: models/book.py:633 +#: models/book.py:658 msgid "This work needs modernisation" msgstr "" -#: models/book.py:680 models/bookmedia.py:29 +#: models/book.py:705 models/bookmedia.py:29 #, python-format msgid "%s file" msgstr "%s failas " @@ -343,7 +351,7 @@ msgstr "rinkinys" msgid "thing" msgstr "" -#: models/tag.py:35 models/tag.py:93 +#: models/tag.py:35 models/tag.py:96 msgid "tag" msgstr "žymė" @@ -359,7 +367,7 @@ msgstr "id obiektas" msgid "category" msgstr "kategorija " -#: models/tag.py:94 +#: models/tag.py:97 msgid "tags" msgstr "žymės" @@ -411,14 +419,10 @@ msgid "Editor's Platform" msgstr "Redaktoriaus Platformoje" #: templates/catalogue/book_detail.html:71 -msgid "Book description on Lektury.Gazeta.pl" -msgstr "Knygos aprašymas Lektury.Gazeta.pl interneto svetainėje" - -#: templates/catalogue/book_detail.html:76 msgid "Book description on Wikipedia" msgstr "Knygos aprašymas Vikipedijoje" -#: templates/catalogue/book_detail.html:80 +#: templates/catalogue/book_detail.html:75 msgid "Mix this book" msgstr "Maišyti šią knygą" @@ -544,7 +548,7 @@ msgid "Print on demand –" msgstr "" #: templates/catalogue/book_short.html:104 -#: templates/catalogue/custom_pdf_form.html:19 views.py:599 +#: templates/catalogue/custom_pdf_form.html:19 views.py:369 msgid "Download" msgstr "Atsisiųsti" @@ -659,7 +663,7 @@ msgstr[1] "" msgid "All collections" msgstr "kolekcijos" -#: templates/catalogue/custom_pdf_form.html:6 views.py:598 +#: templates/catalogue/custom_pdf_form.html:6 views.py:368 msgid "Download custom PDF" msgstr "Sukurti ir atsisiųsti PDF failą" @@ -717,11 +721,11 @@ msgstr "Paveikslėlio šaltinis" msgid "Image on the Editor's Platform" msgstr "Paveikslėlis Redaktoriaus Platformoje" -#: templates/catalogue/picture_detail.html:82 +#: templates/catalogue/picture_detail.html:73 msgid "View XML source" msgstr "Žiūrėti XML šaltinį" -#: templates/catalogue/picture_detail.html:85 +#: templates/catalogue/picture_detail.html:76 msgid "Work's themes " msgstr "Kūrinio motyvai" @@ -801,6 +805,16 @@ msgstr "Ieškoti" msgid "Did you mean" msgstr "Gal turėjote omenyje" +#: templates/catalogue/search_multiple_hits.html:31 +#, fuzzy +#| msgid "books" +msgid "Books" +msgstr "knygos" + +#: templates/catalogue/search_multiple_hits.html:42 +msgid "Pictures" +msgstr "" + #: templates/catalogue/search_no_hits.html:20 #: templates/catalogue/tagged_object_list.html:85 msgid "Sorry! Search cirteria did not match any resources." @@ -920,15 +934,11 @@ msgstr "Motyvai ir temos" msgid "No description." msgstr "aprašymas" -#: templates/catalogue/tagged_object_list.html:109 -msgid "in Lektury.Gazeta.pl" -msgstr "Lektury.Gazeta.pl interneto svetainėje" - -#: templates/catalogue/tagged_object_list.html:115 +#: templates/catalogue/tagged_object_list.html:110 msgid "in Wikipedia" msgstr "Vikipedijoje" -#: templates/catalogue/tagged_object_list.html:121 +#: templates/catalogue/tagged_object_list.html:116 msgid "in Culture.pl" msgstr "" @@ -938,7 +948,7 @@ msgstr "" msgid "Loading" msgstr "eilučių intervalas" -#: views.py:564 +#: views.py:334 #, python-format msgid "" "An error occurred: %(exception)s\n" @@ -949,15 +959,21 @@ msgstr "" "\n" "%(tb)s" -#: views.py:566 +#: views.py:336 msgid "Book imported successfully" msgstr "Knyga buvo sėkmingai importuota" -#: views.py:568 +#: views.py:338 #, python-format msgid "Error importing file: %r" msgstr "Importuojant failą įvyko klaida: %r" +#~ msgid "Book description on Lektury.Gazeta.pl" +#~ msgstr "Knygos aprašymas Lektury.Gazeta.pl interneto svetainėje" + +#~ msgid "in Lektury.Gazeta.pl" +#~ msgstr "Lektury.Gazeta.pl interneto svetainėje" + #~ msgid "Results by title" #~ msgstr "Rezultatai pagal pavadinimą" diff --git a/src/catalogue/locale/pl/LC_MESSAGES/django.po b/src/catalogue/locale/pl/LC_MESSAGES/django.po index 8a2ffab18..5c0912791 100644 --- a/src/catalogue/locale/pl/LC_MESSAGES/django.po +++ b/src/catalogue/locale/pl/LC_MESSAGES/django.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: WolneLektury\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-12-15 10:27+0100\n" +"POT-Creation-Date: 2018-02-26 13:13+0100\n" "PO-Revision-Date: 2015-12-31 16:45+0100\n" "Last-Translator: Radek Czajka \n" "Language-Team: Fundacja Nowoczesna Polska \n" "Language-Team: LANGUAGE \n" @@ -157,91 +157,99 @@ msgstr "Большой" msgid "Queue is full. Please try again later." msgstr "" -#: models/book.py:49 models/collection.py:14 +#: models/book.py:55 models/collection.py:14 msgid "title" msgstr "заглавие" -#: models/book.py:50 models/tag.py:58 +#: models/book.py:56 models/tag.py:58 msgid "sort key" msgstr "ключ сортировки " -#: models/book.py:52 +#: models/book.py:58 #, fuzzy #| msgid "Results by authors" msgid "sort key by author" msgstr "Результаты по авторам" -#: models/book.py:53 models/book.py:54 models/collection.py:15 +#: models/book.py:59 models/book.py:60 models/collection.py:15 #: models/collection.py:18 models/tag.py:57 msgid "slug" msgstr "slug" -#: models/book.py:55 +#: models/book.py:61 msgid "language code" msgstr "код языка" -#: models/book.py:56 models/book.py:224 models/collection.py:16 -#: models/tag.py:61 models/tag.py:183 +#: models/book.py:62 models/book.py:240 models/collection.py:16 +#: models/tag.py:61 models/tag.py:186 msgid "description" msgstr "описание" -#: models/book.py:57 models/bookmedia.py:36 models/tag.py:68 models/tag.py:69 +#: models/book.py:63 models/bookmedia.py:36 models/tag.py:71 models/tag.py:72 msgid "creation date" msgstr "дата создания" -#: models/book.py:58 +#: models/book.py:64 #, fuzzy #| msgid "creation date" msgid "change date" msgstr "дата создания" -#: models/book.py:59 +#: models/book.py:65 msgid "parent number" msgstr "номер родителя" -#: models/book.py:60 models/bookmedia.py:37 +#: models/book.py:66 models/bookmedia.py:37 msgid "extra information" msgstr "дополнительная информация" -#: models/book.py:63 +#: models/book.py:69 msgid "print on demand" msgstr "" -#: models/book.py:64 +#: models/book.py:70 msgid "recommended" msgstr "" -#: models/book.py:68 +#: models/book.py:74 msgid "cover" msgstr "обложка" -#: models/book.py:74 +#: models/book.py:80 msgid "cover thumbnail" msgstr "" -#: models/book.py:102 models/collection.py:22 +#: models/book.py:85 +msgid "cover thumbnail for mobile app" +msgstr "" + +#: models/book.py:90 +msgid "cover for mobile app" +msgstr "" + +#: models/book.py:118 models/collection.py:22 msgid "book" msgstr "книга" -#: models/book.py:103 +#: models/book.py:119 msgid "books" msgstr "книги" -#: models/book.py:362 +#: models/book.py:378 #, fuzzy, python-format msgid "Book \"%s\" does not exist." msgstr "Книга со slug = \"%s\" не существует." -#: models/book.py:375 +#: models/book.py:391 #, python-format msgid "Book %s already exists" msgstr "Книга %s уже существует" -#: models/book.py:633 +#: models/book.py:658 msgid "This work needs modernisation" msgstr "" -#: models/book.py:680 models/bookmedia.py:29 +#: models/book.py:705 models/bookmedia.py:29 #, fuzzy, python-format msgid "%s file" msgstr "XML файл" @@ -344,7 +352,7 @@ msgstr "набор" msgid "thing" msgstr "" -#: models/tag.py:35 models/tag.py:93 +#: models/tag.py:35 models/tag.py:96 msgid "tag" msgstr "таг" @@ -360,7 +368,7 @@ msgstr "ID объекта" msgid "category" msgstr "категория" -#: models/tag.py:94 +#: models/tag.py:97 msgid "tags" msgstr "таги" @@ -412,14 +420,10 @@ msgid "Editor's Platform" msgstr "Платформа редакторов" #: templates/catalogue/book_detail.html:71 -msgid "Book description on Lektury.Gazeta.pl" -msgstr "Описание книги на Lektury.Gazeta.pl" - -#: templates/catalogue/book_detail.html:76 msgid "Book description on Wikipedia" msgstr "Описание книги на Wikipedia" -#: templates/catalogue/book_detail.html:80 +#: templates/catalogue/book_detail.html:75 msgid "Mix this book" msgstr "данной книги" @@ -546,7 +550,7 @@ msgid "Print on demand –" msgstr "" #: templates/catalogue/book_short.html:104 -#: templates/catalogue/custom_pdf_form.html:19 views.py:599 +#: templates/catalogue/custom_pdf_form.html:19 views.py:369 msgid "Download" msgstr "Загрузить" @@ -660,7 +664,7 @@ msgstr[1] "" msgid "All collections" msgstr "сборы" -#: templates/catalogue/custom_pdf_form.html:6 views.py:598 +#: templates/catalogue/custom_pdf_form.html:6 views.py:368 msgid "Download custom PDF" msgstr "Скачать PDF пользователя" @@ -718,11 +722,11 @@ msgstr "Источник книги" msgid "Image on the Editor's Platform" msgstr "Изображение на платформе редакторов" -#: templates/catalogue/picture_detail.html:82 +#: templates/catalogue/picture_detail.html:73 msgid "View XML source" msgstr "Просмотр XML-источник" -#: templates/catalogue/picture_detail.html:85 +#: templates/catalogue/picture_detail.html:76 msgid "Work's themes " msgstr "Темы труда" @@ -802,6 +806,16 @@ msgstr "Поиск" msgid "Did you mean" msgstr "Вы имели в виду" +#: templates/catalogue/search_multiple_hits.html:31 +#, fuzzy +#| msgid "books" +msgid "Books" +msgstr "книги" + +#: templates/catalogue/search_multiple_hits.html:42 +msgid "Pictures" +msgstr "" + #: templates/catalogue/search_no_hits.html:20 #: templates/catalogue/tagged_object_list.html:85 msgid "Sorry! Search cirteria did not match any resources." @@ -921,15 +935,11 @@ msgstr "Мотивы и темы" msgid "No description." msgstr "описание" -#: templates/catalogue/tagged_object_list.html:109 -msgid "in Lektury.Gazeta.pl" -msgstr "на Lektury.Gazeta.pl" - -#: templates/catalogue/tagged_object_list.html:115 +#: templates/catalogue/tagged_object_list.html:110 msgid "in Wikipedia" msgstr "в Википедии" -#: templates/catalogue/tagged_object_list.html:121 +#: templates/catalogue/tagged_object_list.html:116 msgid "in Culture.pl" msgstr "" @@ -939,7 +949,7 @@ msgstr "" msgid "Loading" msgstr "Ведение" -#: views.py:564 +#: views.py:334 #, python-format msgid "" "An error occurred: %(exception)s\n" @@ -950,15 +960,21 @@ msgstr "" "\n" "%(tb)s" -#: views.py:566 +#: views.py:336 msgid "Book imported successfully" msgstr "Вы удачно заимпортировали книгу" -#: views.py:568 +#: views.py:338 #, python-format msgid "Error importing file: %r" msgstr "Ошибка импорта файла: %r" +#~ msgid "Book description on Lektury.Gazeta.pl" +#~ msgstr "Описание книги на Lektury.Gazeta.pl" + +#~ msgid "in Lektury.Gazeta.pl" +#~ msgstr "на Lektury.Gazeta.pl" + #~ msgid "Results by title" #~ msgstr "Результаты по заглавиям" diff --git a/src/catalogue/locale/uk/LC_MESSAGES/django.po b/src/catalogue/locale/uk/LC_MESSAGES/django.po index 703e23430..328a397ea 100644 --- a/src/catalogue/locale/uk/LC_MESSAGES/django.po +++ b/src/catalogue/locale/uk/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-12-15 10:27+0100\n" +"POT-Creation-Date: 2018-02-26 13:13+0100\n" "PO-Revision-Date: 2013-04-09 10:40+0100\n" "Last-Translator: Radek Czajka \n" "Language-Team: LANGUAGE \n" @@ -156,91 +156,99 @@ msgstr "Великий" msgid "Queue is full. Please try again later." msgstr "" -#: models/book.py:49 models/collection.py:14 +#: models/book.py:55 models/collection.py:14 msgid "title" msgstr "заголовок" -#: models/book.py:50 models/tag.py:58 +#: models/book.py:56 models/tag.py:58 msgid "sort key" msgstr "ключ сортування" -#: models/book.py:52 +#: models/book.py:58 #, fuzzy #| msgid "Results by authors" msgid "sort key by author" msgstr "Результати за авторами" -#: models/book.py:53 models/book.py:54 models/collection.py:15 +#: models/book.py:59 models/book.py:60 models/collection.py:15 #: models/collection.py:18 models/tag.py:57 msgid "slug" msgstr "slug" -#: models/book.py:55 +#: models/book.py:61 msgid "language code" msgstr "мовний код" -#: models/book.py:56 models/book.py:224 models/collection.py:16 -#: models/tag.py:61 models/tag.py:183 +#: models/book.py:62 models/book.py:240 models/collection.py:16 +#: models/tag.py:61 models/tag.py:186 msgid "description" msgstr "опис" -#: models/book.py:57 models/bookmedia.py:36 models/tag.py:68 models/tag.py:69 +#: models/book.py:63 models/bookmedia.py:36 models/tag.py:71 models/tag.py:72 msgid "creation date" msgstr "дата створення" -#: models/book.py:58 +#: models/book.py:64 #, fuzzy #| msgid "creation date" msgid "change date" msgstr "дата створення" -#: models/book.py:59 +#: models/book.py:65 msgid "parent number" msgstr "номер батька" -#: models/book.py:60 models/bookmedia.py:37 +#: models/book.py:66 models/bookmedia.py:37 msgid "extra information" msgstr "додаткова інформація" -#: models/book.py:63 +#: models/book.py:69 msgid "print on demand" msgstr "" -#: models/book.py:64 +#: models/book.py:70 msgid "recommended" msgstr "" -#: models/book.py:68 +#: models/book.py:74 msgid "cover" msgstr "обкладинка" -#: models/book.py:74 +#: models/book.py:80 msgid "cover thumbnail" msgstr "" -#: models/book.py:102 models/collection.py:22 +#: models/book.py:85 +msgid "cover thumbnail for mobile app" +msgstr "" + +#: models/book.py:90 +msgid "cover for mobile app" +msgstr "" + +#: models/book.py:118 models/collection.py:22 msgid "book" msgstr "книжка" -#: models/book.py:103 +#: models/book.py:119 msgid "books" msgstr "книжки" -#: models/book.py:362 +#: models/book.py:378 #, python-format msgid "Book \"%s\" does not exist." msgstr "Книжка \"%s\" не існує." -#: models/book.py:375 +#: models/book.py:391 #, python-format msgid "Book %s already exists" msgstr "Книжка %s вже існує" -#: models/book.py:633 +#: models/book.py:658 msgid "This work needs modernisation" msgstr "" -#: models/book.py:680 models/bookmedia.py:29 +#: models/book.py:705 models/bookmedia.py:29 #, python-format msgid "%s file" msgstr "файл %s" @@ -341,7 +349,7 @@ msgstr "вибір" msgid "thing" msgstr "" -#: models/tag.py:35 models/tag.py:93 +#: models/tag.py:35 models/tag.py:96 msgid "tag" msgstr "теґ" @@ -357,7 +365,7 @@ msgstr "ІД об'єкту" msgid "category" msgstr "категорія" -#: models/tag.py:94 +#: models/tag.py:97 msgid "tags" msgstr "теґи" @@ -409,14 +417,10 @@ msgid "Editor's Platform" msgstr "Платформа редагування" #: templates/catalogue/book_detail.html:71 -msgid "Book description on Lektury.Gazeta.pl" -msgstr "Опис книжки на Lektury.Gazeta.pl" - -#: templates/catalogue/book_detail.html:76 msgid "Book description on Wikipedia" msgstr "Опис книжки на Вікіпедії" -#: templates/catalogue/book_detail.html:80 +#: templates/catalogue/book_detail.html:75 msgid "Mix this book" msgstr "Міксувати цю книжку" @@ -543,7 +547,7 @@ msgid "Print on demand –" msgstr "" #: templates/catalogue/book_short.html:104 -#: templates/catalogue/custom_pdf_form.html:19 views.py:599 +#: templates/catalogue/custom_pdf_form.html:19 views.py:369 msgid "Download" msgstr "Завантажити" @@ -657,7 +661,7 @@ msgstr[1] "" msgid "All collections" msgstr "колекції" -#: templates/catalogue/custom_pdf_form.html:6 views.py:598 +#: templates/catalogue/custom_pdf_form.html:6 views.py:368 msgid "Download custom PDF" msgstr "Завантажити настроюваний PDF" @@ -713,11 +717,11 @@ msgstr "Джерело графіки" msgid "Image on the Editor's Platform" msgstr "Графіка на редакторській платформі" -#: templates/catalogue/picture_detail.html:82 +#: templates/catalogue/picture_detail.html:73 msgid "View XML source" msgstr "Дивитись джерело XML" -#: templates/catalogue/picture_detail.html:85 +#: templates/catalogue/picture_detail.html:76 msgid "Work's themes " msgstr "Теми у творі" @@ -798,6 +802,16 @@ msgstr "Пошук" msgid "Did you mean" msgstr "Ви мали на увазі" +#: templates/catalogue/search_multiple_hits.html:31 +#, fuzzy +#| msgid "books" +msgid "Books" +msgstr "книжки" + +#: templates/catalogue/search_multiple_hits.html:42 +msgid "Pictures" +msgstr "" + #: templates/catalogue/search_no_hits.html:20 #: templates/catalogue/tagged_object_list.html:85 msgid "Sorry! Search cirteria did not match any resources." @@ -915,15 +929,11 @@ msgstr "Мотиви та теми" msgid "No description." msgstr "опис" -#: templates/catalogue/tagged_object_list.html:109 -msgid "in Lektury.Gazeta.pl" -msgstr "на Lektury.Gazeta.pl" - -#: templates/catalogue/tagged_object_list.html:115 +#: templates/catalogue/tagged_object_list.html:110 msgid "in Wikipedia" msgstr "на Вікіпедії" -#: templates/catalogue/tagged_object_list.html:121 +#: templates/catalogue/tagged_object_list.html:116 msgid "in Culture.pl" msgstr "" @@ -933,7 +943,7 @@ msgstr "" msgid "Loading" msgstr "Leading" -#: views.py:564 +#: views.py:334 #, python-format msgid "" "An error occurred: %(exception)s\n" @@ -944,15 +954,21 @@ msgstr "" "\n" "%(tb)s" -#: views.py:566 +#: views.py:336 msgid "Book imported successfully" msgstr "Книжку успішно завантажено" -#: views.py:568 +#: views.py:338 #, python-format msgid "Error importing file: %r" msgstr "Помилка в завантаженні файла: %r" +#~ msgid "Book description on Lektury.Gazeta.pl" +#~ msgstr "Опис книжки на Lektury.Gazeta.pl" + +#~ msgid "in Lektury.Gazeta.pl" +#~ msgstr "на Lektury.Gazeta.pl" + #~ msgid "Results by title" #~ msgstr "Результати за заголовком" diff --git a/src/catalogue/templates/catalogue/search_multiple_hits.html b/src/catalogue/templates/catalogue/search_multiple_hits.html index 2c3c13958..b14ab0cc0 100644 --- a/src/catalogue/templates/catalogue/search_multiple_hits.html +++ b/src/catalogue/templates/catalogue/search_multiple_hits.html @@ -27,14 +27,34 @@
-
    - {% for result in results %} -
  • -
    - {% book_searched result %} -
    -
  • - {% endfor %} -
+ {% if books %} +
    + {% if pictures %} +

    {% trans "Books" %}

    + {% endif %} + {% for result in books %} +
  • +
    + {% book_searched result %} +
    +
  • + {% endfor %} +
+ {% endif %} + + {% if pictures %} +

{% trans "Pictures" %}

+
    + {% for result in pictures %} +
  • +
    + {% with result.picture as picture %} + {% include "picture/picture_searched.html" %} + {% endwith %} +
    +
  • + {% endfor %} +
+ {% endif %}
{% endblock %} diff --git a/src/picture/models.py b/src/picture/models.py index 47af34e26..455ed10f4 100644 --- a/src/picture/models.py +++ b/src/picture/models.py @@ -166,7 +166,7 @@ class Picture(models.Model): return None @classmethod - def from_xml_file(cls, xml_file, image_file=None, image_store=None, overwrite=False): + def from_xml_file(cls, xml_file, image_file=None, image_store=None, overwrite=False, search_index=True): """ Import xml and it's accompanying image file. If image file is missing, it will be fetched by librarian.picture.ImageStore @@ -291,6 +291,8 @@ class Picture(models.Model): picture.xml_file.save("%s.xml" % picture.slug, File(xml_file)) picture.save() tasks.generate_picture_html(picture.id) + if not settings.NO_SEARCH_INDEX and search_index: + tasks.index_picture.delay(picture.id, picture_info=picture_xml.picture_info) if close_xml_file: xml_file.close() @@ -387,3 +389,17 @@ class Picture(models.Model): ] for lang in languages ]) + + def search_index(self, picture_info=None, index=None, index_tags=True, commit=True): + if index is None: + from search.index import Index + index = Index() + try: + index.index_picture(self, picture_info) + if index_tags: + index.index_tags() + if commit: + index.index.commit() + except Exception, e: + index.index.rollback() + raise e diff --git a/src/picture/tasks.py b/src/picture/tasks.py index 1958d2881..cae7db7a6 100644 --- a/src/picture/tasks.py +++ b/src/picture/tasks.py @@ -2,6 +2,8 @@ # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # +from traceback import print_exc + from celery.task import task from django.core.files.base import ContentFile from django.template.loader import render_to_string @@ -17,3 +19,14 @@ def generate_picture_html(picture_id): 'themes': pic.areas_json['themes'], })) pic.html_file.save("%s.html" % pic.slug, ContentFile(html_text)) + + +@task +def index_picture(picture_id, picture_info=None, **kwargs): + from picture.models import Picture + try: + return Picture.objects.get(id=picture_id).search_index(picture_info, **kwargs) + except Exception, e: + print "Exception during index: %s" % e + print_exc() + raise e diff --git a/src/picture/templates/picture/picture_searched.html b/src/picture/templates/picture/picture_searched.html new file mode 100644 index 000000000..fb278bedc --- /dev/null +++ b/src/picture/templates/picture/picture_searched.html @@ -0,0 +1,17 @@ +{% extends "picture/picture_short.html" %} +{% load picture_tags %} + +{% block right-column %} +
+ {% for hit in result.hits %} +
+

{{ hit.themes|join:", " }}

+ {% if hit.area %} + + + + {% endif %} +
+ {% endfor %} +
+{% endblock %} diff --git a/src/picture/templates/picture/picture_short.html b/src/picture/templates/picture/picture_short.html index a065d4b5a..43f54ac26 100644 --- a/src/picture/templates/picture/picture_short.html +++ b/src/picture/templates/picture/picture_short.html @@ -5,77 +5,79 @@
-
- {% with picture.get_absolute_url as main_link %} - {% with picture.tags_by_category as tags %} -
-
- {% for tag in tags.author %} - {{ tag }}{% if not forloop.last %}, - {% endif %}{% endfor %} -
- -
+
+
+ {% with picture.get_absolute_url as main_link %} + {% with picture.tags_by_category as tags %} +
+
+ {% for tag in tags.author %} + {{ tag }}{% if not forloop.last %}, + {% endif %}{% endfor %} +
+ +
-
- {% block picture-view %} - {% if main_link %}{% endif %} - {% thumbnail picture.image_file "216x288" crop="center" as thumb %} - - {% endthumbnail %} - {% if main_link %}{% endif %} - {% endblock %} - {# what about licensing icons here #} -
+
+ {% block picture-view %} + {% if main_link %}{% endif %} + {% thumbnail picture.image_file "216x288" crop="center" as thumb %} + + {% endthumbnail %} + {% if main_link %}{% endif %} + {% endblock %} + {# what about licensing icons here #} +
-
- {% spaceless %} - - {% trans "Epoch" %}:  - {% for tag in tags.epoch %} - {{ tag }} - {% if not forloop.last %}, {% endif %} - {% endfor %} +
+ {% spaceless %} + + {% trans "Epoch" %}:  + {% for tag in tags.epoch %} + {{ tag }} + {% if not forloop.last %}, {% endif %} + {% endfor %} + - - - {% trans "Kind" %}:  - {% for tag in tags.kind %} - {{ tag }} - {% if not forloop.last %}, {% endif %} - {% endfor %} + + {% trans "Kind" %}:  + {% for tag in tags.kind %} + {{ tag }} + {% if not forloop.last %}, {% endif %} + {% endfor %} + - - - {% trans "Genre" %}:  - {% for tag in tags.genre %} - {{ tag }} - {% if not forloop.last %}, {% endif %} - {% endfor %} + + {% trans "Genre" %}:  + {% for tag in tags.genre %} + {{ tag }} + {% if not forloop.last %}, {% endif %} + {% endfor %} + - - {% block extra_categories %} - {% endblock %} - {% endspaceless %} -
- {% endwith %} - {% endwith %} + {% block extra_categories %} + {% endblock %} + {% endspaceless %} +
+ {% endwith %} + {% endwith %} +
+
- {% block book-box-extra-info %}{% endblock %} {% block box-append %}{% endblock %} {% block right-column %}{% endblock %} diff --git a/src/search/index.py b/src/search/index.py index b94d8f617..a1c2716a8 100644 --- a/src/search/index.py +++ b/src/search/index.py @@ -10,6 +10,7 @@ from librarian import dcparser from librarian.parser import WLDocument from lxml import etree import catalogue.models +import picture.models from pdcounter.models import Author as PDCounterAuthor, BookStub as PDCounterBook from itertools import chain import sunburnt @@ -514,6 +515,47 @@ class Index(SolrIndex): finally: snippets.close() + def remove_picture(self, picture_or_id): + """Removes a picture from search index.""" + if isinstance(picture_or_id, picture.models.Picture): + picture_id = picture_or_id.id + else: + picture_id = picture_or_id + self.delete_query(self.index.Q(picture_id=picture_id)) + + def index_picture(self, picture, picture_info=None, overwrite=True): + """ + Indexes the picture. + Creates a lucene document for extracted metadata + and calls self.index_area() to index the contents of the picture. + """ + if overwrite: + # we don't remove snippets, since they might be still needed by + # threads using not reopened index + self.remove_picture(picture) + + picture_doc = {'picture_id': int(picture.id)} + meta_fields = self.extract_metadata(picture, picture_info, dc_only=[ + 'authors', 'title', 'epochs', 'kinds', 'genres']) + + picture_doc.update(meta_fields) + + picture_doc['uid'] = "picture%s" % picture_doc['picture_id'] + self.index.add(picture_doc) + del picture_doc['is_book'] + for area in picture.areas.all(): + self.index_area(area, picture_fields=picture_doc) + + def index_area(self, area, picture_fields): + """ + Indexes themes and objects on the area. + """ + doc = dict(picture_fields) + doc['area_id'] = area.id + doc['themes'] = list(area.tags.filter(category__in=('theme', 'thing')).values_list('name', flat=True)) + doc['uid'] = 'area%s' % area.id + self.index.add(doc) + class SearchResult(object): def __init__(self, doc, how_found=None, query_terms=None): @@ -724,6 +766,110 @@ class SearchResult(object): return None +class PictureResult(object): + def __init__(self, doc, how_found=None, query_terms=None): + self.boost = 1.0 + self.query_terms = query_terms + self._picture = None + self._hits = [] + self._processed_hits = None + + if 'score' in doc: + self._score = doc['score'] + else: + self._score = 0 + + self.picture_id = int(doc["picture_id"]) + + if doc.get('area_id'): + hit = (self._score, { + 'how_found': how_found, + 'area_id': doc['area_id'], + 'themes': doc.get('themes', []), + 'themes_pl': doc.get('themes_pl', []), + }) + + self._hits.append(hit) + + def __unicode__(self): + return u"" % (self.picture_id, self._score) + + def __repr__(self): + return unicode(self) + + @property + def score(self): + return self._score * self.boost + + def merge(self, other): + if self.picture_id != other.picture_id: + raise ValueError( + "this search result is for picture %d; tried to merge with %d" % (self.picture_id, other.picture_id)) + self._hits += other._hits + self._score += max(other._score, 0) + return self + + SCORE = 0 + OTHER = 1 + + @property + def hits(self): + if self._processed_hits is not None: + return self._processed_hits + + hits = [] + for hit in self._hits: + try: + area = picture.models.PictureArea.objects.get(id=hit[self.OTHER]['area_id']) + except picture.models.PictureArea.DoesNotExist: + # stale index + continue + # Figure out if we were searching for a token matching some word in theme name. + themes_hit = set() + if self.query_terms is not None: + for i in range(0, len(hit[self.OTHER]['themes'])): + tms = hit[self.OTHER]['themes'][i].split(r' +') + hit[self.OTHER]['themes_pl'][i].split(' ') + tms = map(unicode.lower, tms) + for qt in self.query_terms: + if qt in tms: + themes_hit.add(hit[self.OTHER]['themes'][i]) + break + + m = { + 'score': hit[self.SCORE], + 'area': area, + 'themes_hit': themes_hit, + } + m.update(hit[self.OTHER]) + hits.append(m) + + hits.sort(key=lambda h: h['score'], reverse=True) + hits = hits[:1] + self._processed_hits = hits + return hits + + def get_picture(self): + if self._picture is None: + self._picture = picture.models.Picture.objects.get(id=self.picture_id) + return self._picture + + picture = property(get_picture) + + @staticmethod + def aggregate(*result_lists): + books = {} + for rl in result_lists: + for r in rl: + if r.picture_id in books: + books[r.picture_id].merge(r) + else: + books[r.picture_id] = r + return books.values() + + def __cmp__(self, other): + return cmp(self.score, other.score) + + class Search(SolrIndex): """ Search facilities. @@ -751,12 +897,12 @@ class Search(SolrIndex): books = books.filter(cached_author__iregex='\m%s\M' % word).select_related('popularity__count') return [SearchResult.from_book(book, how_found='search_by_author', query_terms=words) for book in books[:30]] - def search_words(self, words, fields, book=True): - if book and fields == ['authors']: + def search_words(self, words, fields, required=None, book=True, picture=False): + if book and not picture and fields == ['authors']: return self.search_by_author(words) filters = [] for word in words: - if book or (word not in stopwords): + if book or picture or (word not in stopwords): word_filter = None for field in fields: q = self.index.Q(**{field: word}) @@ -765,14 +911,30 @@ class Search(SolrIndex): else: word_filter |= q filters.append(word_filter) + if required: + required_filter = None + for field in required: + for word in words: + if book or picture or (word not in stopwords): + q = self.index.Q(**{field: word}) + if required_filter is None: + required_filter = q + else: + required_filter |= q + filters.append(required_filter) if not filters: return [] + params = {} if book: - query = self.index.query(is_book=True) + params['is_book'] = True + if picture: + params['picture_id__gt'] = 0 else: - query = self.index.query() + params['book_id__gt'] = 0 + query = self.index.query(**params) query = self.apply_filters(query, filters).field_limit(score=True, all_fields=True) - return [SearchResult(found, how_found='search_words', query_terms=words) for found in query.execute()] + result_class = PictureResult if picture else SearchResult + return [result_class(found, how_found='search_words', query_terms=words) for found in query.execute()] def get_snippets(self, searchresult, query, field='text', num=1): """ diff --git a/src/search/management/commands/reindex_pictures.py b/src/search/management/commands/reindex_pictures.py new file mode 100644 index 000000000..bb6b50fcc --- /dev/null +++ b/src/search/management/commands/reindex_pictures.py @@ -0,0 +1,84 @@ +# -*- coding: utf-8 -*- +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# +import sys +import traceback + +from django.core.management.base import BaseCommand + +from optparse import make_option + + +def query_yes_no(question, default="yes"): + """Ask a yes/no question via raw_input() and return their answer. + + "question" is a string that is presented to the user. + "default" is the presumed answer if the user just hits . + It must be "yes" (the default), "no" or None (meaning + an answer is required of the user). + + The "answer" return value is one of "yes" or "no". + """ + valid = {"yes": True, "y": True, "ye": True, + "no": False, "n": False} + if default is None: + prompt = " [y/n] " + elif default == "yes": + prompt = " [Y/n] " + elif default == "no": + prompt = " [y/N] " + else: + raise ValueError("invalid default answer: '%s'" % default) + + while True: + sys.stdout.write(question + prompt) + choice = raw_input().lower() + if default is not None and choice == '': + return valid[default] + elif choice in valid: + return valid[choice] + else: + sys.stdout.write("Please respond with 'yes' or 'no' (or 'y' or 'n').\n") + + +class Command(BaseCommand): + help = 'Reindex pictures.' + args = '' + + option_list = BaseCommand.option_list + ( + make_option('-n', '--picture-id', action='store_true', dest='picture_id', default=False, + help='picture id instead of slugs'), + ) + + def handle(self, *args, **opts): + from picture.models import Picture + from search.index import Index + idx = Index() + + if args: + pictures = [] + for a in args: + if opts['picture_id']: + pictures += Picture.objects.filter(id=int(a)).all() + else: + pictures += Picture.objects.filter(slug=a).all() + else: + pictures = list(Picture.objects.order_by('slug')) + while pictures: + try: + p = pictures[0] + print p.slug + idx.index_picture(p) + idx.index.commit() + pictures.pop(0) + except: + traceback.print_exc() + try: + # we might not be able to rollback + idx.index.rollback() + except: + pass + retry = query_yes_no("Retry?") + if not retry: + break diff --git a/src/search/templatetags/search_tags.py b/src/search/templatetags/search_tags.py index da5a85bc7..d0cbb5c10 100644 --- a/src/search/templatetags/search_tags.py +++ b/src/search/templatetags/search_tags.py @@ -2,26 +2,14 @@ # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # -# import feedparser -# import datetime - from django import template -# from django.contrib.auth.forms import UserCreationForm, AuthenticationForm -# from django.db.models import Q -# from django.utils.translation import ugettext as _ -from catalogue.models import Book import re -# from catalogue.forms import SearchForm -# from catalogue.utils import split_tags - register = template.Library() @register.inclusion_tag('catalogue/book_searched.html', takes_context=True) def book_searched(context, result): - book = Book.objects.get(pk=result.book_id) - # We don't need hits which lead to sections but do not have # snippets. hits = filter(lambda (idx, h): @@ -45,6 +33,6 @@ def book_searched(context, result): return { 'request': context['request'], - 'book': book, + 'book': result.book, 'hits': zip(*hits)[1] if hits else [] } diff --git a/src/search/views.py b/src/search/views.py index f7f60407d..6cb6bc53e 100644 --- a/src/search/views.py +++ b/src/search/views.py @@ -11,7 +11,8 @@ from django.http import HttpResponse, JsonResponse from catalogue.models import Book, Tag from pdcounter.models import Author -from search.index import Search, SearchResult +from picture.models import Picture +from search.index import Search, SearchResult, PictureResult from suggest.forms import PublishingSuggestForm import re import json @@ -106,11 +107,6 @@ def hint(request): @cache.never_cache def main(request): query = request.GET.get('q', '') - query = ' '.join(query.split()) - # filter out private use characters - import unicodedata - query = ''.join(ch for ch in query if unicodedata.category(ch) != 'Co') - if len(query) < 2: return render_to_response( 'catalogue/search_too_short.html', {'prefix': query}, @@ -119,23 +115,41 @@ def main(request): return render_to_response( 'catalogue/search_too_long.html', {'prefix': query}, context_instance=RequestContext(request)) - query = remove_query_syntax_chars(query) + query = prepare_query(query) + pd_authors = search_pd_authors(query) + books = search_books(query) + pictures = search_pictures(query) + suggestion = u'' - words = query.split() - if len(words) > 10: - query = ' '.join(words[:10]) + if not (books or pictures or pd_authors): + form = PublishingSuggestForm(initial={"books": query + ", "}) + return render_to_response( + 'catalogue/search_no_hits.html', + { + 'form': form, + 'did_you_mean': suggestion + }, + context_instance=RequestContext(request)) - search = Search() + if not (books or pictures) and len(pd_authors) == 1: + return HttpResponseRedirect(pd_authors[0].get_absolute_url()) - pd_authors = Author.objects.filter(name__icontains=query) - existing_slugs = Tag.objects.filter( - category='author', slug__in=list(pd_authors.values_list('slug', flat=True)))\ - .values_list('slug', flat=True) - pd_authors = pd_authors.exclude(slug__in=existing_slugs) + return render_to_response( + 'catalogue/search_multiple_hits.html', + { + 'pd_authors': pd_authors, + 'books': books, + 'pictures': pictures, + 'did_you_mean': suggestion + }, + context_instance=RequestContext(request)) - results_parts = [] +def search_books(query): + search = Search() + results_parts = [] search_fields = [] + words = query.split() fieldsets = ( (['authors'], True), (['title'], True), @@ -144,8 +158,7 @@ def main(request): ) for fields, is_book in fieldsets: search_fields += fields - results_parts.append(search.search_words(words, search_fields, book=is_book)) - + results_parts.append(search.search_words(words, search_fields, required=fields, book=is_book)) results = [] ids_results = {} for results_part in results_parts: @@ -156,16 +169,12 @@ def main(request): else: results.append(result) ids_results[book_id] = result - descendant_ids = set( Book.objects.filter(id__in=ids_results, ancestor__in=ids_results).values_list('id', flat=True)) results = [result for result in results if result.book_id not in descendant_ids] - for result in results: search.get_snippets(result, query, num=3) - suggestion = u'' - def ensure_exists(r): try: return r.book @@ -173,25 +182,61 @@ def main(request): return False results = filter(ensure_exists, results) + return results - if not results and not pd_authors: - form = PublishingSuggestForm(initial={"books": query + ", "}) - return render_to_response( - 'catalogue/search_no_hits.html', - { - 'form': form, - 'did_you_mean': suggestion - }, - context_instance=RequestContext(request)) - if not results and len(pd_authors) == 1: - return HttpResponseRedirect(pd_authors[0].get_absolute_url()) +def search_pictures(query): + search = Search() + results_parts = [] + search_fields = [] + words = query.split() + fieldsets = ( + (['authors'], True), + (['title'], True), + (['metadata'], True), + (['themes_pl'], False), + ) + for fields, is_book in fieldsets: + search_fields += fields + results_parts.append(search.search_words(words, search_fields, required=fields, book=is_book, picture=True)) + results = [] + ids_results = {} + for results_part in results_parts: + for result in sorted(PictureResult.aggregate(results_part), reverse=True): + picture_id = result.picture_id + if picture_id in ids_results: + ids_results[picture_id].merge(result) + else: + results.append(result) + ids_results[picture_id] = result - return render_to_response( - 'catalogue/search_multiple_hits.html', - { - 'pd_authors': pd_authors, - 'results': results, - 'did_you_mean': suggestion - }, - context_instance=RequestContext(request)) + def ensure_exists(r): + try: + return r.picture + except Picture.DoesNotExist: + return False + + results = filter(ensure_exists, results) + return results + + +def search_pd_authors(query): + pd_authors = Author.objects.filter(name__icontains=query) + existing_slugs = Tag.objects.filter( + category='author', slug__in=list(pd_authors.values_list('slug', flat=True))) \ + .values_list('slug', flat=True) + pd_authors = pd_authors.exclude(slug__in=existing_slugs) + return pd_authors + + +def prepare_query(query): + query = ' '.join(query.split()) + # filter out private use characters + import unicodedata + query = ''.join(ch for ch in query if unicodedata.category(ch) != 'Co') + query = remove_query_syntax_chars(query) + + words = query.split() + if len(words) > 10: + query = ' '.join(words[:10]) + return query diff --git a/src/wolnelektury/static/scss/main/search.scss b/src/wolnelektury/static/scss/main/search.scss index ad151d80f..5e14505ee 100755 --- a/src/wolnelektury/static/scss/main/search.scss +++ b/src/wolnelektury/static/scss/main/search.scss @@ -94,6 +94,31 @@ } +.search-result { + @media screen and (min-width: 62.5em) { + .picture-left-column { + display: inline-block; + @include size(width, 800px); + } + .picture-right-column { + display: inline-block; + @include size(padding-top, 15px); + @include size(width, 150px); + } + } + + .area-hit { + @include size(font-size, 16px); + @include size(margin, 13px 0); + @include size(padding-left, 20px); + @include size(padding-right, 20px); + @include size(padding-top, 1px); + @include size(padding-bottom, 20px); + background: #f7f7f7; + } +} + + .search-hint-label { display: inline-block; @include size(font-size, 16px);