From: Radek Czajka Date: Wed, 10 Apr 2024 11:34:15 +0000 (+0200) Subject: Fundraising in PDF. X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/HEAD?hp=6407cf24cd6cf3f9ea6fdf4a8924dad109a590e6 Fundraising in PDF. --- diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 095593161..6813e7dda 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1 +1 @@ -custom: ['https://wolnelektury.pl/towarzystwo/', 'https://nowoczesnapolska.org.pl/pomoz-nam/darowizna/', 'https://nowoczesnapolska.org.pl/pomoz-nam/1-procent/'] +custom: ['https://wolnelektury.pl/pomagam/', 'https://fundacja.wolnelektury.pl/pomoz-nam/darowizna/', 'https://fundacja.wolnelektury.pl/pomoz-nam/1-procent/'] diff --git a/NOTICE b/NOTICE index b7f3734fe..188ff3d02 100644 --- a/NOTICE +++ b/NOTICE @@ -1,7 +1,7 @@ - FNP Wolnelektury + Wolne Lektury - Copyright © 2008-2019 Fundacja Nowoczesna Polska + Copyright © 2008-2023 Fundacja Wolne Lektury For full list of contributors see README.md file. diff --git a/README.md b/README.md index 139cccc00..ef163d391 100644 --- a/README.md +++ b/README.md @@ -2,100 +2,83 @@ ![Wolne Lektury](src/wolnelektury/static/img/logo-bez.png) +Wolne Lektury to wolna biblioteka internetowa. Udostępniamy wysokiej jakości +książki — lektury szkolne i nie tylko — dzieciom i dorosłym w Polsce i na całym +świecie. To ważne, ponieważ w 32% domów w Polsce nie ma ani jednej książki +(dane Biblioteki Narodowej, 2022). Wyrównujemy szanse edukacyjne, w praktyce +realizujemy wolność korzystania z dóbr kultury. -Wolne Lektury is a free internet library maintained by Modern Poland Foundation. - -It's a service based on [Django](https://www.djangoproject.com/), using -[Librarian](https://git.mdrn.pl/librarian.git) to publish books in various formats. - - -License -------- - - ![AGPL Logo](http://www.gnu.org/graphics/agplv3-155x51.png) - - Copyright © 2008-2019 Fundacja Nowoczesna Polska - - For full list of contributors see AUTHORS section at the end. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - - -Dependencies -============ - - * Python 3.5-3.7 - * All packages listed in requirements.txt - - -How to deploy (development version) -============= - -1. Checkout the source code from Git and enter the directory -2. Install libraries (we recommend using pip): - - pip install -r requirements/requirements.txt - -3. Setup your local configuration in src/wolnelektury/localsettings.py. You need to generate a new SECRET_KEY, database stuff and domain related stuff. -4. Populate database: - - ./manage.py migrate - -5. Run the server - - ./manage.py runserver - - -6. Import some books which are available on http://www.wolnelektury.pl or on bitbucket mirror: http://bitbucket.org/lqc/wlbooks/ - If you use Bitbucket, you also need Mercurial to fetch books (you can install it using: pip install mercurial). - After downloading books, log into administration, go to Books and choose 'Browse' to select book file, - then fire 'Import book' to upload it. Some books have invalid XML, so you can get an error - (just ignore it and look for other books). - -7. We provide localization of the software in following languages: Polish, Russian, German, English, Spanish, French and Lithuanian. - Translation strings are based on gettext and can be found under 'locale' dir. - There are also JavaScript files for jQuery countdown plugin (static/js/jquery.countdown-*.js). - - -Bundled software -================ - -* django-chunks - in `src/chunks` - based on [django-chunks](http://code.google.com/p/django-chunks/) - by Clint Ecker , - [New BSD License](http://www.opensource.org/licenses/bsd-license.php) -* [django-newtagging](http://www.bitbucket.org/zuber/django-newtagging/) - in `src/newtagging` - by Marek Stępniowski , - [MIT License](http://www.opensource.org/licenses/mit-license.php), - based on [django-tagging](http://code.google.com/p/django-tagging/), also under [MIT License](http://www.opensource.org/licenses/mit-license.php) -* [jPlayer](http://jplayer.org/) - in `src/catalogue/static/jplayer` - by Happyworm, - [MIT License](http://opensource.org/licenses/MIT) -* [Switch template tag](http://djangosnippets.org/snippets/967/) - in `src/wolnelektury/templatetags/switch_tag.py` - by adurdin -* Javascript in `src/wolnelektury/static/js/contrib` - with relevant attribution and licensing - - -Authors -======= - * Marek Stępniowski - * Łukasz Rekucki +Wszystkie dzieła są przez nas opracowane — uwspółcześniane, opatrzone +przypisami, motywami, odniesieniami kontekstowymi — i udostępnione w kilku +formatach do czytania online lub pobrania na własne urządzenie (HTML, TXT, PDF, +EPUB, MOBI, FB2). Nagraliśmy i udostępniliśmy także ponad tysiąc audiobooków, +czytanych przez wybitnych lektorów. Przygotowujemy je także w formatach +z synchronizacją audio-tekst (DAISY i EPUB 3 MO). + +Jesteśmy częścią ruchu wolnego internetu, wolnej kultury i wolnego +oprogramowania — zarówno nasze oprogramowanie, jak i treści, publikujemy +wyłącznie na wolnych licencjach. Udostępniamy teksty z domeny publicznej, +wykupujemy prawa do utworów współczesnych, a nawet zamawiamy i wydajemy +[nowe tłumaczenia](https://wolnelektury.pl/katalog/lektury/nowe-tlumaczenia-wl/) +takich klasyków jak Doktor Dolittle, Mały Książę, Inwazja jaszczurów, Rok 1984. + + +Jak możesz pomóc? +================= + +Wesprzyj nas +------------ + +Wolne Lektury nie mają stałego źródła finansowania. +**[Wspieraj Wolne Lektury stałą wpłatą](https://wolnelektury.pl/pomagam/)** – nawet +niewielkie, stałe wsparcie ma wielką moc! Możesz też wesprzeć Wolne Lektury jednorazowo. + +![1,5%](https://wolnelektury.pl/media/chunks/attachment/poltora-procent.png) + +Fundacja Wolne Lektury jest *Organizacją Pożytku Publicznego*. Dzięki temu możesz +przekazać na bibliotekę 1,5% podatku, podając +[KRS 0000070056](https://fundacja.wolnelektury.pl/pomoz-nam/1-procent/). +Pamiętaj też, że swoje darowizny na Wolne Lektury możesz odliczyć od podstawy podatku! + +Pomóż w tłumaczeniu serwisu +--------------------------- + +Tłumaczenie interfejsu serwisu na inne języki jest przydatne zwłaszcza +dla osób uczących się polskiego, imigrantów i dzieci polonijnych — możesz +pomóc uzupełnić te tlumaczenia. Odbywa się to +[w serwisie Weblate](https://hosted.weblate.org/engage/wolnelektury/). + + +Stan tłumaczenia + + + +Pracuj jako fundraiser/fundraiserka +----------------------------------- + +[Szukamy osób na stanowisko fundraisera](https://wolnelektury.pl/info/rekrutacja/). +Praca polega na bezpośrednim kontakcie z potencjalnymi darczyńcami +podczas festiwali muzycznych i kulturalnych. + + +Włącz się w prace redakcyjne +---------------------------- + +Zobacz jak możesz włączyć się bezpośrednio +w [prace redakcyjne](https://wolnelektury.pl/info/wlacz-sie-w-prace/). + + +Prawa i autorzy +=============== + +Oprogramowanie jest dostępne na wolnej licencji GNU AGPL — dokładniejsze +informacje znajdziesz w plikach NOTICE i LICENSE. Utrzymaniem oprogoramowania +w ramach Fundacji Wolne Lektury zajmuje się Radek Czajka. + +Pełna lista dotychczasowych autorów: + + * Marek Stępniowski + * Łukasz Rekucki * Radek Czajka * Łukasz Anwajler * Marcin Koziej diff --git a/requirements/requirements.txt b/requirements/requirements.txt index 416fb09a9..eede89479 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -39,7 +39,7 @@ mutagen==1.45.1 sorl-thumbnail==12.8.0 # home-brewed & dependencies -librarian==2.6.1 +librarian==24.4.1 # celery tasks celery[redis]==5.2.7 diff --git a/scripts/make-xml-zip.py b/scripts/make-xml-zip.py index 6d6a329de..80ae79926 100755 --- a/scripts/make-xml-zip.py +++ b/scripts/make-xml-zip.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- 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. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # import os import django diff --git a/src/ajaxable/__init__.py b/src/ajaxable/__init__.py index 46cda3d05..96c27fd6a 100644 --- a/src/ajaxable/__init__.py +++ b/src/ajaxable/__init__.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # """ Provides a way to create forms behaving correctly as AJAX forms diff --git a/src/ajaxable/utils.py b/src/ajaxable/utils.py index 4e423ef77..ddb36d8ba 100644 --- a/src/ajaxable/utils.py +++ b/src/ajaxable/utils.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from functools import wraps import json diff --git a/src/annoy/models.py b/src/annoy/models.py index da371fc43..e60e3c024 100644 --- a/src/annoy/models.py +++ b/src/annoy/models.py @@ -116,6 +116,7 @@ class MediaInsertSet(models.Model): file_format = models.CharField(max_length=8, choices=[ ('epub', 'epub'), ('mobi', 'mobi'), + ('pdf', 'pdf'), ]) etag = models.CharField(max_length=64, blank=True) diff --git a/src/annoy/static/annoy/banner.js b/src/annoy/static/annoy/banner.js index 44a1d0223..791741a15 100644 --- a/src/annoy/static/annoy/banner.js +++ b/src/annoy/static/annoy/banner.js @@ -11,23 +11,21 @@ e.preventDefault(); $target.slideDown('fast'); $on.hide(); - if (Modernizr.localstorage) localStorage.removeItem(tag); + localStorage.removeItem(tag); _paq.push(['trackEvent', 'banner', 'banner-unhide', $target.attr('id')]); }); $off.click(function() { $target.slideUp('fast'); $on.show(); - if (Modernizr.localstorage) localStorage[tag] = true; + localStorage[tag] = true; _paq.push(['trackEvent', 'banner', 'banner-hide', $target.attr('id')]); }); - if (Modernizr.localstorage) { - if (!localStorage[tag]) { - $on.hide(); - $target.show(); - _paq.push(['trackEvent', 'banner', 'banner-show', $target.attr('id')]); - } + if (!localStorage[tag]) { + $on.hide(); + $target.show(); + _paq.push(['trackEvent', 'banner', 'banner-show', $target.attr('id')]); } }); diff --git a/src/annoy/templates/annoy/banner_blackout.html b/src/annoy/templates/annoy/banner_blackout.html new file mode 100644 index 000000000..c96751f38 --- /dev/null +++ b/src/annoy/templates/annoy/banner_blackout.html @@ -0,0 +1,40 @@ +{% if banner %} + {% if closable %} + + + {% endif %} +
+
+ +
+ {{ banner.get_text|safe|linebreaks }} + +
+ {% if banner.image %} +
+ +
+ {% endif %} +
+
+ +{% endif %} diff --git a/src/annoy/templatetags/annoy.py b/src/annoy/templatetags/annoy.py index 21f1bb85e..2bc93143c 100644 --- a/src/annoy/templatetags/annoy.py +++ b/src/annoy/templatetags/annoy.py @@ -14,6 +14,14 @@ def annoy_banner(context, place): 'closable': PLACES.get(place, False), } +@register.inclusion_tag('annoy/banner_blackout.html', takes_context=True) +def annoy_banner_blackout(context): + banners = Banner.choice('blackout', request=context['request']) + return { + 'banner': banners.first(), + 'closable': True, + } + @register.inclusion_tag('annoy/banners.html', takes_context=True) def annoy_banners(context, place): diff --git a/src/annoy/translation.py b/src/annoy/translation.py index 2d8055a9c..9addc2729 100644 --- a/src/annoy/translation.py +++ b/src/annoy/translation.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from modeltranslation.translator import translator, TranslationOptions from . import models diff --git a/src/api/admin.py b/src/api/admin.py index 98574986c..090b2a1f9 100644 --- a/src/api/admin.py +++ b/src/api/admin.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.contrib import admin from . import models diff --git a/src/api/drf_auth.py b/src/api/drf_auth.py index fa57b41bf..adee780d3 100644 --- a/src/api/drf_auth.py +++ b/src/api/drf_auth.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from oauthlib.oauth1 import ResourceEndpoint from rest_framework.authentication import BaseAuthentication diff --git a/src/api/fields.py b/src/api/fields.py index d1f9da4bf..cdfcc4735 100644 --- a/src/api/fields.py +++ b/src/api/fields.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from rest_framework import serializers from sorl.thumbnail import default diff --git a/src/api/handlers.py b/src/api/handlers.py index 5af5cfb64..292fdb2a9 100644 --- a/src/api/handlers.py +++ b/src/api/handlers.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.contrib.sites.models import Site from django.utils.functional import lazy diff --git a/src/api/locale/de/LC_MESSAGES/django.po b/src/api/locale/de/LC_MESSAGES/django.po index b3096a08f..698a715a4 100644 --- a/src/api/locale/de/LC_MESSAGES/django.po +++ b/src/api/locale/de/LC_MESSAGES/django.po @@ -1,4 +1,4 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Wolne Lektury. See NOTICE for more information. msgid "" msgstr "" diff --git a/src/api/locale/en/LC_MESSAGES/django.po b/src/api/locale/en/LC_MESSAGES/django.po index 57e5f4393..fd2f82ecc 100644 --- a/src/api/locale/en/LC_MESSAGES/django.po +++ b/src/api/locale/en/LC_MESSAGES/django.po @@ -1,4 +1,4 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Wolne Lektury. See NOTICE for more information. msgid "" msgstr "" diff --git a/src/api/locale/es/LC_MESSAGES/django.po b/src/api/locale/es/LC_MESSAGES/django.po index 1b066a140..24026ed2c 100644 --- a/src/api/locale/es/LC_MESSAGES/django.po +++ b/src/api/locale/es/LC_MESSAGES/django.po @@ -1,4 +1,4 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Wolne Lektury. See NOTICE for more information. msgid "" msgstr "" diff --git a/src/api/locale/fr/LC_MESSAGES/django.po b/src/api/locale/fr/LC_MESSAGES/django.po index 8602c5f3f..464f82e14 100644 --- a/src/api/locale/fr/LC_MESSAGES/django.po +++ b/src/api/locale/fr/LC_MESSAGES/django.po @@ -1,4 +1,4 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Wolne Lektury. See NOTICE for more information. msgid "" msgstr "" diff --git a/src/api/locale/it/LC_MESSAGES/django.po b/src/api/locale/it/LC_MESSAGES/django.po index 01442ed45..cd128ef69 100644 --- a/src/api/locale/it/LC_MESSAGES/django.po +++ b/src/api/locale/it/LC_MESSAGES/django.po @@ -1,4 +1,4 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Wolne Lektury. See NOTICE for more information. msgid "" msgstr "" diff --git a/src/api/locale/lt/LC_MESSAGES/django.po b/src/api/locale/lt/LC_MESSAGES/django.po index 53041eeb4..794ac511b 100644 --- a/src/api/locale/lt/LC_MESSAGES/django.po +++ b/src/api/locale/lt/LC_MESSAGES/django.po @@ -1,4 +1,4 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Wolne Lektury. See NOTICE for more information. msgid "" msgstr "" diff --git a/src/api/locale/ru/LC_MESSAGES/django.po b/src/api/locale/ru/LC_MESSAGES/django.po index e0be1f7a7..39befd7ca 100644 --- a/src/api/locale/ru/LC_MESSAGES/django.po +++ b/src/api/locale/ru/LC_MESSAGES/django.po @@ -1,4 +1,4 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Wolne Lektury. See NOTICE for more information. msgid "" msgstr "" diff --git a/src/api/locale/uk/LC_MESSAGES/django.po b/src/api/locale/uk/LC_MESSAGES/django.po index 1092e519c..9112b4963 100644 --- a/src/api/locale/uk/LC_MESSAGES/django.po +++ b/src/api/locale/uk/LC_MESSAGES/django.po @@ -1,4 +1,4 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Wolne Lektury. See NOTICE for more information. msgid "" msgstr "" diff --git a/src/api/migrations/0001_initial.py b/src/api/migrations/0001_initial.py index 4c3af2f34..b2e300dac 100644 --- a/src/api/migrations/0001_initial.py +++ b/src/api/migrations/0001_initial.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.db import models, migrations import django.db.models.deletion diff --git a/src/api/migrations/0002_auto_20151221_1225.py b/src/api/migrations/0002_auto_20151221_1225.py index 4245868dd..42b4c8ebc 100644 --- a/src/api/migrations/0002_auto_20151221_1225.py +++ b/src/api/migrations/0002_auto_20151221_1225.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.db import migrations, models diff --git a/src/api/migrations/0003_bookuserdata.py b/src/api/migrations/0003_bookuserdata.py index f8b45e7e2..7615c3446 100644 --- a/src/api/migrations/0003_bookuserdata.py +++ b/src/api/migrations/0003_bookuserdata.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.db import migrations, models import django.db.models.deletion diff --git a/src/api/migrations/0004_bookuserdata_last_changed.py b/src/api/migrations/0004_bookuserdata_last_changed.py index d00ac8bd6..1e6f04715 100644 --- a/src/api/migrations/0004_bookuserdata_last_changed.py +++ b/src/api/migrations/0004_bookuserdata_last_changed.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # import datetime from django.db import migrations, models diff --git a/src/api/migrations/0005_consumer_nonce_resource_token.py b/src/api/migrations/0005_consumer_nonce_resource_token.py index 9b706a4ad..85fa50af3 100644 --- a/src/api/migrations/0005_consumer_nonce_resource_token.py +++ b/src/api/migrations/0005_consumer_nonce_resource_token.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.conf import settings from django.db import migrations, models diff --git a/src/api/models.py b/src/api/models.py index e86324eeb..04d08e96d 100644 --- a/src/api/models.py +++ b/src/api/models.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.conf import settings from django.contrib.auth.models import User diff --git a/src/api/renderers.py b/src/api/renderers.py index 3f742db27..3ccf1a2fb 100644 --- a/src/api/renderers.py +++ b/src/api/renderers.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from rest_framework_xml.renderers import XMLRenderer diff --git a/src/api/request_validator.py b/src/api/request_validator.py index 9a4be2da8..78834ffa2 100644 --- a/src/api/request_validator.py +++ b/src/api/request_validator.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # import time from oauthlib.oauth1 import RequestValidator diff --git a/src/api/serializers.py b/src/api/serializers.py index eb6994c73..e0bf0eeee 100644 --- a/src/api/serializers.py +++ b/src/api/serializers.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.contrib.auth.models import User from rest_framework import serializers diff --git a/src/api/tests/tests.py b/src/api/tests/tests.py index 5ad5ca34f..6862f2423 100644 --- a/src/api/tests/tests.py +++ b/src/api/tests/tests.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from base64 import b64encode import hashlib diff --git a/src/api/urls.py b/src/api/urls.py index 4fb321a32..2c4c792af 100644 --- a/src/api/urls.py +++ b/src/api/urls.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.urls import path, include from django.views.decorators.csrf import csrf_exempt diff --git a/src/api/utils.py b/src/api/utils.py index 3674838db..3b23246b9 100644 --- a/src/api/utils.py +++ b/src/api/utils.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.http import HttpResponse, HttpResponseRedirect from django.utils.decorators import method_decorator diff --git a/src/api/views.py b/src/api/views.py index be1491b6f..64a7eb0ee 100644 --- a/src/api/views.py +++ b/src/api/views.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.contrib.auth.decorators import login_required from django import forms diff --git a/src/catalogue/__init__.py b/src/catalogue/__init__.py index f8c87fb47..534211a4e 100644 --- a/src/catalogue/__init__.py +++ b/src/catalogue/__init__.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # import logging from django.conf import settings diff --git a/src/catalogue/admin.py b/src/catalogue/admin.py index ad5e209aa..d1e3c1f23 100644 --- a/src/catalogue/admin.py +++ b/src/catalogue/admin.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.contrib import admin from catalogue.models import Tag, Book, Fragment, BookMedia, Collection, Source, Snippet diff --git a/src/catalogue/api/fields.py b/src/catalogue/api/fields.py index d95c3a857..64eab24ba 100644 --- a/src/catalogue/api/fields.py +++ b/src/catalogue/api/fields.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from rest_framework import serializers from api.fields import AbsoluteURLField diff --git a/src/catalogue/api/helpers.py b/src/catalogue/api/helpers.py index 7971268b0..9fe7bdbd7 100644 --- a/src/catalogue/api/helpers.py +++ b/src/catalogue/api/helpers.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.db.models import Q from catalogue.models import Book diff --git a/src/catalogue/api/serializers.py b/src/catalogue/api/serializers.py index 9baba3461..daa86fec8 100644 --- a/src/catalogue/api/serializers.py +++ b/src/catalogue/api/serializers.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from rest_framework import serializers from api.fields import AbsoluteURLField, LegacyMixin, ThumbnailField diff --git a/src/catalogue/api/urls.py b/src/catalogue/api/urls.py index 4e0d937c1..c211c2204 100644 --- a/src/catalogue/api/urls.py +++ b/src/catalogue/api/urls.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.urls import path, re_path from stats.utils import piwik_track_view diff --git a/src/catalogue/api/views.py b/src/catalogue/api/views.py index e7ed8c633..932f9cda8 100644 --- a/src/catalogue/api/views.py +++ b/src/catalogue/api/views.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # import json import os.path diff --git a/src/catalogue/apps.py b/src/catalogue/apps.py index 36c6b8419..284b530e7 100644 --- a/src/catalogue/apps.py +++ b/src/catalogue/apps.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.apps import AppConfig diff --git a/src/catalogue/constants.py b/src/catalogue/constants.py index 066a43c18..becb81731 100644 --- a/src/catalogue/constants.py +++ b/src/catalogue/constants.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.utils.translation import gettext_lazy as _ diff --git a/src/catalogue/feeds.py b/src/catalogue/feeds.py index 8658c8c55..ee4b37f1b 100644 --- a/src/catalogue/feeds.py +++ b/src/catalogue/feeds.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.contrib.sites.models import Site from django.contrib.syndication.views import Feed diff --git a/src/catalogue/fields.py b/src/catalogue/fields.py index 423be1d82..c4dec7e3f 100644 --- a/src/catalogue/fields.py +++ b/src/catalogue/fields.py @@ -1,15 +1,19 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # +import io import os import pkg_resources import random +import time +from urllib.request import urlopen from django.apps import apps from django.conf import settings from django.core.files import File from django.db import models from django.db.models.fields.files import FieldFile from django.utils.deconstruct import deconstructible +from librarian.cover import make_cover from catalogue.constants import LANGUAGES_3TO2 from catalogue.utils import absolute_url, remove_zip, truncate_html_words, gallery_path, gallery_url from waiter.utils import clear_cache @@ -31,6 +35,25 @@ class UploadToPath(object): return isinstance(other, type(self)) and other.path == self.path +def get_make_cover(book): + extra = book.get_extra_info_json() + cover_logo = extra.get('logo_mono', extra.get('logo')) + if cover_logo: + while True: + try: + cover_logo = io.BytesIO(urlopen(cover_logo, timeout=3).read()) + except: + time.sleep(2) + else: + break + + def mc(*args, **kwargs): + if cover_logo: + kwargs['cover_logo'] = cover_logo + return make_cover(*args, **kwargs) + return mc + + class EbookFieldFile(FieldFile): """Represents contents of an ebook file field.""" @@ -172,7 +195,7 @@ class EbookField(models.FileField): return found @staticmethod - def transform(wldoc): + def transform(wldoc, book): """Transforms an librarian.WLDocument into an librarian.OutputFile. """ raise NotImplemented() @@ -185,6 +208,7 @@ class EbookField(models.FileField): book = fieldfile.instance out = self.transform( book.wldocument2() if self.librarian2_api else book.wldocument(), + book, ) with open(out.get_filename(), 'rb') as f: fieldfile.save(None, File(f), save=False) @@ -207,7 +231,7 @@ class TxtField(EbookField): for_parents = False @staticmethod - def transform(wldoc): + def transform(wldoc, book): return wldoc.as_text() @@ -217,7 +241,7 @@ class Fb2Field(EbookField): ZIP = 'wolnelektury_pl_fb2' @staticmethod - def transform(wldoc): + def transform(wldoc, book): return wldoc.as_fb2() @@ -226,10 +250,14 @@ class PdfField(EbookField): ZIP = 'wolnelektury_pl_pdf' @staticmethod - def transform(wldoc): + def transform(wldoc, book): + MediaInsertSet = apps.get_model('annoy', 'MediaInsertSet') return wldoc.as_pdf( - morefloats=settings.LIBRARIAN_PDF_MOREFLOATS, cover=True, - base_url=absolute_url(gallery_url(wldoc.book_info.url.slug)), customizations=['notoc']) + morefloats=settings.LIBRARIAN_PDF_MOREFLOATS, + cover=get_make_cover(book), + base_url=absolute_url(gallery_url(wldoc.book_info.url.slug)), customizations=['notoc'], + fundraising=MediaInsertSet.get_texts_for('pdf'), + ) def build(self, fieldfile): super().build(fieldfile) @@ -242,12 +270,13 @@ class EpubField(EbookField): ZIP = 'wolnelektury_pl_epub' @staticmethod - def transform(wldoc): + def transform(wldoc, book): from librarian.builders import EpubBuilder MediaInsertSet = apps.get_model('annoy', 'MediaInsertSet') return EpubBuilder( base_url='file://' + os.path.abspath(gallery_path(wldoc.meta.url.slug)) + '/', - fundraising=MediaInsertSet.get_texts_for('epub') + fundraising=MediaInsertSet.get_texts_for('epub'), + cover=get_make_cover(book), ).build(wldoc) @@ -257,12 +286,13 @@ class MobiField(EbookField): ZIP = 'wolnelektury_pl_mobi' @staticmethod - def transform(wldoc): + def transform(wldoc, book): from librarian.builders import MobiBuilder MediaInsertSet = apps.get_model('annoy', 'MediaInsertSet') return MobiBuilder( base_url='file://' + os.path.abspath(gallery_path(wldoc.meta.url.slug)) + '/', - fundraising=MediaInsertSet.get_texts_for('mobi') + fundraising=MediaInsertSet.get_texts_for('mobi'), + cover=get_make_cover(book), ).build(wldoc) @@ -279,7 +309,7 @@ class HtmlField(EbookField): book = fieldfile.instance - html_output = self.transform(book.wldocument(parse_dublincore=False)) + html_output = self.transform(book.wldocument(parse_dublincore=False), book) # Delete old fragments, create from scratch if necessary. book.fragments.all().delete() @@ -359,7 +389,7 @@ class HtmlField(EbookField): return False @staticmethod - def transform(wldoc): + def transform(wldoc, book): # ugly, but we can't use wldoc.book_info here from librarian import DCNS url_elem = wldoc.edoc.getroot().find('.//' + DCNS('identifier.url')) @@ -378,8 +408,8 @@ class CoverField(EbookField): directory = 'cover' @staticmethod - def transform(wldoc): - return wldoc.as_cover() + def transform(wldoc, book): + return get_make_cover(book)(wldoc.book_info, width=360).output_file() def set_file_permissions(self, fieldfile): pass @@ -389,16 +419,15 @@ class CoverCleanField(CoverField): directory = 'cover_clean' @staticmethod - def transform(wldoc): - from librarian.covers.marquise import MarquiseCover - return MarquiseCover(wldoc.book_info, width=360).output_file() + def transform(wldoc, book): + return get_make_cover(book)(wldoc.book_info, width=360).output_file() class CoverThumbField(CoverField): directory = 'cover_thumb' @staticmethod - def transform(wldoc): + def transform(wldoc, book): from librarian.cover import WLCover return WLCover(wldoc.book_info, height=193).output_file() @@ -407,7 +436,7 @@ class CoverApiThumbField(CoverField): directory = 'cover_api_thumb' @staticmethod - def transform(wldoc): + def transform(wldoc, book): from librarian.cover import WLNoBoxCover return WLNoBoxCover(wldoc.book_info, height=500).output_file() @@ -416,7 +445,7 @@ class SimpleCoverField(CoverField): directory = 'cover_simple' @staticmethod - def transform(wldoc): + def transform(wldoc, book): from librarian.cover import WLNoBoxCover return WLNoBoxCover(wldoc.book_info, height=1000).output_file() @@ -425,6 +454,6 @@ class CoverEbookpointField(CoverField): directory = 'cover_ebookpoint' @staticmethod - def transform(wldoc): + def transform(wldoc, book): from librarian.cover import EbookpointCover return EbookpointCover(wldoc.book_info).output_file() diff --git a/src/catalogue/forms.py b/src/catalogue/forms.py index 080b588dd..919ff3a62 100644 --- a/src/catalogue/forms.py +++ b/src/catalogue/forms.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django import forms from django.utils.translation import gettext_lazy as _ @@ -17,6 +17,9 @@ class BookImportForm(forms.Form): gallery_url = forms.CharField(required=False) days = forms.IntegerField(required=False) hidden = forms.BooleanField(required=False) + logo = forms.CharField(required=False) + logo_mono = forms.CharField(required=False) + logo_alt = forms.CharField(required=False) def clean(self): from django.core.files.base import ContentFile @@ -34,6 +37,9 @@ class BookImportForm(forms.Form): remote_gallery_url=self.cleaned_data['gallery_url'], days=self.cleaned_data['days'], findable=not self.cleaned_data['hidden'], + logo=self.cleaned_data['logo'], + logo_mono=self.cleaned_data['logo_mono'], + logo_alt=self.cleaned_data['logo_alt'], **kwargs) diff --git a/src/catalogue/helpers.py b/src/catalogue/helpers.py index c4b926783..b1ee96e10 100644 --- a/src/catalogue/helpers.py +++ b/src/catalogue/helpers.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.conf import settings from django.contrib.contenttypes.models import ContentType diff --git a/src/catalogue/import_utils.py b/src/catalogue/import_utils.py index 587e05be3..c63a11176 100644 --- a/src/catalogue/import_utils.py +++ b/src/catalogue/import_utils.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from librarian import DocProvider diff --git a/src/catalogue/locale/de/LC_MESSAGES/django.po b/src/catalogue/locale/de/LC_MESSAGES/django.po index 939d8eeb7..a07b64c09 100644 --- a/src/catalogue/locale/de/LC_MESSAGES/django.po +++ b/src/catalogue/locale/de/LC_MESSAGES/django.po @@ -1,4 +1,4 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Wolne Lektury. See NOTICE for more information. msgid "" msgstr "" diff --git a/src/catalogue/locale/en/LC_MESSAGES/django.po b/src/catalogue/locale/en/LC_MESSAGES/django.po index a8aae0777..aff344577 100644 --- a/src/catalogue/locale/en/LC_MESSAGES/django.po +++ b/src/catalogue/locale/en/LC_MESSAGES/django.po @@ -1,4 +1,4 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Wolne Lektury. See NOTICE for more information. msgid "" msgstr "" diff --git a/src/catalogue/locale/es/LC_MESSAGES/django.po b/src/catalogue/locale/es/LC_MESSAGES/django.po index babeac34b..1ee737e3c 100644 --- a/src/catalogue/locale/es/LC_MESSAGES/django.po +++ b/src/catalogue/locale/es/LC_MESSAGES/django.po @@ -1,4 +1,4 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Wolne Lektury. See NOTICE for more information. msgid "" msgstr "" diff --git a/src/catalogue/locale/fr/LC_MESSAGES/django.po b/src/catalogue/locale/fr/LC_MESSAGES/django.po index af5189977..6daf43c54 100644 --- a/src/catalogue/locale/fr/LC_MESSAGES/django.po +++ b/src/catalogue/locale/fr/LC_MESSAGES/django.po @@ -1,4 +1,4 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Wolne Lektury. See NOTICE for more information. msgid "" msgstr "" diff --git a/src/catalogue/locale/it/LC_MESSAGES/django.po b/src/catalogue/locale/it/LC_MESSAGES/django.po index ad89f98e6..cfcc97133 100644 --- a/src/catalogue/locale/it/LC_MESSAGES/django.po +++ b/src/catalogue/locale/it/LC_MESSAGES/django.po @@ -1,4 +1,4 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Wolne Lektury. See NOTICE for more information. msgid "" msgstr "" diff --git a/src/catalogue/locale/lt/LC_MESSAGES/django.po b/src/catalogue/locale/lt/LC_MESSAGES/django.po index fd076d0c6..7b1685548 100644 --- a/src/catalogue/locale/lt/LC_MESSAGES/django.po +++ b/src/catalogue/locale/lt/LC_MESSAGES/django.po @@ -1,4 +1,4 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Wolne Lektury. See NOTICE for more information. msgid "" msgstr "" diff --git a/src/catalogue/locale/ru/LC_MESSAGES/django.po b/src/catalogue/locale/ru/LC_MESSAGES/django.po index eb6e6f2f2..f00b8aab0 100644 --- a/src/catalogue/locale/ru/LC_MESSAGES/django.po +++ b/src/catalogue/locale/ru/LC_MESSAGES/django.po @@ -1,4 +1,4 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Wolne Lektury. See NOTICE for more information. msgid "" msgstr "" diff --git a/src/catalogue/locale/uk/LC_MESSAGES/django.po b/src/catalogue/locale/uk/LC_MESSAGES/django.po index 4b6bd1005..3979cda58 100644 --- a/src/catalogue/locale/uk/LC_MESSAGES/django.po +++ b/src/catalogue/locale/uk/LC_MESSAGES/django.po @@ -1,4 +1,4 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Wolne Lektury. See NOTICE for more information. msgid "" msgstr "" diff --git a/src/catalogue/management/commands/build_stale.py b/src/catalogue/management/commands/build_stale.py index 26e1cf65a..62ab73c60 100644 --- a/src/catalogue/management/commands/build_stale.py +++ b/src/catalogue/management/commands/build_stale.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from time import time from django.conf import settings diff --git a/src/catalogue/management/commands/checkcovers.py b/src/catalogue/management/commands/checkcovers.py index db9fc4c47..6b94fec31 100644 --- a/src/catalogue/management/commands/checkcovers.py +++ b/src/catalogue/management/commands/checkcovers.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.contrib.sites.models import Site from django.core.management.base import BaseCommand diff --git a/src/catalogue/management/commands/checkintegrity.py b/src/catalogue/management/commands/checkintegrity.py index e7d5ffd78..02afe79bd 100644 --- a/src/catalogue/management/commands/checkintegrity.py +++ b/src/catalogue/management/commands/checkintegrity.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.core.management.base import BaseCommand from librarian import ParseError diff --git a/src/catalogue/management/commands/gencover.py b/src/catalogue/management/commands/gencover.py index c0d099b60..258a402c1 100644 --- a/src/catalogue/management/commands/gencover.py +++ b/src/catalogue/management/commands/gencover.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.core.management.base import BaseCommand diff --git a/src/catalogue/management/commands/importbooks.py b/src/catalogue/management/commands/importbooks.py index 9322eea0b..8306ffb03 100644 --- a/src/catalogue/management/commands/importbooks.py +++ b/src/catalogue/management/commands/importbooks.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # import os import sys diff --git a/src/catalogue/management/commands/load_abstracts.py b/src/catalogue/management/commands/load_abstracts.py index 587f9436b..f9fb2c155 100644 --- a/src/catalogue/management/commands/load_abstracts.py +++ b/src/catalogue/management/commands/load_abstracts.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.core.management.base import BaseCommand diff --git a/src/catalogue/management/commands/pack.py b/src/catalogue/management/commands/pack.py index 22b36e985..f4157fd40 100644 --- a/src/catalogue/management/commands/pack.py +++ b/src/catalogue/management/commands/pack.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # import zipfile from django.core.management.base import BaseCommand diff --git a/src/catalogue/management/commands/report_dead_links.py b/src/catalogue/management/commands/report_dead_links.py index 5f193c415..866a7d0d1 100644 --- a/src/catalogue/management/commands/report_dead_links.py +++ b/src/catalogue/management/commands/report_dead_links.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.core.management.base import BaseCommand diff --git a/src/catalogue/management/commands/update_counters.py b/src/catalogue/management/commands/update_counters.py index c79f61441..c547b54e0 100644 --- a/src/catalogue/management/commands/update_counters.py +++ b/src/catalogue/management/commands/update_counters.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.conf import settings from django.core.management.base import BaseCommand diff --git a/src/catalogue/management/commands/update_popularity.py b/src/catalogue/management/commands/update_popularity.py index d2af0d4e9..89d23319f 100644 --- a/src/catalogue/management/commands/update_popularity.py +++ b/src/catalogue/management/commands/update_popularity.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.core.management.base import BaseCommand from django.db.models import Count diff --git a/src/catalogue/management/commands/update_preview_status.py b/src/catalogue/management/commands/update_preview_status.py index dc3631efa..af6d9750e 100644 --- a/src/catalogue/management/commands/update_preview_status.py +++ b/src/catalogue/management/commands/update_preview_status.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from datetime import date from django.core.management.base import BaseCommand diff --git a/src/catalogue/management/commands/update_tag_description.py b/src/catalogue/management/commands/update_tag_description.py index bd005623c..0fb2ffd95 100644 --- a/src/catalogue/management/commands/update_tag_description.py +++ b/src/catalogue/management/commands/update_tag_description.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.core.management import BaseCommand from catalogue.models import Tag diff --git a/src/catalogue/migrations/0001_initial.py b/src/catalogue/migrations/0001_initial.py index 448b8b90d..7a2d42719 100644 --- a/src/catalogue/migrations/0001_initial.py +++ b/src/catalogue/migrations/0001_initial.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.db import models, migrations import django.db.models.deletion diff --git a/src/catalogue/migrations/0002_book_ancestor.py b/src/catalogue/migrations/0002_book_ancestor.py index 49dd6f08c..3803e4b38 100644 --- a/src/catalogue/migrations/0002_book_ancestor.py +++ b/src/catalogue/migrations/0002_book_ancestor.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.db import models, migrations diff --git a/src/catalogue/migrations/0003_populate_ancestors.py b/src/catalogue/migrations/0003_populate_ancestors.py index c36aee1d4..9d28165c8 100644 --- a/src/catalogue/migrations/0003_populate_ancestors.py +++ b/src/catalogue/migrations/0003_populate_ancestors.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.db import migrations diff --git a/src/catalogue/migrations/0004_remove_booktags_count_related_info.py b/src/catalogue/migrations/0004_remove_booktags_count_related_info.py index e474f1b24..1fadf166b 100644 --- a/src/catalogue/migrations/0004_remove_booktags_count_related_info.py +++ b/src/catalogue/migrations/0004_remove_booktags_count_related_info.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.db import models, migrations diff --git a/src/catalogue/migrations/0005_auto_20141016_1337.py b/src/catalogue/migrations/0005_auto_20141016_1337.py index 202e51921..63835bcae 100644 --- a/src/catalogue/migrations/0005_auto_20141016_1337.py +++ b/src/catalogue/migrations/0005_auto_20141016_1337.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.db import models, migrations diff --git a/src/catalogue/migrations/0006_auto_20141022_1059.py b/src/catalogue/migrations/0006_auto_20141022_1059.py index 7f12f6d20..efc6419d6 100644 --- a/src/catalogue/migrations/0006_auto_20141022_1059.py +++ b/src/catalogue/migrations/0006_auto_20141022_1059.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.db import models, migrations diff --git a/src/catalogue/migrations/0007_auto_20151123_1529.py b/src/catalogue/migrations/0007_auto_20151123_1529.py index 3bd9b9cc8..c81d842ef 100644 --- a/src/catalogue/migrations/0007_auto_20151123_1529.py +++ b/src/catalogue/migrations/0007_auto_20151123_1529.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.db import models, migrations diff --git a/src/catalogue/migrations/0008_auto_20151221_1225.py b/src/catalogue/migrations/0008_auto_20151221_1225.py index cdaaa0eb4..0db124071 100644 --- a/src/catalogue/migrations/0008_auto_20151221_1225.py +++ b/src/catalogue/migrations/0008_auto_20151221_1225.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.db import migrations, models import catalogue.fields diff --git a/src/catalogue/migrations/0009_auto_20160127_1019.py b/src/catalogue/migrations/0009_auto_20160127_1019.py index 9def7ad28..a083d6a7a 100644 --- a/src/catalogue/migrations/0009_auto_20160127_1019.py +++ b/src/catalogue/migrations/0009_auto_20160127_1019.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.db import migrations, models diff --git a/src/catalogue/migrations/0010_bookpopularity.py b/src/catalogue/migrations/0010_bookpopularity.py index 81834f932..fe5e109fb 100644 --- a/src/catalogue/migrations/0010_bookpopularity.py +++ b/src/catalogue/migrations/0010_bookpopularity.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.db import migrations, models import django.db.models.deletion diff --git a/src/catalogue/migrations/0011_auto_20160413_1152.py b/src/catalogue/migrations/0011_auto_20160413_1152.py index 43ac38532..3c3100424 100644 --- a/src/catalogue/migrations/0011_auto_20160413_1152.py +++ b/src/catalogue/migrations/0011_auto_20160413_1152.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.db import migrations, models diff --git a/src/catalogue/migrations/0012_auto_20161020_1407.py b/src/catalogue/migrations/0012_auto_20161020_1407.py index 34c700ce2..311981a43 100644 --- a/src/catalogue/migrations/0012_auto_20161020_1407.py +++ b/src/catalogue/migrations/0012_auto_20161020_1407.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.db import migrations, models diff --git a/src/catalogue/migrations/0013_book_print_on_demand.py b/src/catalogue/migrations/0013_book_print_on_demand.py index d6addf77b..e30aedac7 100644 --- a/src/catalogue/migrations/0013_book_print_on_demand.py +++ b/src/catalogue/migrations/0013_book_print_on_demand.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.db import migrations, models diff --git a/src/catalogue/migrations/0014_auto_20170627_1442.py b/src/catalogue/migrations/0014_auto_20170627_1442.py index cdfac230d..e386c3c8d 100644 --- a/src/catalogue/migrations/0014_auto_20170627_1442.py +++ b/src/catalogue/migrations/0014_auto_20170627_1442.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.db import migrations, models import fnpdjango.storage diff --git a/src/catalogue/migrations/0015_book_recommended.py b/src/catalogue/migrations/0015_book_recommended.py index d92d45884..a950082cd 100644 --- a/src/catalogue/migrations/0015_book_recommended.py +++ b/src/catalogue/migrations/0015_book_recommended.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.db import migrations, models diff --git a/src/catalogue/migrations/0016_auto_20171031_1232.py b/src/catalogue/migrations/0016_auto_20171031_1232.py index 8e0080e50..81ddeef57 100644 --- a/src/catalogue/migrations/0016_auto_20171031_1232.py +++ b/src/catalogue/migrations/0016_auto_20171031_1232.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.db import migrations, models diff --git a/src/catalogue/migrations/0017_auto_20171214_1746.py b/src/catalogue/migrations/0017_auto_20171214_1746.py index 0d5b36e40..37786e543 100644 --- a/src/catalogue/migrations/0017_auto_20171214_1746.py +++ b/src/catalogue/migrations/0017_auto_20171214_1746.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.db import migrations, models diff --git a/src/catalogue/migrations/0018_auto_20171221_1106.py b/src/catalogue/migrations/0018_auto_20171221_1106.py index 9a2aee3c9..45b59b4ef 100644 --- a/src/catalogue/migrations/0018_auto_20171221_1106.py +++ b/src/catalogue/migrations/0018_auto_20171221_1106.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.db import migrations, models diff --git a/src/catalogue/migrations/0019_auto_20171221_1107.py b/src/catalogue/migrations/0019_auto_20171221_1107.py index 17f7db110..1b897ffbe 100644 --- a/src/catalogue/migrations/0019_auto_20171221_1107.py +++ b/src/catalogue/migrations/0019_auto_20171221_1107.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.db import migrations, models diff --git a/src/catalogue/migrations/0020_book_cover_api_thumb.py b/src/catalogue/migrations/0020_book_cover_api_thumb.py index 4c9cd8ef4..9975112d8 100644 --- a/src/catalogue/migrations/0020_book_cover_api_thumb.py +++ b/src/catalogue/migrations/0020_book_cover_api_thumb.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.db import migrations, models import catalogue.fields diff --git a/src/catalogue/migrations/0021_auto_20171222_1404.py b/src/catalogue/migrations/0021_auto_20171222_1404.py index 6e0331cb5..bead8607b 100644 --- a/src/catalogue/migrations/0021_auto_20171222_1404.py +++ b/src/catalogue/migrations/0021_auto_20171222_1404.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.db import migrations, models import catalogue.fields diff --git a/src/catalogue/migrations/0022_auto_20180226_1503.py b/src/catalogue/migrations/0022_auto_20180226_1503.py index fef3abb02..e8dd3a65c 100644 --- a/src/catalogue/migrations/0022_auto_20180226_1503.py +++ b/src/catalogue/migrations/0022_auto_20180226_1503.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.db import migrations, models diff --git a/src/catalogue/migrations/0023_book_abstract.py b/src/catalogue/migrations/0023_book_abstract.py index 2959bd552..ee707ec63 100644 --- a/src/catalogue/migrations/0023_book_abstract.py +++ b/src/catalogue/migrations/0023_book_abstract.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.db import migrations, models diff --git a/src/catalogue/migrations/0024_auto_20180510_1407.py b/src/catalogue/migrations/0024_auto_20180510_1407.py index 620723a2a..b3789dddb 100644 --- a/src/catalogue/migrations/0024_auto_20180510_1407.py +++ b/src/catalogue/migrations/0024_auto_20180510_1407.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.db import migrations, models diff --git a/src/catalogue/migrations/0024_book_audio_length.py b/src/catalogue/migrations/0024_book_audio_length.py index 6d2d87210..86e7d97fb 100644 --- a/src/catalogue/migrations/0024_book_audio_length.py +++ b/src/catalogue/migrations/0024_book_audio_length.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.db import migrations, models diff --git a/src/catalogue/migrations/0025_merge.py b/src/catalogue/migrations/0025_merge.py index b43ede851..301e9c169 100644 --- a/src/catalogue/migrations/0025_merge.py +++ b/src/catalogue/migrations/0025_merge.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.db import migrations, models diff --git a/src/catalogue/migrations/0026_book_preview_key.py b/src/catalogue/migrations/0026_book_preview_key.py index e5ab008ca..71e2204d9 100644 --- a/src/catalogue/migrations/0026_book_preview_key.py +++ b/src/catalogue/migrations/0026_book_preview_key.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.db import migrations, models diff --git a/src/catalogue/models/__init__.py b/src/catalogue/models/__init__.py index 81f36d1ea..67d999c5f 100644 --- a/src/catalogue/models/__init__.py +++ b/src/catalogue/models/__init__.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from catalogue.models.tag import Tag from catalogue.models.bookmedia import BookMedia diff --git a/src/catalogue/models/book.py b/src/catalogue/models/book.py index 35d0e8c4e..10e9d22e3 100644 --- a/src/catalogue/models/book.py +++ b/src/catalogue/models/book.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from collections import OrderedDict import json @@ -331,6 +331,9 @@ class Book(models.Model): total += app_settings.GET_MP3_LENGTH(media.file.path) return int(total) + def get_time(self): + return round(self.xml_file.size / 1000 * 40) + def has_media(self, type_): if type_ in Book.formats: return bool(getattr(self, "%s_file" % type_)) @@ -594,7 +597,7 @@ class Book(models.Model): @classmethod def from_text_and_meta(cls, raw_file, book_info, overwrite=False, dont_build=None, search_index=True, - remote_gallery_url=None, days=0, findable=True): + remote_gallery_url=None, days=0, findable=True, logo=None, logo_mono=None, logo_alt=None): from catalogue import tasks if dont_build is None: @@ -641,7 +644,14 @@ class Book(models.Model): book.common_slug = book_info.variant_of.slug else: book.common_slug = book.slug - book.extra_info = json.dumps(book_info.to_dict()) + extra = book_info.to_dict() + if logo: + extra['logo'] = logo + if logo_mono: + extra['logo_mono'] = logo_mono + if logo_alt: + extra['logo_alt'] = logo_alt + book.extra_info = json.dumps(extra) book.load_abstract() book.load_toc() book.save() @@ -729,8 +739,12 @@ class Book(models.Model): else: entity, entity_created = Entity.objects.get_or_create(uri=uri) if entity_created: - entity.populate() - entity.save() + try: + entity.populate() + except: + pass + else: + entity.save() ref, ref_created = entity.reference_set.get_or_create(book=self) refs[uri] = ref if not ref_created: diff --git a/src/catalogue/models/bookmedia.py b/src/catalogue/models/bookmedia.py index fe8b02f43..acb1881e5 100644 --- a/src/catalogue/models/bookmedia.py +++ b/src/catalogue/models/bookmedia.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from collections import OrderedDict import json diff --git a/src/catalogue/models/collection.py b/src/catalogue/models/collection.py index 2366321bd..d9ab5da00 100644 --- a/src/catalogue/models/collection.py +++ b/src/catalogue/models/collection.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.conf import settings from django.db import models diff --git a/src/catalogue/models/fragment.py b/src/catalogue/models/fragment.py index 0bbd4260d..6609ba8f5 100644 --- a/src/catalogue/models/fragment.py +++ b/src/catalogue/models/fragment.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.conf import settings from django.contrib.contenttypes.fields import GenericRelation diff --git a/src/catalogue/models/source.py b/src/catalogue/models/source.py index 332a98f13..b2259d467 100644 --- a/src/catalogue/models/source.py +++ b/src/catalogue/models/source.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.db import models diff --git a/src/catalogue/models/tag.py b/src/catalogue/models/tag.py index 4046d34d3..cdc1dc8a2 100644 --- a/src/catalogue/models/tag.py +++ b/src/catalogue/models/tag.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.conf import settings from django.contrib.contenttypes.fields import GenericForeignKey diff --git a/src/catalogue/signals.py b/src/catalogue/signals.py index 9b8fb55b2..7dd68d445 100644 --- a/src/catalogue/signals.py +++ b/src/catalogue/signals.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.conf import settings from django.core.cache import caches diff --git a/src/catalogue/tasks.py b/src/catalogue/tasks.py index 0694b0174..20690c63d 100644 --- a/src/catalogue/tasks.py +++ b/src/catalogue/tasks.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from traceback import print_exc from celery import shared_task diff --git a/src/catalogue/templates/catalogue/book_info.html b/src/catalogue/templates/catalogue/book_info.html index 3da38b2a7..838b59fb0 100644 --- a/src/catalogue/templates/catalogue/book_info.html +++ b/src/catalogue/templates/catalogue/book_info.html @@ -1,5 +1,6 @@ {% load i18n %} {% load catalogue_tags %} +{% load thumbnail %} {% with extra_info=book.get_extra_info_json %}

@@ -39,6 +40,14 @@

{{ extra_info.description }}

{% endif %} + {% if extra_info.logo %} + {% thumbnail extra_info.logo '300x200' as th %} + {{ extra_info.logo_alt|default:'Sponsor' }} + {% endthumbnail %} + {% endif %} + {% if extra_info.editor or extra_info.technical_editor %}

{% if is_picture %} diff --git a/src/catalogue/templates/catalogue/book_text.html b/src/catalogue/templates/catalogue/book_text.html index d9474b5a8..421d439fe 100644 --- a/src/catalogue/templates/catalogue/book_text.html +++ b/src/catalogue/templates/catalogue/book_text.html @@ -1,8 +1,11 @@ -{% extends "catalogue/viewer_base.html" %} +{% extends "base.html" %} + + {% load i18n l10n %} {% load catalogue_tags %} {% load chunks %} {% load thumbnail %} +{% load static %} {% load annoy_banners from annoy %} @@ -18,6 +21,7 @@ crossorigin=""> {% endblock %} + {% block menu %}

  • @@ -37,82 +41,199 @@
  • {% endif %} - + {% if extra_info.logo_mono %} + {% thumbnail extra_info.logo_mono '200x200' as th %} + {{ extra_info.logo_alt|default:'Sponsor' }} + {% endthumbnail %} + {% endif %} + - - - - {% trans "Numeracja" %} - {% trans "Motywy" %} - {% trans "Przypisy" %} - {% trans "Pinezki" %} -{% endblock menu %} -{% block big-pane %} +
    + {% book_info book %} +
    + + + + + +
    + {% if book.parent %} + {% for b in book.ancestors %} + {% if forloop.counter > 1 %} +
  • + {% endif %} + {{ b.title }} +
      + {% endfor %} + {% for b in book.get_siblings %} +
    1. + {% if b == book %} + {{ b.title }} +
      + {% else %} + {{ b.title }} + {% endif %} +
    2. + {% endfor %} + + {% for b in book.ancestor.all %} +
    + {% if not forloop.counter.last %} +
  • + {% endif %} + {% endfor %} + {% else %} + {{ book.title }} +
    +
      + {% for c in book.get_children %} +
    1. {{ c.title }}
    2. + {% endfor %} +
    + {% endif %} +
    + + +{% endblock %} + + + + +{% block main %} +
    +
    + + + +
    +
    + Szacowany czas do końca: - +
    +
    + +
    + {{ book.pretty_title }} + +
    +

    {% for author in book.authors %}{{ author.name }}{% if not forloop.last %}, {% endif %}{% endfor %} +

    +

    {{ book.title }}

    + {% with translators=book.translators %} + {% if translators %} +

    + {% if translators.0 != 'tłumacz nieznany' %} + {% trans "tłum." %} + {% endif %} + {% for translator in translators %} + {{ translator }}{% if not forloop.last %}, {% endif %} + {% endfor %} +

    + {% endif %} + {% endwith %} +
    + {% content_warning book %} +
    + +
    +
    + - -
    -
    - x -
    + + + + +
    +
    + x +
    +
    +
    - -
    + {% if book.other_versions.exists %} +
    +

    {% trans "Inne wersje utworu" %}

    + {% trans "Zamknij drugą wersję" %} + +
    + {% endif %} + +
    + {% annoy_banners 'book-text-intermission' %} + + {% for insert in inserts %} + {% include 'annoy/dynamic_insert.html' %} + {% endfor %} +
    + + -{% endblock big-pane %} -{% block footer %} {% if book.has_sync_file %}
    {% include 'catalogue/snippets/jplayer_reader.html' %} @@ -121,78 +242,6 @@ {{ book.get_sync|safe }} {% endif %} -
    - {% if book.parent %} - {% for b in book.ancestors %} - {% if forloop.counter > 1 %} -
  • - {% endif %} - {{ b.title }} -
      - {% endfor %} - {% for b in book.get_siblings %} -
    1. - {% if b == book %} - {{ b.title }} -
      - {% else %} - {{ b.title }} - {% endif %} -
    2. - {% endfor %} - - {% for b in book.ancestor.all %} -
    - {% if not forloop.counter.last %} -
  • - {% endif %} - {% endfor %} - {% else %} - {{ book.title }} -
    -
      - {% for c in book.get_children %} -
    1. {{ c.title }}
    2. - {% endfor %} -
    - {% endif %} -
    - -
    - {% book_info book %} -
    - - {% if book.other_versions.exists %} -
    -

    {% trans "Inne wersje utworu" %}

    - {% trans "Zamknij drugą wersję" %} - -
    - {% endif %} - -
    - {% include 'catalogue/book_short.html' %} -
    - -
    - {% annoy_banners 'book-text-intermission' %} - - {% for insert in inserts %} - {% include 'annoy/dynamic_insert.html' %} - {% endfor %} -
    @@ -220,4 +269,5 @@ {% endlocalize %} -{% endblock footer %} + +{% endblock main %} diff --git a/src/catalogue/templates/catalogue/preview_ad.html b/src/catalogue/templates/catalogue/preview_ad.html index b2c24462c..5cfbb1222 100644 --- a/src/catalogue/templates/catalogue/preview_ad.html +++ b/src/catalogue/templates/catalogue/preview_ad.html @@ -16,9 +16,11 @@