From 94a4fcc7ab9e1713dc2defc8b35c875fc90f6fa5 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Thu, 3 Aug 2023 17:26:24 +0200 Subject: [PATCH] Remove old version. --- src/ajaxable/templates/ajaxable/form.html | 20 +- .../templates/ajaxable/form_on_page.html | 2 +- src/ajaxable/templatetags/__init__.py | 0 src/ajaxable/templatetags/ajaxable_tags.py | 47 ----- src/api/templates/api/main.html | 2 +- src/api/templates/oauth/authorize_token.html | 2 +- src/catalogue/models/collection.py | 6 - src/catalogue/models/fragment.py | 5 - .../templates/catalogue/book_detail.html | 91 --------- .../templates/catalogue/book_fragments.html | 24 --- .../templates/catalogue/book_list.html | 37 ---- .../templates/catalogue/book_searched.html | 30 --- .../templates/catalogue/book_short.html | 11 -- .../templates/catalogue/book_wide.html | 69 ------- .../templates/catalogue/catalogue.html | 2 +- .../templates/catalogue/collection.html | 15 -- .../templates/catalogue/collection_box.html | 19 -- .../templates/catalogue/collections.html | 18 -- .../templates/catalogue/custom_pdf_form.html | 18 +- .../templates/catalogue/daisy_list.html | 19 -- .../catalogue/differentiate_tags.html | 2 +- .../templates/catalogue/fragment_short.html | 26 --- .../templates/catalogue/picture_detail.html | 90 --------- .../templates/catalogue/picture_list.html | 29 --- src/catalogue/templates/catalogue/player.html | 74 ------- .../templates/catalogue/snippets/jplayer.html | 70 ------- .../catalogue/snippets/like_button.html | 16 -- .../templates/catalogue/tag_catalogue.html | 24 --- .../catalogue/tagged_object_list.html | 102 ---------- .../templates/catalogue/work-list.html | 24 --- src/catalogue/templatetags/catalogue_tags.py | 11 -- src/catalogue/urls.py | 7 +- src/catalogue/views.py | 109 ++--------- src/club/forms.py | 103 ---------- src/club/payment_methods.py | 5 +- src/club/templates/club/dummy_payment.html | 72 ------- src/club/templates/club/index.html | 2 +- src/club/templates/club/membership_form.html | 83 -------- .../templates/club/membership_form_app.html | 22 --- src/club/templates/club/payment/dummy-re.html | 1 - src/club/templates/club/payment/dummy.html | 1 - src/club/templates/club/payment/paypal.html | 3 - src/club/templates/club/payment/payu-re.html | 13 -- src/club/templates/club/payment/payu.html | 10 - src/club/templates/club/payment_form.html | 105 ---------- src/club/templates/club/payment_info.html | 13 -- src/club/templates/club/schedule.html | 2 +- src/club/templates/club/thanks.html | 24 --- src/club/templates/club/widgets/plan.html | 25 --- src/club/templates/club/year_summary.html | 4 +- src/club/templates/payu/rec_payment.html | 5 +- src/club/urls.py | 1 - src/club/views.py | 53 +----- .../templates/dictionary/note_list.html | 2 +- .../templates/experiments/main_switch.html | 2 +- .../funding/disable_notifications.html | 2 +- src/funding/templates/funding/no_thanks.html | 2 +- .../templates/funding/offer_detail.html | 92 --------- src/funding/templates/funding/offer_list.html | 41 ---- src/funding/templates/funding/thanks.html | 2 +- src/funding/templates/funding/wlfund.html | 2 +- src/funding/views.py | 13 +- .../templates/infopages/infopage.html | 23 --- src/infopages/views.py | 4 +- src/isbn/templates/isbn/add_isbn.html | 2 +- src/isbn/templates/isbn/assigned_isbn.html | 2 +- src/isbn/templates/isbn/confirm_isbn_wl.html | 2 +- src/isbn/templates/isbn/wl_dc_tags.html | 2 +- .../templates/lesmianator/lesmianator.html | 68 ------- src/lesmianator/views.py | 2 +- .../templates/libraries/catalog_view.html | 2 +- .../templates/libraries/library_view.html | 2 +- .../templates/libraries/main_view.html | 2 +- .../templates/messaging/contact_detail.html | 2 +- .../templates/messaging/contact_form.html | 2 +- .../newsletter/confirm_subscription.html | 7 - .../templates/newsletter/subscribe_form.html | 17 -- .../templates/newsletter/subscribed.html | 9 - src/newsletter/views.py | 12 +- src/paypal/forms.py | 9 - src/paypal/templates/paypal/cancel.html | 2 +- src/paypal/templates/paypal/error.html | 6 - src/paypal/templates/paypal/error_page.html | 5 - src/paypal/templates/paypal/form.html | 25 --- src/paypal/templates/paypal/return.html | 13 -- src/paypal/views.py | 20 +- .../templates/pdcounter/author_detail.html | 58 ------ .../templates/pdcounter/book_stub_detail.html | 40 ---- .../templates/pdcounter/pd_author_box.html | 27 --- src/pdcounter/views.py | 10 +- src/picture/models.py | 20 -- src/picture/templates/picture/collection.html | 10 - .../templates/picture/picture_detail.html | 23 --- .../templates/picture/picture_list_thumb.html | 26 --- .../templates/picture/picture_searched.html | 17 -- .../templates/picture/picture_wide.html | 106 ----------- .../templates/picture/picturearea_short.html | 19 -- src/picture/templatetags/picture_tags.py | 11 -- src/picture/views.py | 44 ++--- src/polls/templates/polls/poll.html | 2 +- .../templates/push/notification_form.html | 2 +- .../templates/push/notification_sent.html | 2 +- src/search/context_processors.py | 9 - src/search/fields.py | 63 ------ src/search/forms.py | 16 +- src/search/templates/newsearch/search.html | 59 ------ src/search/templatetags/__init__.py | 0 src/search/templatetags/search_tags.py | 36 ---- src/search/templatetags/set_get_parameter.py | 49 ----- src/search/views.py | 8 + src/social/templates/social/carousel.html | 21 -- src/social/templates/social/cite_info.html | 17 -- src/social/templates/social/my_shelf.html | 17 -- src/social/templates/social/sets_form.html | 18 -- src/social/templatetags/social_tags.py | 34 ---- src/social/urls.py | 1 - src/social/views.py | 25 +-- src/stats/templates/stats/top.html | 2 +- src/suggest/templates/publishing_suggest.html | 12 +- src/suggest/templates/suggest.html | 8 - src/wolnelektury/settings/auth.py | 2 +- src/wolnelektury/settings/basic.py | 1 - src/wolnelektury/static/2021/scripts/main.js | 11 ++ .../static/2022/styles/components/_lang.scss | 25 ++- .../static/2022/styles/components/_media.scss | 42 ++++ .../2022/styles/layout/_navigation.scss | 8 + src/wolnelektury/templates/404.html | 2 +- src/wolnelektury/templates/account/base.html | 2 +- src/wolnelektury/templates/auth/login.html | 27 --- .../templates/auth/login_register.html | 9 - src/wolnelektury/templates/auth/register.html | 16 -- .../templates/auth/register_form.html | 12 -- src/wolnelektury/templates/bajki.html | 3 - src/wolnelektury/templates/base/app.html | 98 ---------- src/wolnelektury/templates/base/base.html | 4 - .../templates/base/superbase.html | 180 ------------------ .../templates/forms/form_sent.html | 2 +- .../templates/forms/includes/built_form.html | 9 - src/wolnelektury/templates/main_menu.html | 23 --- src/wolnelektury/templates/main_page.html | 142 -------------- src/wolnelektury/templates/podcast.html | 44 ----- src/wolnelektury/templates/post_test.html | 8 - src/wolnelektury/templates/publish_plan.html | 2 +- src/wolnelektury/templates/site_base.html | 5 +- .../templates/socialaccount/base.html | 2 +- .../socialaccount/login_cancelled.html | 3 +- .../templates/socialaccount/signup.html | 7 +- src/wolnelektury/templates/user.html | 2 +- src/wolnelektury/urls.py | 10 +- src/wolnelektury/views.py | 144 +------------- 150 files changed, 205 insertions(+), 3418 deletions(-) delete mode 100644 src/ajaxable/templatetags/__init__.py delete mode 100644 src/ajaxable/templatetags/ajaxable_tags.py delete mode 100644 src/catalogue/templates/catalogue/book_detail.html delete mode 100644 src/catalogue/templates/catalogue/book_fragments.html delete mode 100644 src/catalogue/templates/catalogue/book_list.html delete mode 100644 src/catalogue/templates/catalogue/book_searched.html delete mode 100644 src/catalogue/templates/catalogue/book_wide.html delete mode 100644 src/catalogue/templates/catalogue/collection.html delete mode 100644 src/catalogue/templates/catalogue/collection_box.html delete mode 100644 src/catalogue/templates/catalogue/collections.html delete mode 100644 src/catalogue/templates/catalogue/daisy_list.html delete mode 100644 src/catalogue/templates/catalogue/fragment_short.html delete mode 100644 src/catalogue/templates/catalogue/picture_detail.html delete mode 100644 src/catalogue/templates/catalogue/picture_list.html delete mode 100644 src/catalogue/templates/catalogue/player.html delete mode 100644 src/catalogue/templates/catalogue/snippets/jplayer.html delete mode 100644 src/catalogue/templates/catalogue/snippets/like_button.html delete mode 100644 src/catalogue/templates/catalogue/tag_catalogue.html delete mode 100644 src/catalogue/templates/catalogue/tagged_object_list.html delete mode 100644 src/catalogue/templates/catalogue/work-list.html delete mode 100644 src/club/templates/club/dummy_payment.html delete mode 100644 src/club/templates/club/membership_form.html delete mode 100644 src/club/templates/club/membership_form_app.html delete mode 100644 src/club/templates/club/payment/dummy-re.html delete mode 100644 src/club/templates/club/payment/dummy.html delete mode 100644 src/club/templates/club/payment/paypal.html delete mode 100644 src/club/templates/club/payment/payu-re.html delete mode 100644 src/club/templates/club/payment/payu.html delete mode 100644 src/club/templates/club/payment_form.html delete mode 100644 src/club/templates/club/payment_info.html delete mode 100644 src/club/templates/club/thanks.html delete mode 100644 src/club/templates/club/widgets/plan.html delete mode 100644 src/funding/templates/funding/offer_detail.html delete mode 100644 src/funding/templates/funding/offer_list.html delete mode 100644 src/infopages/templates/infopages/infopage.html delete mode 100644 src/lesmianator/templates/lesmianator/lesmianator.html delete mode 100644 src/newsletter/templates/newsletter/confirm_subscription.html delete mode 100644 src/newsletter/templates/newsletter/subscribe_form.html delete mode 100644 src/newsletter/templates/newsletter/subscribed.html delete mode 100644 src/paypal/forms.py delete mode 100644 src/paypal/templates/paypal/error.html delete mode 100644 src/paypal/templates/paypal/error_page.html delete mode 100644 src/paypal/templates/paypal/form.html delete mode 100644 src/paypal/templates/paypal/return.html delete mode 100644 src/pdcounter/templates/pdcounter/author_detail.html delete mode 100644 src/pdcounter/templates/pdcounter/book_stub_detail.html delete mode 100644 src/pdcounter/templates/pdcounter/pd_author_box.html delete mode 100644 src/picture/templates/picture/collection.html delete mode 100644 src/picture/templates/picture/picture_detail.html delete mode 100644 src/picture/templates/picture/picture_list_thumb.html delete mode 100644 src/picture/templates/picture/picture_searched.html delete mode 100644 src/picture/templates/picture/picture_wide.html delete mode 100644 src/picture/templates/picture/picturearea_short.html delete mode 100644 src/search/context_processors.py delete mode 100644 src/search/templates/newsearch/search.html delete mode 100644 src/search/templatetags/__init__.py delete mode 100644 src/search/templatetags/search_tags.py delete mode 100644 src/search/templatetags/set_get_parameter.py delete mode 100644 src/social/templates/social/carousel.html delete mode 100644 src/social/templates/social/cite_info.html delete mode 100644 src/social/templates/social/my_shelf.html delete mode 100644 src/social/templates/social/sets_form.html delete mode 100644 src/wolnelektury/templates/auth/login.html delete mode 100644 src/wolnelektury/templates/auth/login_register.html delete mode 100644 src/wolnelektury/templates/auth/register.html delete mode 100644 src/wolnelektury/templates/auth/register_form.html delete mode 100644 src/wolnelektury/templates/bajki.html delete mode 100644 src/wolnelektury/templates/base/app.html delete mode 100644 src/wolnelektury/templates/base/base.html delete mode 100644 src/wolnelektury/templates/base/superbase.html delete mode 100644 src/wolnelektury/templates/main_menu.html delete mode 100644 src/wolnelektury/templates/main_page.html delete mode 100644 src/wolnelektury/templates/podcast.html delete mode 100644 src/wolnelektury/templates/post_test.html diff --git a/src/ajaxable/templates/ajaxable/form.html b/src/ajaxable/templates/ajaxable/form.html index 8cc30043d..d92b3404e 100644 --- a/src/ajaxable/templates/ajaxable/form.html +++ b/src/ajaxable/templates/ajaxable/form.html @@ -9,21 +9,11 @@ {% load honeypot %} {% render_honeypot_field %} {% endif %} - {% if request.EXPERIMENTS.layout.value %} - {{ form.as_p }} -

- {{ form.data_processing }} -

- - {% else %} -
    -
    - {% block form_fields %} - {{ form.as_p }} - {% endblock %} -
  1. -
- {% endif %} + {{ form.as_p }} +

+ {{ form.data_processing }} +

+
diff --git a/src/ajaxable/templates/ajaxable/form_on_page.html b/src/ajaxable/templates/ajaxable/form_on_page.html index 08f713df5..de00a47f9 100644 --- a/src/ajaxable/templates/ajaxable/form_on_page.html +++ b/src/ajaxable/templates/ajaxable/form_on_page.html @@ -1,4 +1,4 @@ -{% extends request.EXPERIMENTS.layout.value|yesno:"2022/base_simple.html,base/base.html" %} +{% extends "2022/base_simple.html" %} {% load i18n %} {% block titleextra %}{{ title }}{% endblock %} diff --git a/src/ajaxable/templatetags/__init__.py b/src/ajaxable/templatetags/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/ajaxable/templatetags/ajaxable_tags.py b/src/ajaxable/templatetags/ajaxable_tags.py deleted file mode 100644 index a9a308d51..000000000 --- a/src/ajaxable/templatetags/ajaxable_tags.py +++ /dev/null @@ -1,47 +0,0 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. -# -from django import template -from django.utils.encoding import force_str -from django.utils.safestring import mark_safe -from ajaxable.utils import placeholdized - - -register = template.Library() - - -@register.filter -def placeholdize(form): - return placeholdized(form) - - -@register.filter -def placeholdized_ul(form): - return placeholdized(form).as_ul() - - -@register.filter -def pretty_field(field, template=None): - if template is None: - template = ''' -
  • - %(errors)s - - %(helptext)s -
  • ''' - return mark_safe(template % { - 'errors': field.errors, - 'input': field, - 'label': ('*' if field.field.required else '') + force_str(field.label), - 'helptext': force_str(field.help_text), - }) - - -@register.filter -def pretty_checkbox(field): - return pretty_field(field, template=''' -
  • - %(errors)s - - %(helptext)s -
  • ''') diff --git a/src/api/templates/api/main.html b/src/api/templates/api/main.html index 7af79da84..06688d0dc 100644 --- a/src/api/templates/api/main.html +++ b/src/api/templates/api/main.html @@ -1,4 +1,4 @@ -{% extends request.EXPERIMENTS.layout.value|yesno:"2022/base_simple.html,base/base.html" %} +{% extends "2022/base_simple.html" %} {% load i18n %} {% load build_absolute_uri from fnp_common %} diff --git a/src/api/templates/oauth/authorize_token.html b/src/api/templates/oauth/authorize_token.html index 49dd098ea..70c5e497d 100644 --- a/src/api/templates/oauth/authorize_token.html +++ b/src/api/templates/oauth/authorize_token.html @@ -1,4 +1,4 @@ -{% extends request.EXPERIMENTS.layout.value|yesno:"2022/base_simple.html,base/base.html" %} +{% extends "2022/base_simple.html" %} {% load i18n %} {% block settings %} diff --git a/src/catalogue/models/collection.py b/src/catalogue/models/collection.py index 8510b2cb1..2c9a348e5 100644 --- a/src/catalogue/models/collection.py +++ b/src/catalogue/models/collection.py @@ -62,11 +62,5 @@ class Collection(models.Model): def example3(self): return self.get_books()[:3] - @cached_render('catalogue/collection_box.html') - def box(self): - return { - 'collection': self - } - def clear_cache(self): clear_cached_renders(self.box) diff --git a/src/catalogue/models/fragment.py b/src/catalogue/models/fragment.py index 9ee48c92d..fe9355a8a 100644 --- a/src/catalogue/models/fragment.py +++ b/src/catalogue/models/fragment.py @@ -39,10 +39,6 @@ class Fragment(models.Model): """Returns short version of the fragment.""" return self.short_text if self.short_text else self.text - @cached_render('catalogue/fragment_short.html') - def midi_box(self): - return {'fragment': self} - @cached_render('catalogue/fragment_promo.html') def promo_box(self): return {'fragment': self} @@ -52,5 +48,4 @@ class Fragment(models.Model): return self.tags.filter(category='theme') def clear_cache(self): - clear_cached_renders(self.midi_box) clear_cached_renders(self.promo_box) diff --git a/src/catalogue/templates/catalogue/book_detail.html b/src/catalogue/templates/catalogue/book_detail.html deleted file mode 100644 index d2bfda7e4..000000000 --- a/src/catalogue/templates/catalogue/book_detail.html +++ /dev/null @@ -1,91 +0,0 @@ -{% extends "base/base.html" %} -{% load i18n %} -{% load catalogue_tags %} -{% load build_absolute_uri from fnp_common %} -{% load annoy_banner from annoy %} -{% load cache %} - -{% block titleextra %}{{ book.pretty_title }}{% endblock %} -{% block ogimage %}{% if book.cover %}{{ book.cover.url|build_absolute_uri:request }}{% endif %}{% endblock %} - -{% block metadescription %}{% book_title book %}. {{ block.super }}{% endblock %} - -{% block bodyid %}book-detail{% endblock %} - - -{% block body %} - {% include 'catalogue/book_wide.html' %} - - {% work_list book_children %} - - {% spaceless %} - {% if book.other_versions %} -
    -

    {% trans "Other versions" %}:

    - {% for rel in book.other_versions %} - {{ rel.mini_box }} - {% endfor %} -
    - {% endif %} - - {% annoy_banner 'book-page' %} - -
    -

    {% trans "See also" %}:

    - {% related_books book taken=book.other_versions|length %} -
    - {% endspaceless %} - - {% with book.related_themes as themes %} - {% if themes %} -

    {% trans "Themes" %}

    - {% plain_list themes book=book %} - {% endif %} - {% endwith %} - - -

    {% trans "Information about the work" %}

    - {% for author in book.authors %} - - {% endfor %} - - - {% with extra_info=book.get_extra_info_json %} - {% for source_url in extra_info.source_urls %} -
    - {% trans "Source" %} {% trans "of the book" %} - {% trans "in" %} {% source_name source_url %} -
    - {% empty %} - {% if extra_info.source_url %} -
    - {% trans "Source" %} {% trans "of the book" %} - {% trans "in" %} {% source_name extra_info.source_url %} -
    - {% endif %} - {% endfor %} - {% if book|status:user != 'closed' %} - - {% endif %} - {% if extra_info.about and not hide_about %} -
    - {% trans "Book on" %} {% trans "Editor's Platform" %} -
    - {% endif %} - {% if book.wiki_link %} - - {% endif %} - -{% endwith %} - -{% endblock %} diff --git a/src/catalogue/templates/catalogue/book_fragments.html b/src/catalogue/templates/catalogue/book_fragments.html deleted file mode 100644 index 4bcb30e01..000000000 --- a/src/catalogue/templates/catalogue/book_fragments.html +++ /dev/null @@ -1,24 +0,0 @@ -{% extends "base/base.html" %} -{% load i18n %} -{% load work_list from catalogue_tags %} -{% load annoy_banner from annoy %} - -{% block titleextra %}{% trans "Theme" %} {{ theme }} {% trans "in work " %} {{ book }}{% endblock %} - -{% block bodyid %}tagged-object-list{% endblock %} - -{% block body %} -
    -

    {% trans "Theme" %} - {{ theme }} -
    {% trans "in work " %} - {{ book }}

    - - {% annoy_banner 'book-fragment-list' %} - -
    - -
    - {% work_list fragments %} -
    -{% endblock %} diff --git a/src/catalogue/templates/catalogue/book_list.html b/src/catalogue/templates/catalogue/book_list.html deleted file mode 100644 index 0107f5fd6..000000000 --- a/src/catalogue/templates/catalogue/book_list.html +++ /dev/null @@ -1,37 +0,0 @@ -{% extends request.EXPERIMENTS.layout.value|yesno:"2022/base_simple.html,base/base.html" %} -{% load i18n %} -{% load catalogue_tags %} -{% load chunk from chunks %} - -{% block bodyid %}book-a-list{% endblock %} - -{% block titleextra %}{% trans "Listing of all works" %}{% endblock %} - -{% block body %} - {% spaceless %} -

    {% block book_list_header %}{% trans "Listing of all works" %}{% endblock %}

    - -
    - {% block book_list_info %} - {% chunk 'book-list' %} - {% endblock %} -
    - -
    - - - -
    -

    {% trans "Table of Content" %}

    -
    - {{ rendered_nav }} -
    -
    -
    - {% block book_list %} - {{ rendered_book_list }} - {% endblock %} -
    - {% trans "↑ top ↑" %} - {% endspaceless %} -{% endblock %} diff --git a/src/catalogue/templates/catalogue/book_searched.html b/src/catalogue/templates/catalogue/book_searched.html deleted file mode 100644 index e257467e3..000000000 --- a/src/catalogue/templates/catalogue/book_searched.html +++ /dev/null @@ -1,30 +0,0 @@ -{% extends "catalogue/book_short.html" %} -{% load inline_tag_list from catalogue_tags %} - -{% block right-column %} -
    -
    - {% for hit in hits %} - {% if hit.snippet %} - - {% elif hit.fragment %} - - {% endif %} - {% endfor %} -
    - {% include 'catalogue/snippets/jplayer.html' %} -
    -{% endblock %} diff --git a/src/catalogue/templates/catalogue/book_short.html b/src/catalogue/templates/catalogue/book_short.html index 9c2e6a03b..133ed0cd6 100644 --- a/src/catalogue/templates/catalogue/book_short.html +++ b/src/catalogue/templates/catalogue/book_short.html @@ -11,10 +11,6 @@
    - {% block book-box-pre %} - {% include "catalogue/snippets/like_button.html" %} - {% endblock %} - {% with book.tags_by_category as tags %}
    @@ -162,13 +158,6 @@
    {% endwith %} - {% block right-column %} - {% if audiobooks %}{% if book|status:request.user != 'closed' %} -
    - {% include 'catalogue/snippets/jplayer.html' %} -
    - {% endif %}{% endif %} - {% endblock %} {% if book.abstract %}
    {{ book.abstract|safe }} diff --git a/src/catalogue/templates/catalogue/book_wide.html b/src/catalogue/templates/catalogue/book_wide.html deleted file mode 100644 index 9413ee70f..000000000 --- a/src/catalogue/templates/catalogue/book_wide.html +++ /dev/null @@ -1,69 +0,0 @@ -{% extends "catalogue/book_short.html" %} -{% load i18n %} -{% load choose_fragment license_icon from catalogue_tags %} -{% load choose_cite from social_tags %} -{% load status from catalogue_tags %} -{% load chunks %} - - -{% block box-class %}book-wide-box{% endblock %} - - -{% block cover-link %}{% if book.get_first_text %}{% url 'book_text' book.get_first_text.slug %}{% endif %}{% endblock %} - - -{% block cover-area-extra %} - {% with license=book.get_extra_info_json.license %} - {% if license %} - {% license_icon license %} - {% endif %} - {% endwith %} -{% endblock %} - - -{% block preview-info %} -

    - {% chunk "book-preview-warn" %} -

    -{% endblock %} - - - -{% block right-column %} -
    -
    - {% choose_cite book as cite_promo %} - {% if cite_promo %} - {{ cite.promo_box }} - {% else %} - {% choose_fragment book as fragment_promo %} - {% if fragment_promo %} - {{ fragment_promo.promo_box }} - {% endif %} - {% endif %} -
    - {% include 'catalogue/snippets/jplayer.html' %} - - {% if book|status:request.user == 'closed' %} - {% with form=club_form %} -
    - {% csrf_token %} - {% include "club/payment_form.html" %} - {% chunk 'club_form_bottom' %} -
    - {% endwith %} - - {% include "club/payment_info.html" %} - {% endif %} - - -
    -{% endblock %} - - -{% block book-box-body-pre %} - {% include "catalogue/snippets/like_button.html" %} -{% endblock %} - -{% block book-box-pre %} -{% endblock %} diff --git a/src/catalogue/templates/catalogue/catalogue.html b/src/catalogue/templates/catalogue/catalogue.html index 4494eff10..b0102d8f8 100644 --- a/src/catalogue/templates/catalogue/catalogue.html +++ b/src/catalogue/templates/catalogue/catalogue.html @@ -1,4 +1,4 @@ -{% extends request.EXPERIMENTS.layout|yesno:"2022/base.html,base/base.html" %} +{% extends "2022/base.html" %} {% load i18n %} {% load catalogue_tags reporting_stats %} diff --git a/src/catalogue/templates/catalogue/collection.html b/src/catalogue/templates/catalogue/collection.html deleted file mode 100644 index 7a08ab6c7..000000000 --- a/src/catalogue/templates/catalogue/collection.html +++ /dev/null @@ -1,15 +0,0 @@ -{% extends "base/base.html" %} -{% load i18n %} -{% load catalogue_tags %} - -{% block titleextra %}{{ collection.title }}{% endblock %} - -{% block bodyid %}collection{% endblock %} - -{% block body %} -

    {{ collection.title }}

    - - {{ collection.description|safe }} - - {% plain_list collection.get_books by_author=True %} -{% endblock %} diff --git a/src/catalogue/templates/catalogue/collection_box.html b/src/catalogue/templates/catalogue/collection_box.html deleted file mode 100644 index ec79ca617..000000000 --- a/src/catalogue/templates/catalogue/collection_box.html +++ /dev/null @@ -1,19 +0,0 @@ -{% spaceless %} - {% load i18n %} - {% load thumbnail %} -
    -

    {{ collection }}

    -
    - {% if collection.description %} - {{ collection.description|safe|truncatewords_html:40 }} - {% endif %} -
    -
    - {% for book in collection.get_books|slice:":6" %} - - {{ book.pretty_title }} - - {% endfor %} -
    -
    -{% endspaceless %} diff --git a/src/catalogue/templates/catalogue/collections.html b/src/catalogue/templates/catalogue/collections.html deleted file mode 100644 index 1d7b0f71e..000000000 --- a/src/catalogue/templates/catalogue/collections.html +++ /dev/null @@ -1,18 +0,0 @@ -{% extends "base/base.html" %} -{% load i18n %} -{% load catalogue_tags %} - -{% block titleextra %}{% trans "Collections" %}{% endblock %} - -{% block bodyid %}collections{% endblock %} - -{% block body %} -

    {% trans "Collections" %}

    - - {% for obj in best %} - {{ obj.box }} - {% endfor %} - -

    {% trans "All collections" %}

    - {% plain_list objects %} -{% endblock %} diff --git a/src/catalogue/templates/catalogue/custom_pdf_form.html b/src/catalogue/templates/catalogue/custom_pdf_form.html index cfebdf39c..46b2e85f7 100644 --- a/src/catalogue/templates/catalogue/custom_pdf_form.html +++ b/src/catalogue/templates/catalogue/custom_pdf_form.html @@ -1,25 +1,11 @@ {% load i18n %} {% load honeypot %} -{% load ajaxable_tags %}

    {% trans "Download custom PDF" %}

    {% csrf_token %} {% render_honeypot_field %} - {% if request.EXPERIMENTS.layout.value %} - {{ form.as_p }} - - {% else %} -
      - {{ form.nofootnotes|pretty_checkbox }} - {{ form.nothemes|pretty_checkbox }} - {{ form.nowlfont|pretty_checkbox }} - {{ form.nocover|pretty_checkbox }} - {{ form.leading|pretty_field }} - {{ form.fontsize|pretty_field }} - -
    1. -
    - {% endif %} + {{ form.as_p }} +
    diff --git a/src/catalogue/templates/catalogue/daisy_list.html b/src/catalogue/templates/catalogue/daisy_list.html deleted file mode 100644 index 0ef6878bc..000000000 --- a/src/catalogue/templates/catalogue/daisy_list.html +++ /dev/null @@ -1,19 +0,0 @@ -{% extends "catalogue/book_list.html" %} -{% load i18n %} -{% load chunk from chunks %} - -{% block bodyid %}book-a-list{% endblock %} - -{% block titleextra %}{% trans "Listing of all DAISY files" %}{% endblock %} - -{% block extrahead %} - -{% endblock %} - -{% block book_list_header %}{% trans "Listing of all DAISY files" %}{% endblock %} - -{% block book_list_info %} - {% chunk 'daisy-list' %} -{% endblock %} diff --git a/src/catalogue/templates/catalogue/differentiate_tags.html b/src/catalogue/templates/catalogue/differentiate_tags.html index 05709dd8a..494674bea 100644 --- a/src/catalogue/templates/catalogue/differentiate_tags.html +++ b/src/catalogue/templates/catalogue/differentiate_tags.html @@ -1,4 +1,4 @@ -{% extends request.EXPERIMENTS.layout.value|yesno:"2022/base_simple.html,base/base.html" %} +{% extends "2022/base_simple.html" %} {% load i18n %} {% load catalogue_tags %} diff --git a/src/catalogue/templates/catalogue/fragment_short.html b/src/catalogue/templates/catalogue/fragment_short.html deleted file mode 100644 index 935a1a545..000000000 --- a/src/catalogue/templates/catalogue/fragment_short.html +++ /dev/null @@ -1,26 +0,0 @@ -{% load i18n %} -{% load book_title_html from catalogue_tags %} - -
    - {% if fragment.short_text %} - - {% endif %} -
    -
    - - {{ fragment.text|safe }} - -
    - {% if fragment.short_text %} - ↑ {% trans "Hide fragment" %} ↑ - {% endif %} -
    -

    {% book_title_html fragment.book %}

    -
    diff --git a/src/catalogue/templates/catalogue/picture_detail.html b/src/catalogue/templates/catalogue/picture_detail.html deleted file mode 100644 index 9cb0b1973..000000000 --- a/src/catalogue/templates/catalogue/picture_detail.html +++ /dev/null @@ -1,90 +0,0 @@ -{% extends "base/base.html" %} -{% load i18n %} -{% load catalogue_tags pagination_tags %} -{% load thumbnail %} - - -{% block titleextra %}{{ picture.title }}{% endblock %} - -{% block bodyid %}picture-detail{% endblock %} - -{% block body %} -

    {{picture.title}}

    - -
    - - - {% thumbnail picture.image_file "400x500" upscale="false" as im %} - - {% endthumbnail %} - - {% if picture.info.license %} -

    {% trans "Work is licensed under " %} {{ picture.info.license_description }}.

    - {% endif %} -

    {% trans "Based on" %}: {{ picture.info.source_name }}

    - {% if picture.info.description %} -
    -
    {{ picture.info.description|safe }}
    - {#
    {{ picture.info.description|safe|truncatewords_html:30 }}
    #} -
    -

    - {% endif %} -
    - -
    -
    -

    {% trans "Details" %}

    -
      -
    • - {% trans "Author" %}: - {% for tag in categories.author %} - {{ tag }}{% if not forloop.last %}, {% endif %} - {% endfor %} -
    • -
    • - {% trans "Epoch" %}: - {% for tag in categories.epoch %} - {{ tag }}{% if not forloop.last %}, {% endif %} - {% endfor %} -
    • -
    • - {% trans "Kind" %}: - {% for tag in categories.kind %} - {{ tag }}{% if not forloop.last %}, {% endif %} - {% endfor %} -
    • -
    -

    {% trans "Other resources" %}

    - -

    {% trans "View XML source" %}

    -
    -
    -

    {% trans "Work's themes " %}

    - -
    -
    -
    -{% endblock %} - - -{% block extrabody %} - {% javascript "picture" %} -{% endblock %} diff --git a/src/catalogue/templates/catalogue/picture_list.html b/src/catalogue/templates/catalogue/picture_list.html deleted file mode 100644 index 60f2eb0d9..000000000 --- a/src/catalogue/templates/catalogue/picture_list.html +++ /dev/null @@ -1,29 +0,0 @@ -{% extends "catalogue/book_list.html" %} -{% load i18n %} -{% load catalogue_tags chunks %} -{% load thumbnail %} - -{% block bodyid %}picture-list{% endblock %} - -{% block titleextra %}{% trans "Listing of all works" %}{% endblock %} - -{% block picture_list_header %}{% trans "Listing of all works" %}{% endblock %} - - -{% block book_list %} - {% for author, group in pictures_by_author.items %} - -
    -

    {{ author }}

    - {% for picture in group %} -
    - {% thumbnail picture.image_file "300x300" as im %} - - {% endthumbnail %} - {{picture.title}} -
    -
    - {% endfor %} -
    - {% endfor %} -{% endblock %} diff --git a/src/catalogue/templates/catalogue/player.html b/src/catalogue/templates/catalogue/player.html deleted file mode 100644 index 7c3e0b9cd..000000000 --- a/src/catalogue/templates/catalogue/player.html +++ /dev/null @@ -1,74 +0,0 @@ - - - {% load static from static %} - {% load i18n pipeline %} - {% load catalogue_tags %} - {% load thumbnail %} - {% load piwik_tags %} - - - - {% trans "Wolne Lektury" %} :: - {{ book.title }} - {{ audiobook }} - - {% stylesheet 'main' %} - {% stylesheet "player" %} - {% tracking_code %} - - - {% if book.cover_thumb %} - Cover - {% endif %} - - -

    {% book_title book %}

    - -
    -

    {% trans "Book's page" %}.

    -

    {% trans "Download as" %} {% download_audio book False %}.

    - - {% if book.has_daisy_file %} -

    DAISY:

    - - {% endif %} -
    - -
    - {% include "catalogue/snippets/jplayer.html" %} - - {% if projects|length > 1 %} -

    {% trans "Audiobooks were prepared as a part of the projects:" %}

    -
      - {% for cs, fb in projects %} -
    • - {% if fb %} - {% blocktrans %}{{ cs }}, funded by {{ fb }}{% endblocktrans %} - {% else %} - {{ cs }} - {% endif %} -
    • - {% endfor %} -
    - {% else %} -

    - {% with cs=projects.0.0 fb=projects.0.1 %} - {% if fb %} - {% blocktrans %}Audiobooks were prepared as a part of the {{ cs }} project funded by {{ fb }}.{% endblocktrans %} - {% else %} - {% blocktrans %}Audiobooks were prepared as a part of the {{ cs }} project.{% endblocktrans %} - {% endif %} - {% endwith %} -

    - {% endif %} - - - {% javascript "player" %} - - - diff --git a/src/catalogue/templates/catalogue/snippets/jplayer.html b/src/catalogue/templates/catalogue/snippets/jplayer.html deleted file mode 100644 index 647f42dfc..000000000 --- a/src/catalogue/templates/catalogue/snippets/jplayer.html +++ /dev/null @@ -1,70 +0,0 @@ -{% load i18n catalogue_tags %} -{% if audiobooks %}{% if book|status:request.user != 'closed' %} - -{% endif %}{% endif %} diff --git a/src/catalogue/templates/catalogue/snippets/like_button.html b/src/catalogue/templates/catalogue/snippets/like_button.html deleted file mode 100644 index 298f34ea7..000000000 --- a/src/catalogue/templates/catalogue/snippets/like_button.html +++ /dev/null @@ -1,16 +0,0 @@ -{% load likes_book from social_tags %} -{% likes_book book as likes %} - diff --git a/src/catalogue/templates/catalogue/tag_catalogue.html b/src/catalogue/templates/catalogue/tag_catalogue.html deleted file mode 100644 index 4c6a99f43..000000000 --- a/src/catalogue/templates/catalogue/tag_catalogue.html +++ /dev/null @@ -1,24 +0,0 @@ -{% extends "base/base.html" %} -{% load i18n %} -{% load cache %} -{% load plain_list from catalogue_tags %} - -{% block titleextra %}{{ title }}{% endblock %} - -{% block bodyid %}tag-catalogue{% endblock %} - -{% block body %} -

    {{ title|title }} {% trans "on Wolne Lektury" %}

    - - {% for tag in best %} - - {% cache 86400 catalogue_tag_box tag.pk %} - {% include 'catalogue/tag_box.html' %} - {% endcache %} - - {% endfor %} - -

    {{ whole_category }}

    - - {% plain_list tags %} -{% endblock %} diff --git a/src/catalogue/templates/catalogue/tagged_object_list.html b/src/catalogue/templates/catalogue/tagged_object_list.html deleted file mode 100644 index 22554d66a..000000000 --- a/src/catalogue/templates/catalogue/tagged_object_list.html +++ /dev/null @@ -1,102 +0,0 @@ -{% extends "base/base.html" %} -{% load i18n %} -{% load catalogue_tags social_tags %} - -{% block titleextra %}{% if tags %}{% title_from_tags tags %}{% elif list_type == 'gallery' %}{% trans "Art" %}{% elif list_type == 'audiobooks' %}{% trans "Audiobooks" %}{% else %}{% trans "Literature" %}{% endif %}{% endblock %} - - -{% block bodyid %}tagged-object-list{% endblock %} - -{% block body %} -
    -

    {% if tags %}{% html_title_from_tags tags %}{% endif %}

    - - -
    - -
    -
    - {% inline_tag_list categories.author tags 'author' list_type=list_type %} -
    -
    - {% inline_tag_list categories.epoch tags 'epoch' list_type=list_type %} -
    -
    - {% inline_tag_list categories.genre tags 'genre' list_type=list_type %} -
    -
    - {% inline_tag_list categories.kind tags 'kind' list_type=list_type %} -
    - {% if theme_is_set %} -
    - {% inline_tag_list categories.theme tags 'theme' list_type=list_type %} -
    - {% endif %} -
    - - {% if theme_is_set %} - {% work_list object_list %} - {% else %} -
    - {% if object_list %} - {% work_list best %} - {% if tags %} -

    {% trans "All matching works" %}

    - {% else %} - {% if list_type == 'audiobooks' %} -

    {% trans "Listing of all audiobooks" %}

    - {% else %} -

    {% trans "All works" %}

    - {% endif %} - {% endif %} - {% plain_list object_list by_author=True list_type=list_type %} - {% if daisy %} -

    {% trans "DAISY files" %}

    - {% plain_list daisy by_author=True %} - {% endif %} - {% else %} - {% trans "Sorry! Search cirteria did not match any resources." %} - {% include "info/join_us.html" %} - {% endif %} -
    - - {% if categories.theme and list_type != 'audiobooks' %} -

    {% trans "Motifs and themes" %}

    - {% plain_list categories.theme choice=tags list_type=list_type %} - {% endif %} - {% endif %} - - {% for tag in tags %} - {% if tag.category != 'set' %} -

    {% trans tag.category as c %}{{ c|capfirst }}: {{ tag }}

    -
    - {% if tag.has_description %} - {{ tag.description|safe }} - {% else %} - {% trans "No description." %} - {% endif %} -
    - - {% if tag.wiki_link %} - - {% endif %} - {% if tag.culturepl_link %} - - {% endif %} - {% endif %} - {% endfor %} -{% endblock %} diff --git a/src/catalogue/templates/catalogue/work-list.html b/src/catalogue/templates/catalogue/work-list.html deleted file mode 100644 index 58e28c7ef..000000000 --- a/src/catalogue/templates/catalogue/work-list.html +++ /dev/null @@ -1,24 +0,0 @@ -{% spaceless %} - - {% load cache %} - {% load pagination_tags %} - {% load class_name from catalogue_tags %} - {% load status from catalogue_tags %} - - {% autopaginate object_list 10 %} - -
      - {% for item in object_list %} -
    1. - {% if item|class_name == 'Book' %} - {% include "catalogue/book_short.html" with book=item %} - {% else %} - {{ item.midi_box }} - {% endif %} -
    2. - {% endfor %} -
    - - {% paginate %} - -{% endspaceless %} diff --git a/src/catalogue/templatetags/catalogue_tags.py b/src/catalogue/templatetags/catalogue_tags.py index 67ba553af..dd0d4026f 100644 --- a/src/catalogue/templatetags/catalogue_tags.py +++ b/src/catalogue/templatetags/catalogue_tags.py @@ -340,12 +340,6 @@ def book_info(book): } -@register.inclusion_tag('catalogue/work-list.html', takes_context=True) -def work_list(context, object_list): - request = context.get('request') - return {'object_list': object_list, 'request': request} - - @register.inclusion_tag('catalogue/plain_list.html', takes_context=True) def plain_list(context, object_list, with_initials=True, by_author=False, choice=None, book=None, list_type='books', paged=True, initial_blocks=False): @@ -481,11 +475,6 @@ def license_locative(license_url, default): return LICENSES.get(license_url, {}).get('locative', default) -@register.filter -def class_name(obj): - return obj.__class__.__name__ - - @register.simple_tag def source_name(url): url = url.lstrip() diff --git a/src/catalogue/urls.py b/src/catalogue/urls.py index 7049b1c85..0a8df784d 100644 --- a/src/catalogue/urls.py +++ b/src/catalogue/urls.py @@ -30,12 +30,12 @@ urlpatterns = [ path('rodzaj/', views.tag_catalogue, {'category': 'kind'}, name='kind_catalogue'), path('motyw/', views.tag_catalogue, {'category': 'theme'}, name='theme_catalogue'), - path('galeria/', views.gallery, name='gallery'), + path('galeria/', views.GalleryView.as_view(), name='gallery'), path('kolekcje/', views.collections, name='catalogue_collections'), - path('lektury/', views.literature, name='book_list'), + path('lektury/', views.LiteratureView.as_view(), name='book_list'), path('lektury//', views.collection, name='collection'), - path('audiobooki/', views.audiobooks, name='audiobook_list'), + path('audiobooki/', views.AudiobooksView.as_view(), name='audiobook_list'), path('daisy/', views.daisy_list, name='daisy_list'), path('jtags/', search.views.hint, {'param': 'q', 'mozhint': True}, name='jhint'), path('nowe/', ListView.as_view( @@ -63,7 +63,6 @@ urlpatterns = [ # Public interface. Do not change this URLs. path('lektura/.html', views.book_text, name='book_text'), - path('lektura//audiobook/', views.player, name='book_player'), path('lektura//', views.book_detail, name='book_detail'), path('lektura//motyw//', views.book_fragments, name='book_fragments'), diff --git a/src/catalogue/views.py b/src/catalogue/views.py index d93ae3553..817b3ada5 100644 --- a/src/catalogue/views.py +++ b/src/catalogue/views.py @@ -19,7 +19,7 @@ from django.views.decorators.cache import never_cache from django.views.generic import TemplateView from ajaxable.utils import AjaxableFormView -from club.forms import ScheduleForm, DonationStep1Form +from club.forms import DonationStep1Form from club.models import Club from annoy.models import DynamicTextInsert from pdcounter import views as pdcounter_views @@ -45,37 +45,13 @@ def catalogue(request): }) -def book_list(request, filters=None, template_name='catalogue/book_list.html', - nav_template_name='catalogue/snippets/book_list_nav.html', - list_template_name='catalogue/snippets/book_list.html'): - """ generates a listing of all books, optionally filtered """ - books_by_author, orphans, books_by_parent = Book.book_list(filters) - books_nav = OrderedDict() - for tag in books_by_author: - if books_by_author[tag]: - books_nav.setdefault(tag.sort_key[0], []).append(tag) - return render(request, template_name, { - 'rendered_nav': render_to_string(nav_template_name, {'books_nav': books_nav}), - 'rendered_book_list': render_to_string(list_template_name, { - 'books_by_author': books_by_author, - 'orphans': orphans, - 'books_by_parent': books_by_parent, - }) - }) - - def daisy_list(request): - if request.EXPERIMENTS['layout'].value: - return object_list(request, Book.objects.filter(media__type='daisy')) - return book_list(request, Q(media__type='daisy'), template_name='catalogue/daisy_list.html') + return object_list(request, Book.objects.filter(media__type='daisy')) def collection(request, slug): coll = get_object_or_404(Collection, slug=slug) - if request.EXPERIMENTS['layout'].value: - template_name = 'catalogue/2022/collection.html' - else: - template_name = 'catalogue/collection.html' + template_name = 'catalogue/2022/collection.html' return render(request, template_name, { 'collection': coll, 'active_menu_item': 'collections', @@ -403,43 +379,18 @@ def object_list(request, objects, fragments=None, related_tags=None, tags=None, if extra: result.update(extra) - if request.EXPERIMENTS['layout'].value: - has_theme = any(((theme := x).category == 'theme' for x in tags)) - if has_theme: - result['main_tag'] = theme - template = 'catalogue/2022/theme_detail.html' - else: - template = 'catalogue/2022/author_detail.html' + has_theme = any(((theme := x).category == 'theme' for x in tags)) + if has_theme: + result['main_tag'] = theme + template = 'catalogue/2022/theme_detail.html' else: - template = 'catalogue/tagged_object_list.html' + template = 'catalogue/2022/author_detail.html' return render( request, template, result, ) -def literature(request): - if request.EXPERIMENTS['layout'].value: - return LiteratureView.as_view()(request) - books = Book.objects.filter(parent=None, findable=True) - return object_list(request, books, related_tags=get_top_level_related_tags([])) - - -def gallery(request): - if request.EXPERIMENTS['layout'].value: - return GalleryView.as_view()(request) - return object_list(request, Picture.objects.all(), list_type='gallery') - - -def audiobooks(request): - if request.EXPERIMENTS['layout'].value: - return AudiobooksView.as_view()(request) - audiobooks = Book.objects.filter(findable=True, media__type__in=('mp3', 'ogg')).distinct() - return object_list(request, audiobooks, list_type='audiobooks', extra={ - 'daisy': Book.objects.filter(findable=True, media__type='daisy').distinct(), - }) - - class ResponseInstead(Exception): def __init__(self, response): super(ResponseInstead, self).__init__() @@ -500,7 +451,7 @@ def theme_list(request, tags, list_type): def tagged_object_list(request, tags, list_type): - if request.EXPERIMENTS['layout'].value and list_type in ('books', 'audiobooks'): + if list_type in ('books', 'audiobooks'): return TaggedObjectList.as_view()(request, tags=tags) try: @@ -550,11 +501,7 @@ def book_fragments(request, slug, theme_slug): fragments = Fragment.tagged.with_all([theme]).filter( Q(book=book) | Q(book__ancestor=book)) - if request.EXPERIMENTS['layout'].value: - template_name = 'catalogue/2022/book_fragments.html' - else: - template_name = 'catalogue/book_fragments.html' - + template_name = 'catalogue/2022/book_fragments.html' return render( request, template_name, @@ -573,41 +520,19 @@ def book_detail(request, slug): except Book.DoesNotExist: return pdcounter_views.book_stub_detail(request, slug) - new_layout = request.EXPERIMENTS['layout'] - return render( request, - 'catalogue/2022/book_detail.html' if new_layout.value else 'catalogue/book_detail.html', + 'catalogue/2022/book_detail.html', { 'book': book, 'accessible': book.is_accessible_to(request.user), 'book_children': book.children.all().order_by('parent_number', 'sort_key'), 'active_menu_item': 'books', - 'club_form': ScheduleForm() if book.preview else None, 'club': Club.objects.first() if book.preview else None, 'donation_form': DonationStep1Form(), }) -# używane w publicznym interfejsie -def player(request, slug): - book = get_object_or_404(Book, slug=slug) - if not book.has_media('mp3'): - raise Http404 - - audiobooks, projects, total_duration = book.get_audiobooks() - - return render( - request, - 'catalogue/player.html', - { - 'book': book, - 'audiobook': '', - 'audiobooks': audiobooks, - 'projects': projects, - }) - - def book_text(request, slug): book = get_object_or_404(Book, slug=slug) @@ -736,11 +661,7 @@ def tag_catalogue(request, category): else: best = described_tags - if request.EXPERIMENTS['layout'].value: - template_name = 'catalogue/2022/tag_catalogue.html' - else: - template_name = 'catalogue/tag_catalogue.html' - + template_name = 'catalogue/2022/tag_catalogue.html' return render(request, template_name, { 'tags': tags, 'best': best, @@ -758,11 +679,7 @@ def collections(request): else: best = objects - if request.EXPERIMENTS['layout'].value: - template_name = 'catalogue/2022/collections.html' - else: - template_name = 'catalogue/collections.html' - + template_name = 'catalogue/2022/collections.html' return render(request, template_name, { 'objects': objects, 'best': best, diff --git a/src/club/forms.py b/src/club/forms.py index 098a70edf..dd088f730 100644 --- a/src/club/forms.py +++ b/src/club/forms.py @@ -9,109 +9,6 @@ from . import models, payment_methods from .payu.forms import CardTokenForm -class ScheduleForm(forms.ModelForm, NewsletterForm): - data_processing = '''Informacja o przetwarzaniu danych osobowych - -
    Administratorem Twoich danych osobowych jest Fundacja Wolne Lektury z siedzibą w Warszawie, przy ul. Marszałkowskiej 84/92 lok.125, 00-514 Warszawa (dalej: Fundacja). - -Z Fundacją można się kontaktować we wszystkich sprawach dotyczących przetwarzania danych osobowych oraz korzystania z praw związanych z przetwarzaniem danych, w szczególności w zakresie wycofania udzielonej zgody na przetwarzanie danych poprzez adres e-mail fundacja@nowoczesnapolska.org.pl, telefonicznie pod numerem +48 22 621 30 17 (w dni powszednie w godz. 9-17) lub listownie pisząc na adres siedziby Fundacji. -Podanie danych osobowych jest dobrowolne, jednak konieczne do przeprowadzenia płatności oraz realizacji innych celów wskazanych poniżej. - -Twoje dane będą przetwarzane w celu: - • rozliczeniowym, księgowym, i innych sprawach związanych z Twoją darowizną na podstawie art. 6 ust. 1 lit. b i c RODO, - • kontaktu telefonicznego, przez media elektroniczne oraz listownie, celem informowania o działalności oraz prośby o wsparcie na podstawie art. 6 ust. 1 lit. a, - • przesyłania e-mailem newslettera: regularnej informacji o działalności fundacji oraz próśb o wsparcie na podstawie art. 6 ust. 1 lit. a RODO, - • ewentualnego ustalenia i dochodzenia roszczeń lub obrony przed nimi; zapewnienia bezpieczeństwa u Administratora oraz realizacji wewnętrznych celów administracyjnych, analitycznych i statystycznych na podstawie art. 6 ust. 1 lit. f RODO; uzasadnionym interesem Administratora jest możliwość obrony przed ewentualnymi roszczeniami, zapewnienia bezpieczeństwa u Administratora oraz możliwość realizacji wewnętrznych celów administracyjnych, analitycznych i statystycznych przez Fundację. - -Fundacja nie udostępnia Twoich danych osobowych podmiotom trzecim. Fundacja może korzystać z usług podwykonawców w celu realizacji kontaktu w ramach wyrażonej zgody. W szczególności Twoje dane mogą być przekazywane podmiotom takim jak banki, firma obsługująca księgowość i firmy współpracujące przy prowadzeniu akcji informacyjnych i edukacyjnych – przy czym takie podmioty przetwarzają dane wyłącznie na podstawie umowy z administratorem, wyłącznie zgodnie z poleceniami administratora i wyłącznie zgodnie z zakresem udzielonej zgody. - -Twoje dane osobowe będą przechowywane do momentu wycofania zgody, rozliczenia darowizn, a po tym okresie przez okres przedawnienia ewentualnych roszczeń lub przez okres, który wynika z przepisów prawa, w szczególności obowiązku przechowywania dokumentów księgowych (rachunkowych). - -Przysługuje Ci prawo dostępu do Twoich danych oraz prawo żądania ich sprostowania, ich usunięcia lub ograniczenia ich przetwarzania. W zakresie, w jakim podstawą przetwarzania Twoich danych osobowych jest przesłanka prawnie uzasadnionego interesu administratora, przysługuje Ci prawo wniesienia sprzeciwu wobec przetwarzania Twoich danych osobowych. W zakresie, w jakim podstawą przetwarzania Twoich danych osobowych jest zgoda, masz prawo wycofania zgody. Wycofanie zgody nie ma wpływu na zgodność z prawem przetwarzania, którego dokonano na podstawie zgody przed jej wycofaniem. W celu skorzystania z powyższych praw należy skontaktować się z fundacją w dowolny wskazany powyżej sposób. - -Masz prawo do wniesienia skargi do organu nadzorczego, jeżeli uważasz, że Twoje dane osobowe są przetwarzane w niewłaściwy sposób. - -Twoje dane osobowe nie będą profilowane, ani przesyłane do państw trzecich i organizacji międzynarodowych. - -
    -'''.replace('\n', '
    ') - - class Meta: - model = models.Schedule - fields = ['monthly', 'amount', - 'first_name', 'last_name', - 'email', 'phone', - 'postal', - 'postal_code', 'postal_town', 'postal_country', - 'method'] - widgets = { - 'amount': forms.HiddenInput, - 'monthly': forms.HiddenInput, - 'method': forms.HiddenInput, - - 'first_name': forms.TextInput(attrs={"placeholder": _('first name')}), - 'last_name': forms.TextInput(attrs={"placeholder": _('last name')}), - - 'postal': forms.Textarea(attrs={"placeholder": _("street address")}), - 'postal_code': forms.TextInput(attrs={"placeholder": _('postal code')}), - 'postal_town': forms.TextInput(attrs={"placeholder": _('town')}), - } - - def __init__(self, referer=None, **kwargs): - self.referer = referer - super().__init__(**kwargs) - - self.fields['first_name'].required = True - self.fields['last_name'].required = True - self.fields['phone'].required = True - - self.consent = [] - for c in models.Consent.objects.filter(active=True).order_by('order'): - key = f'consent{c.id}' - self.fields[key] = forms.BooleanField( - label=c.text, - required=c.required - ) - self.consent.append(( - c, key, (lambda k: lambda: self[k])(key) - )) - - def clean_amount(self): - value = self.cleaned_data['amount'] - club = models.Club.objects.first() - if club and value < club.min_amount: - raise forms.ValidationError( - _('Minimal amount is %(amount)d PLN.') % { - 'amount': club.min_amount - } - ) - return value - - def clean_method(self): - value = self.cleaned_data['method'] - monthly = self.cleaned_data['monthly'] - for m in payment_methods.methods: - if m.slug == value: - if (monthly and m.is_recurring) or (not monthly and m.is_onetime): - return value - if monthly: - return payment_methods.recurring_payment_method.slug - else: - return payment_methods.single_payment_method.slug - - def save(self, *args, **kwargs): - NewsletterForm.save(self, *args, **kwargs) - self.instance.source = self.referer or '' - instance = super().save(*args, **kwargs) - - consents = [] - for consent, key, consent_field in self.consent: - if self.cleaned_data[key]: - instance.consent.add(consent) - - return instance - - class PayUCardTokenForm(CardTokenForm): def get_queryset(self, view): return view.get_schedule().payucardtoken_set diff --git a/src/club/payment_methods.py b/src/club/payment_methods.py index 4a596e45b..825210cdf 100644 --- a/src/club/payment_methods.py +++ b/src/club/payment_methods.py @@ -19,7 +19,7 @@ class PaymentMethod(object): updateable = False def initiate(self, request, schedule): - return reverse('club_dummy_payment', args=[schedule.key]) + raise NotImplementedError class PayU(PaymentMethod): @@ -27,7 +27,6 @@ class PayU(PaymentMethod): expiration_reliable = True slug = 'payu' name = 'PayU' - template_name = 'club/payment/payu.html' def __init__(self, pos_id): self.pos_id = pos_id @@ -55,7 +54,6 @@ class PayU(PaymentMethod): class PayURe(PaymentMethod): slug = 'payu-re' name = 'PayU recurring' - template_name = 'club/payment/payu-re.html' is_recurring = True expiration_reliable = True cancellable = True @@ -145,7 +143,6 @@ class PayURe(PaymentMethod): class PayPal(PaymentMethod): slug = 'paypal' name = 'PayPal' - template_name = 'club/payment/paypal.html' is_recurring = True is_onetime = False diff --git a/src/club/templates/club/dummy_payment.html b/src/club/templates/club/dummy_payment.html deleted file mode 100644 index d776e75a8..000000000 --- a/src/club/templates/club/dummy_payment.html +++ /dev/null @@ -1,72 +0,0 @@ -{% extends request.session.from_app|yesno:"base/app.html,base/base.html" %} - - -{% block titleextra %}{% trans "Wolne Lektury need your help!" %}{% endblock %} - - -{% block body %} -
    - -

    Testowa płatność

    - -

    {{ schedule.email }}

    -

    {{ schedule.amount }}

    -

    {{ schedule.plan.get_interval_display }}

    - - - - - {% if request.GET.p == 'inline' %} -
    - {% else %} - {% if request.GET.p == 'popup' %} -
    - -
    - - - - {% else %} -
    - {% csrf_token %} - - {{ form.as_p }} - -
    - {% endif %} - {% endif %} - -
    - - - ''' % { - 'attrs': flatatt(final_attrs), - 'js': self.render_js(final_attrs['id'], self.options), - } - - return mark_safe(html) - - -class JQueryAutoCompleteSearchWidget(JQueryAutoCompleteWidget): - def __init__(self, *args, **kwargs): - super(JQueryAutoCompleteSearchWidget, self).__init__(*args, **kwargs) - - def render_js(self, field_id, options): - return "" - - -class JQueryAutoCompleteField(forms.CharField): - def __init__(self, source, options=None, *args, **kwargs): - if options is None: - options = {} - if 'widget' not in kwargs: - options['source'] = source - kwargs['widget'] = JQueryAutoCompleteWidget(options) - - super(JQueryAutoCompleteField, self).__init__(*args, **kwargs) - - -class JQueryAutoCompleteSearchField(forms.CharField): - def __init__(self, options=None, *args, **kwargs): - if options is None: - options = {} - if 'widget' not in kwargs: - kwargs['widget'] = JQueryAutoCompleteSearchWidget(options) - - super(JQueryAutoCompleteSearchField, self).__init__(*args, **kwargs) - class InlineRadioWidget(RadioSelect): diff --git a/src/search/forms.py b/src/search/forms.py index 3f6c99b75..dee9c7774 100644 --- a/src/search/forms.py +++ b/src/search/forms.py @@ -10,24 +10,10 @@ from catalogue.constants import LANGUAGES_3TO2 import catalogue.models import pdcounter.models import picture.models -from .fields import JQueryAutoCompleteSearchField, InlineRadioWidget +from .fields import InlineRadioWidget from .utils import UnaccentSearchQuery, UnaccentSearchVector -class SearchForm(forms.Form): - q = JQueryAutoCompleteSearchField(label=_('Search')) - # {'minChars': 2, 'selectFirst': True, 'cacheLength': 50, 'matchContains': "word"}) - - def __init__(self, source, *args, **kwargs): - kwargs['auto_id'] = False - super(SearchForm, self).__init__(*args, **kwargs) - self.fields['q'].widget.attrs['id'] = 'search' - self.fields['q'].widget.attrs['autocomplete'] = 'off' - self.fields['q'].widget.attrs['data-source'] = source - if 'q' not in self.data: - self.fields['q'].widget.attrs['placeholder'] = _('title, author, epoch, kind, genre, phrase') - - class SearchFilters(forms.Form): q = forms.CharField( required=False, widget=forms.HiddenInput(), diff --git a/src/search/templates/newsearch/search.html b/src/search/templates/newsearch/search.html deleted file mode 100644 index 881e85136..000000000 --- a/src/search/templates/newsearch/search.html +++ /dev/null @@ -1,59 +0,0 @@ -{% extends "base/base.html" %} -{% load i18n %} -{% load catalogue_tags %} - -{% block title %}Search{% endblock %} - -{% block metadescription %}{% endblock %} - -{% block bodyid %}newsearch{% endblock %} - -{% block body %} -

    Search

    -
    -

    - - -
    - fuzzy. -

    -
    - {% if did_you_mean %} - Czy miałeś na mysli {{did_you_mean}}? - {% endif %} - -
    -
      - {% for result in results %} -
    1. -

      - {{result.book.pretty_title}} - (id: {{result.book_id}}, score: {{result.score}}) -

      -
        - {% for snip in hit.snippets %} -
      • - {{snip|safe}}
        -
      • - {% endfor %} - - {% for part in result.parts %} - {% if part.header %} -
      • W {{part.header}} nr {{part.position}}
      • - {% else %} - {% if part.fragment %} -
      • -
        Tagi/Motywy: {% for tag in part.fragment.tags %}{{tag.name}} {% endfor %}
        - {{part.fragment.short_html|safe}} -
      • - {% endif %} - {% endif %} - {% endfor %} -
      -
    2. - {% empty %} -

      No results.

      - {% endfor %} -
    -
    -{% endblock %} diff --git a/src/search/templatetags/__init__.py b/src/search/templatetags/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/search/templatetags/search_tags.py b/src/search/templatetags/search_tags.py deleted file mode 100644 index 8d0b74be8..000000000 --- a/src/search/templatetags/search_tags.py +++ /dev/null @@ -1,36 +0,0 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. -# -import re -from django import template - -register = template.Library() - - -@register.inclusion_tag('catalogue/book_searched.html', takes_context=True) -def book_searched(context, result): - # We don't need hits which lead to sections but do not have - # snippets. - hits = [(idx, h) - for (idx, h) in enumerate(result.hits) - if result.snippets[idx] is not None or ('fragment' in h and h['themes_hit'])] - - for (idx, hit) in hits: - # currently we generate one snipper per hit though. - if len(result.snippets) <= idx: - break - if result.snippets[idx] is None: - continue - snip = result.snippets[idx] - # fix some formattting - snip = re.sub(r"[ \t\n]*\n[ \t\n]*", "\n", snip) - snip = re.sub(r"(^[ \t\n]+|[ \t\n]+$)", "", snip) - - snip = snip.replace("\n", "
    ").replace('---', '—') - hit['snippet'] = snip - - return { - 'request': context['request'], - 'book': result.book, - 'hits': list(zip(*hits))[1] if hits else [] - } diff --git a/src/search/templatetags/set_get_parameter.py b/src/search/templatetags/set_get_parameter.py deleted file mode 100644 index 36e22454e..000000000 --- a/src/search/templatetags/set_get_parameter.py +++ /dev/null @@ -1,49 +0,0 @@ -# This file is part of FNP-Redakcja, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. -# -from re import split - -from django import template - -register = template.Library() - - -""" -In template: - {% set_get_paramater param1='const_value',param2=,param3=variable %} -results with changes to query string: - param1 is set to `const_value' string - param2 is unset, if exists, - param3 is set to the value of variable in context - -Using 'django.core.context_processors.request' is required. - -""" - - -class SetGetParameter(template.Node): - def __init__(self, values): - self.values = values - - def render(self, context): - request = template.Variable('request').resolve(context) - params = request.GET.copy() - for key, value in self.values.items(): - if value == '': - if key in params: - del(params[key]) - else: - params[key] = template.Variable(value).resolve(context) - return '?%s' % params.urlencode() - - -@register.tag -def set_get_parameter(parser, token): - parts = split(r'\s+', token.contents, 2) - - values = {} - for pair in parts[1].split(','): - s = pair.split('=') - values[s[0]] = s[1] - - return SetGetParameter(values) diff --git a/src/search/views.py b/src/search/views.py index f7953c315..d6edd5164 100644 --- a/src/search/views.py +++ b/src/search/views.py @@ -132,6 +132,14 @@ def hint(request, mozhint=False, param='term'): [ item['label'] for item in data + ], + [ + item.get('author', '') + for item in data + ], + [ + item['url'] + for item in data ] ] diff --git a/src/social/templates/social/carousel.html b/src/social/templates/social/carousel.html deleted file mode 100644 index 4a1f88c28..000000000 --- a/src/social/templates/social/carousel.html +++ /dev/null @@ -1,21 +0,0 @@ -{% spaceless %} - - - -{% endspaceless %} diff --git a/src/social/templates/social/cite_info.html b/src/social/templates/social/cite_info.html deleted file mode 100644 index 1f75c18e3..000000000 --- a/src/social/templates/social/cite_info.html +++ /dev/null @@ -1,17 +0,0 @@ -{% spaceless %} - {% if cite.image %} - {% if cite.image_link %}{% endif %} - {% if cite.image_title %} - {{ cite.image_title }}{% else %} - untitled{% endif %}{% if cite.image_link %}{% endif %}{% if cite.image_author %}, - {{ cite.image_author }}{% endif %}{% if cite.image_license %}, - {% if cite.image_license_link %}{% endif %} - {{ cite.image_license }} - {% if cite.image_license_link %}{% endif %} - {% endif %} - {% else %} - books about architecture, - saikofish@Flickr, - CC BY NC SA. - {% endif %} -{% endspaceless %} diff --git a/src/social/templates/social/my_shelf.html b/src/social/templates/social/my_shelf.html deleted file mode 100644 index 140551201..000000000 --- a/src/social/templates/social/my_shelf.html +++ /dev/null @@ -1,17 +0,0 @@ -{% extends "base/base.html" %} -{% load i18n %} -{% load catalogue_tags %} - -{% block titleextra %}{% trans "My shelf" %}{% endblock %} - -{% block logout %}/{% endblock %} - -{% block body %} -

    {% trans "My shelf" %}

    - - {% work_list books %} - - {% if not books %} - {% trans "Add works to your shelf by clicking on the star on the page of the work. The work will then show up on My shelf page." %} - {% endif %} -{% endblock %} diff --git a/src/social/templates/social/sets_form.html b/src/social/templates/social/sets_form.html deleted file mode 100644 index a003f67df..000000000 --- a/src/social/templates/social/sets_form.html +++ /dev/null @@ -1,18 +0,0 @@ -{% load i18n %} -

    {{ title }}

    - -
    - {% csrf_token %} - -
    - -
    - {% csrf_token %} -
      -
      - {{ form.as_ul }} -
    1. -
    -
    diff --git a/src/social/templatetags/social_tags.py b/src/social/templatetags/social_tags.py index 4dda18d01..81a69e031 100644 --- a/src/social/templatetags/social_tags.py +++ b/src/social/templatetags/social_tags.py @@ -51,40 +51,6 @@ def book_shelf_tags(context, book_id): return lazy(get_value, str)() -@register.inclusion_tag('social/carousel.html', takes_context=True) -def carousel(context, placement): - carousel = Carousel.get(placement) - banners = [ - item.get_banner() - for item in carousel.carouselitem_set.all().select_related('banner') - ] - - request = context['request'] - if 'banner' in request.GET: - try: - banner_id = int(request.GET['banner']) - except (TypeError, ValueError): - pass - else: - try: - index = [b.pk for b in banners].index(banner_id) - except ValueError: - if request.user.is_staff: - # Staff is allowed to preview any banner. - try: - banners.insert(0, Cite.objects.get(pk=banner_id)) - except Cite.DoesNotExist: - pass - else: - # Put selected banner to front. - banners = [banners[index]] + banners[:index] + banners[index+1:] - - return { - 'carousel': carousel, - 'banners': banners, - } - - @register.inclusion_tag('social/carousel_2022.html', takes_context=True) def carousel_2022(context, placement): banners = Carousel.get(placement).carouselitem_set.all()#first().get_banner() diff --git a/src/social/urls.py b/src/social/urls.py index dc34fb62a..543bbf3dc 100644 --- a/src/social/urls.py +++ b/src/social/urls.py @@ -12,7 +12,6 @@ urlpatterns = [ path('usun-tag/', views.RemoveSetView.as_view(), name='social_remove_set_tag'), path('moje-tagi/', views.my_tags, name='social_my_tags'), path('lektura//nie_lubie/', views.unlike_book, name='social_unlike_book'), - path('lektura//polki/', never_cache(views.ObjectSetsFormView()), name='social_book_sets'), path('polka/', views.my_shelf, name='social_my_shelf'), path('ulubione/', views.my_liked), ] diff --git a/src/social/views.py b/src/social/views.py index cff7c8e6a..9087d7bba 100644 --- a/src/social/views.py +++ b/src/social/views.py @@ -8,8 +8,6 @@ from django.views.decorators.cache import never_cache from django.views.decorators.http import require_POST from django.views.generic.edit import FormView -from ajaxable.utils import AjaxableFormView - from catalogue.models import Book, Tag import catalogue.models.tag from social import forms @@ -68,11 +66,7 @@ def unlike_book(request, slug): @login_required def my_shelf(request): - if request.EXPERIMENTS['layout'].value: - template_name = 'social/2022/my_shelf.html' - else: - template_name = 'social/my_shelf.html' - + template_name = 'social/2022/my_shelf.html' tags = list(request.user.tag_set.all()) suggest = [t for t in tags if t.name] print(suggest) @@ -131,20 +125,3 @@ def my_tags(request): t.name for t in tags ], safe=False ) - - -class ObjectSetsFormView(AjaxableFormView): - form_class = forms.ObjectSetsForm - placeholdize = True - template = 'social/sets_form.html' - ajax_redirect = True - POST_login = True - - def get_object(self, request, slug): - return get_object_or_404(Book, slug=slug) - - def context_description(self, request, obj): - return obj.pretty_title() - - def form_args(self, request, obj): - return (obj, request.user), {} diff --git a/src/stats/templates/stats/top.html b/src/stats/templates/stats/top.html index ed6867e4a..1b365b162 100644 --- a/src/stats/templates/stats/top.html +++ b/src/stats/templates/stats/top.html @@ -1,4 +1,4 @@ -{% extends request.EXPERIMENTS.layout.value|yesno:"2022/base_simple.html,base/base.html" %} +{% extends "2022/base_simple.html" %} {% block settings %} {% load title %} diff --git a/src/suggest/templates/publishing_suggest.html b/src/suggest/templates/publishing_suggest.html index 43ad4031b..2ccabde2d 100644 --- a/src/suggest/templates/publishing_suggest.html +++ b/src/suggest/templates/publishing_suggest.html @@ -1,17 +1,7 @@ {% extends "ajaxable/form.html" %} {% load i18n %} -{% load ajaxable_tags %} -{% block form_fields %} -{{ form.contact|pretty_field }} -
  • {% trans "I'd like to find in WolneLektury.pl these…" %}
  • - {{ form.books|pretty_field }} - {{ form.ebook|pretty_checkbox }} - {{ form.audiobook|pretty_checkbox }} - {{ form.agree_newsletter|pretty_checkbox }} -
  • {{ form.data_processing }}
  • -{% endblock %} {% block extra %}

    {% trans "Remember that we can only publish books in public domain, ie. 70 years after the death of the author!" %}

    -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/src/suggest/templates/suggest.html b/src/suggest/templates/suggest.html index ddf0bf818..4bdf2b623 100644 --- a/src/suggest/templates/suggest.html +++ b/src/suggest/templates/suggest.html @@ -1,9 +1 @@ {% extends "ajaxable/form.html" %} -{% load ajaxable_tags %} - -{% block form_fields %} - {{ form.contact|pretty_field }} - {{ form.description|pretty_field }} - {{ form.agree_newsletter|pretty_checkbox }} -
  • {{ form.data_processing }}
  • -{% endblock %} \ No newline at end of file diff --git a/src/wolnelektury/settings/auth.py b/src/wolnelektury/settings/auth.py index d4824999a..b150b990f 100644 --- a/src/wolnelektury/settings/auth.py +++ b/src/wolnelektury/settings/auth.py @@ -6,7 +6,7 @@ AUTHENTICATION_BACKENDS = [ # 'allauth.account.auth_backends.AuthenticationBackend', ] ACCOUNT_EMAIL_CONFIRMATION_EXPIRE_DAYS = 2 -LOGIN_URL = '/uzytkownik/zaloguj-utworz/' +LOGIN_URL = '/uzytkownik/login/' LOGIN_REDIRECT_URL = '/' diff --git a/src/wolnelektury/settings/basic.py b/src/wolnelektury/settings/basic.py index 29c882b35..95d2b1a75 100644 --- a/src/wolnelektury/settings/basic.py +++ b/src/wolnelektury/settings/basic.py @@ -50,7 +50,6 @@ TEMPLATES = [{ 'django.template.context_processors.media', 'django.template.context_processors.request', 'wolnelektury.context_processors.extra_settings', - 'search.context_processors.search_form', ), }, }] diff --git a/src/wolnelektury/static/2021/scripts/main.js b/src/wolnelektury/static/2021/scripts/main.js index 696a5fb00..d231b40a6 100644 --- a/src/wolnelektury/static/2021/scripts/main.js +++ b/src/wolnelektury/static/2021/scripts/main.js @@ -531,5 +531,16 @@ window.location.reload(true); }); + $('.c-lang').on('click', function() { + !$(this).toggleClass('is-open'); + }); + + + + + + $(".c-media__settings > i").on('click', function() { + $(".c-media__settings").toggleClass('active'); + }); })(); diff --git a/src/wolnelektury/static/2022/styles/components/_lang.scss b/src/wolnelektury/static/2022/styles/components/_lang.scss index 7ca9114cb..ef5d7bc7f 100644 --- a/src/wolnelektury/static/2022/styles/components/_lang.scss +++ b/src/wolnelektury/static/2022/styles/components/_lang.scss @@ -1,11 +1,18 @@ .c-lang { position: absolute; - top: 23px; - margin-right: 217px; + top: 11px; + + width: 150px; + right: 50px + 16px; opacity: 0; pointer-events: none; transition: opacity 350ms $ease-out; z-index: $master-layer + 1; + display: none; + + @include rwd($break-menu) { + display: block; + } &.is-open { .c-lang__button { @@ -48,10 +55,20 @@ opacity: 0; transition: all 350ms $ease-out; pointer-events: none; - a { + display: flex; + flex-direction: column; + + button { display: block; padding: 9px 20px; color: #474747; + background-color: transparent; + border: 0; + cursor: pointer; + font-family: "Source Sans Pro"; + font-size: 16px; + line-height: 18.4px; + text-align: left; &:hover { background-color: #EDAA00; @@ -62,4 +79,4 @@ background-color: #EDAA00; } } -} \ No newline at end of file +} diff --git a/src/wolnelektury/static/2022/styles/components/_media.scss b/src/wolnelektury/static/2022/styles/components/_media.scss index e52708b87..ebeb7aad2 100644 --- a/src/wolnelektury/static/2022/styles/components/_media.scss +++ b/src/wolnelektury/static/2022/styles/components/_media.scss @@ -54,6 +54,7 @@ display: flex; align-items: center; justify-content: space-between; + position: relative; .icons {} .content { @@ -76,6 +77,47 @@ font-size: 12px; line-height: 140%; } + + .c-media__settings { + position: absolute; + left: 0; + right: 0; + top: 0; + z-index: 5; + min-height: 30px; + overflow: hidden; + + .icon { + position: absolute; + transition: .5s rotate; + bottom: 0; + right: 0; + line-height: 30px; + width: 40px; + text-align: center; + margin: 0; + } + > div { + height: 0; + transition: .5s height; + overflow: hidden; + background: #F2F2F2; + border-bottom: 5px solid #D5ECED; + margin-top: -5px; + > div { + padding: 30px; + } + } + &.active { + .icon { + rotate: 180deg; + + } + > div { + height: 150px; + } + } + } } .c-media__popup { diff --git a/src/wolnelektury/static/2022/styles/layout/_navigation.scss b/src/wolnelektury/static/2022/styles/layout/_navigation.scss index 9333766bc..c4d4f7a9b 100644 --- a/src/wolnelektury/static/2022/styles/layout/_navigation.scss +++ b/src/wolnelektury/static/2022/styles/layout/_navigation.scss @@ -22,6 +22,7 @@ body { } .l-container { + position: relative; display: flex; align-items: center; justify-content: space-between; @@ -262,6 +263,10 @@ body { font-size: 30px; } } + .c-lang { + display: block; + left: 16px; + } } } } @@ -365,6 +370,9 @@ body { display: flex; flex-direction: column; justify-content: space-between; + @include rwd($break-menu) { + width: 60%; + } p { color: $color-white; diff --git a/src/wolnelektury/templates/404.html b/src/wolnelektury/templates/404.html index 06b57d8a9..372c94118 100644 --- a/src/wolnelektury/templates/404.html +++ b/src/wolnelektury/templates/404.html @@ -1,4 +1,4 @@ -{% extends request.EXPERIMENTS.layout.value|yesno:"2022/base_simple.html,base/base.html" %} +{% extends "2022/base_simple.html" %} {% load i18n %} {% block settings %} diff --git a/src/wolnelektury/templates/account/base.html b/src/wolnelektury/templates/account/base.html index e9980c9cf..5f9693d51 100644 --- a/src/wolnelektury/templates/account/base.html +++ b/src/wolnelektury/templates/account/base.html @@ -1,4 +1,4 @@ -{% extends request.EXPERIMENTS.layout.value|yesno:"2022/base_simple.html,site_base.html" %} +{% extends "2022/base_simple.html" %} {% block body %}
    diff --git a/src/wolnelektury/templates/auth/login.html b/src/wolnelektury/templates/auth/login.html deleted file mode 100644 index c32df0f79..000000000 --- a/src/wolnelektury/templates/auth/login.html +++ /dev/null @@ -1,27 +0,0 @@ -{% load i18n %} - -

    {{ title }}

    - -
    - {% csrf_token %} -
      -
      - {{ form.as_ul }} -
    1. {% trans "Forgot Password?" %}
    2. -
    3. -
    -
    - -{% if USE_OPENID %} -

    {% trans "Sign in using:" %}

    - -
      - {% include "socialaccount/snippets/provider_list.html" %} -
    - -{% include "socialaccount/snippets/login_extra.html" %} -{% endif %} - -{% block extra %} -{% endblock %} diff --git a/src/wolnelektury/templates/auth/login_register.html b/src/wolnelektury/templates/auth/login_register.html deleted file mode 100644 index 50e2ea075..000000000 --- a/src/wolnelektury/templates/auth/login_register.html +++ /dev/null @@ -1,9 +0,0 @@ -{% extends "auth/login.html" %} -{% load i18n %} -{% load honeypot %} - -{% block extra %} - {{ block.super }} - - {% include "auth/register_form.html" with form=register_form title=_("or register") action_url='register' action_query=request.GET.urlencode honeypot=True submit=register_submit %} -{% endblock %} diff --git a/src/wolnelektury/templates/auth/register.html b/src/wolnelektury/templates/auth/register.html deleted file mode 100644 index 684943866..000000000 --- a/src/wolnelektury/templates/auth/register.html +++ /dev/null @@ -1,16 +0,0 @@ -{% load i18n %} - - -{% include "auth/register_form.html" %} - -{% if USE_OPENID %} -
    -

    {% trans "Sign in using:" %}

    - -
      - {% include "socialaccount/snippets/provider_list.html" %} -
    - - {% include "socialaccount/snippets/login_extra.html" %} -
    -{% endif %} diff --git a/src/wolnelektury/templates/auth/register_form.html b/src/wolnelektury/templates/auth/register_form.html deleted file mode 100644 index 9f72af7d5..000000000 --- a/src/wolnelektury/templates/auth/register_form.html +++ /dev/null @@ -1,12 +0,0 @@ -{% extends "ajaxable/form.html" %} -{% load ajaxable_tags %} - - -{% block form_fields %} - {{ form.username|pretty_field }} - {{ form.email|pretty_field }} - {{ form.password1|pretty_field }} - {{ form.password2|pretty_field }} - {{ form.agree_newsletter|pretty_checkbox }} -
  • {{ form.data_processing }}
  • -{% endblock %} \ No newline at end of file diff --git a/src/wolnelektury/templates/bajki.html b/src/wolnelektury/templates/bajki.html deleted file mode 100644 index 7d65c0a87..000000000 --- a/src/wolnelektury/templates/bajki.html +++ /dev/null @@ -1,3 +0,0 @@ -{% extends 'podcast.html' %} - -{% block artist_label %}Opowiada{% endblock %} \ No newline at end of file diff --git a/src/wolnelektury/templates/base/app.html b/src/wolnelektury/templates/base/app.html deleted file mode 100644 index e10b6892e..000000000 --- a/src/wolnelektury/templates/base/app.html +++ /dev/null @@ -1,98 +0,0 @@ - -{% spaceless %} - - {% load pipeline i18n %} - {% load static %} - {% load piwik_tags %} - {% get_current_language as LANGUAGE_CODE %} - - - - - - - - - - {% block ogextra %}{% endblock %} - - - {% block title %}{% block titleextra %}{{ page_title }}{% endblock %} :: {% trans "Wolne Lektury" %}{% endblock %} - - - - - {% stylesheet "main" %} - {% block extrahead %}{% endblock %} - - - - {% block bodycontent %} - -
    -
    -
    - - -
    - - {% trans - {% trans "Language" %} - -
    - {% for lang in LANGUAGES %} -
    - {% csrf_token %} - - -
    - {% endfor %} -
    -
    - - -
    -
    -
    - -
    - {% block body %} - {% endblock %} -
    -
    - - {% endblock bodycontent %} - - - - {% javascript "base" %} - - {% tracking_code %} - - {% block extrabody %}{% endblock %} - - - - -{% endspaceless %} diff --git a/src/wolnelektury/templates/base/base.html b/src/wolnelektury/templates/base/base.html deleted file mode 100644 index 600ec9225..000000000 --- a/src/wolnelektury/templates/base/base.html +++ /dev/null @@ -1,4 +0,0 @@ -{% extends "base/superbase.html" %} - - -{% block ogtitle %}{% block titleextra %}{{ page_title }}{% endblock %}{% endblock %} diff --git a/src/wolnelektury/templates/base/superbase.html b/src/wolnelektury/templates/base/superbase.html deleted file mode 100644 index 176b3c3f4..000000000 --- a/src/wolnelektury/templates/base/superbase.html +++ /dev/null @@ -1,180 +0,0 @@ - -{% spaceless %} - - {% load pipeline i18n %} - {% load static %} - {% load catalogue_tags funding_tags reporting_stats %} - {% load piwik_tags %} - {% load cache %} - {% load chunk from chunks %} - {% load sponsor_page from sponsors %} - {% load annoy_banner from annoy %} - {% get_current_language as LANGUAGE_CODE %} - - - - - - - - - - {% block ogextra %}{% endblock %} - - - {% block title %}{% block titleextra %}{{ page_title }}{% endblock %} :: {% trans "Wolne Lektury" %}{% endblock %} - - - - - {% stylesheet "main" %} - {% block extrahead %}{% endblock %} - {% tracking_code %} - - - - - {% block bodycontent %} - - {% block annoy %} - {% annoy_banner 'blackout' %} - {% annoy_banner 'top' %} - {% if not funding_no_show_current %} - {% cache 120 funding_top_bar LANGUAGE_CODE %} - {% funding_top_bar %} - {% endcache %} - {% endif %} - {% endblock %} - -
    -
    -
    - - -

    - {% url 'book_list' as b %} - {% url 'infopage' 'prawa' as r %} - {% count_books book_count %} - {% blocktrans count book_count as c %} - {{ c }} free reading you have right to - {% plural %} - {{ c }} free readings you have right to - {% endblocktrans %} -

    - -
    - - - {% trans "Language" %} - -
    - {% for lang in LANGUAGES %} -
    - {% csrf_token %} - - -
    - {% endfor %} -
    -
    - - - -
    -
    - - {{ search_form.q }} -
    - -
    - - - - - -
    -
    -
    - -
    - {% comment %} -
    - - Wesprzyj działalność Nowoczesnej Polski - -
    - {% endcomment %} - {% block body %} - {% endblock %} -
    -
    - - - - {# template #} -
    - -
    -

    * {% trans "Loading" %}

    -
    -
    - {% endblock bodycontent %} - - - - {% javascript "base" %} - - {% block extrabody %}{% endblock %} - - - - -{% endspaceless %} diff --git a/src/wolnelektury/templates/forms/form_sent.html b/src/wolnelektury/templates/forms/form_sent.html index 1a8007f31..ee4cc1f07 100644 --- a/src/wolnelektury/templates/forms/form_sent.html +++ b/src/wolnelektury/templates/forms/form_sent.html @@ -1,4 +1,4 @@ -{% extends form.base_template|default:request.EXPERIMENTS.layout.value|yesno:"2022/base_simple.html,base/base.html" %} +{% extends form.base_template|default:"2022/base_simple.html" %} {% load forms_builder_tags %} {% load title %} {% load i18n %} diff --git a/src/wolnelektury/templates/forms/includes/built_form.html b/src/wolnelektury/templates/forms/includes/built_form.html index cef827f50..89bed2f7c 100644 --- a/src/wolnelektury/templates/forms/includes/built_form.html +++ b/src/wolnelektury/templates/forms/includes/built_form.html @@ -15,19 +15,10 @@
    {% if form_published %} - {% if request.EXPERIMENTS.layout.value %} {{ form_for_form.as_p }} {% if form_for_form.fields %} {% endif %} - {% else %} - - {{ form_for_form.as_table }} - {% if form_for_form.fields %} - - {% endif %} -
    - {% endif %} {% else %}

    FORMULARZ ZAMKNIĘTY

    {% endif %} diff --git a/src/wolnelektury/templates/main_menu.html b/src/wolnelektury/templates/main_menu.html deleted file mode 100644 index be642d6b9..000000000 --- a/src/wolnelektury/templates/main_menu.html +++ /dev/null @@ -1,23 +0,0 @@ -{% load i18n %} - - - {% trans "Support us" %} - - - {% trans "School readings" %} - - - {% trans "Literature" %} - - - {% trans "Themes" %} - - - {% trans "Audiobooks" %} - - - {% trans "Collections" %} - -
  • - {% trans "Newsletter" %} -
  • diff --git a/src/wolnelektury/templates/main_page.html b/src/wolnelektury/templates/main_page.html deleted file mode 100644 index de612210a..000000000 --- a/src/wolnelektury/templates/main_page.html +++ /dev/null @@ -1,142 +0,0 @@ -{% extends "base/base.html" %} -{% load latest_blog_posts from blog %} -{% load carousel from social_tags %} -{% load static %} -{% load i18n catalogue_tags infopages_tags %} -{% load cache %} -{% load funding_tags %} -{% get_current_language as LANGUAGE_CODE %} - - -{% block title %}{% trans "Wolne Lektury internet library" %}{% endblock %} -{% block ogtitle %}{% trans "Wolne Lektury internet library" %}{% endblock %} - -{% block footerlink %}#main-footer{% endblock %} - -{% block body %} - {% spaceless %} - {% carousel 'main' %} - -
    -

    {% trans "In our digital library you will find" %}

    -
    -
    - {% for book in best %} - {{ book.mini_box }} - {% endfor %} -
    - -
    -
    - -
    -

    - - {% trans "Recent publications" %} - → - -

    - {% for book in last_published %} - {{ book.mini_box }} - {% endfor %} -
    - - {% if collections %} -
    -

    - - {% trans "Collections" %} - → - -

    - {% for collection in collections %} - {{ collection.box }} - {% endfor %} -
    - {% endif %} - -
    -

    - - {% trans "Motifs and themes" %} - → - -

    -
    -

    {% trans "Theme" %}: {{ theme }}

    -

    {% trans "Explore works with the same theme" %}

    - {% for book in theme_books %} - {{ book.mini_box }} - {% endfor %} - {% if theme_fragment %} - {% cache 3600 fragment_promo theme_fragment.pk %} - {% include 'catalogue/fragment_promo.html' with fragment=theme_fragment %} - {% endcache %} - {% endif %} -
    -
    - - - -
    -

    {% trans "News" %}

    -
      - {% cache 1800 latest_blog_posts %} - {% latest_blog_posts %} - {% endcache %} -
    -
    - -
    -

    {% trans "Utilities" %}

    - - -
    - -
    -

    {% trans "Information" %}

    - - - -
    - {% endspaceless %} -{% endblock %} - - -{% block add_footer %} - {% spaceless %} - {% if cite %} -

    - {% trans "Image used:" %} - {% cache 3600 cite_info cite.pk %} - {% include 'social/cite_info.html' %} - {% endcache %} -

    - {% endif %} - {% endspaceless %} -{% endblock %} diff --git a/src/wolnelektury/templates/podcast.html b/src/wolnelektury/templates/podcast.html deleted file mode 100644 index 0fdb07193..000000000 --- a/src/wolnelektury/templates/podcast.html +++ /dev/null @@ -1,44 +0,0 @@ - \ No newline at end of file diff --git a/src/wolnelektury/templates/post_test.html b/src/wolnelektury/templates/post_test.html deleted file mode 100644 index e0f71099b..000000000 --- a/src/wolnelektury/templates/post_test.html +++ /dev/null @@ -1,8 +0,0 @@ -{% extends "base/base.html" %} - -{% block body %} -
    - {% csrf_token %} - -
    -{% endblock body %} diff --git a/src/wolnelektury/templates/publish_plan.html b/src/wolnelektury/templates/publish_plan.html index 22e59a97f..dec60b689 100644 --- a/src/wolnelektury/templates/publish_plan.html +++ b/src/wolnelektury/templates/publish_plan.html @@ -1,4 +1,4 @@ -{% extends request.EXPERIMENTS.layout.value|yesno:"2022/base_simple.html,base/base.html" %} +{% extends "2022/base_simple.html" %} {% load i18n %} {% block settings %} diff --git a/src/wolnelektury/templates/site_base.html b/src/wolnelektury/templates/site_base.html index 3982fc4ca..a74a473e8 100644 --- a/src/wolnelektury/templates/site_base.html +++ b/src/wolnelektury/templates/site_base.html @@ -1,5 +1,2 @@ -{% extends "base/base.html" %} +{% extends "2022/base_simple.html" %} {# This is for allauth templates. #} - -{% block bodyid %}auth-page{% endblock %} -{% block titleextra %}{% block head_title %}{% endblock %}{% endblock %} diff --git a/src/wolnelektury/templates/socialaccount/base.html b/src/wolnelektury/templates/socialaccount/base.html index 934f4a621..38172117e 100644 --- a/src/wolnelektury/templates/socialaccount/base.html +++ b/src/wolnelektury/templates/socialaccount/base.html @@ -1,4 +1,4 @@ -{% extends request.EXPERIMENTS.layout.value|yesno:"2022/base_simple.html,account/base.html" %} +{% extends "2022/base_simple.html" %} {% block breadcrumbs %} diff --git a/src/wolnelektury/templates/socialaccount/login_cancelled.html b/src/wolnelektury/templates/socialaccount/login_cancelled.html index eed32128a..e60343e2f 100644 --- a/src/wolnelektury/templates/socialaccount/login_cancelled.html +++ b/src/wolnelektury/templates/socialaccount/login_cancelled.html @@ -1,4 +1,4 @@ -{% extends "base/base.html" %} +{% extends "2022/base_simple.html" %} {% load i18n %} @@ -16,4 +16,3 @@
    {% endblock %} - diff --git a/src/wolnelektury/templates/socialaccount/signup.html b/src/wolnelektury/templates/socialaccount/signup.html index ef4d5fc45..d3f86e068 100644 --- a/src/wolnelektury/templates/socialaccount/signup.html +++ b/src/wolnelektury/templates/socialaccount/signup.html @@ -1,7 +1,6 @@ {% extends "socialaccount/base.html" %} {% load i18n %} -{% load ajaxable_tags %} {% block head_title %}{% trans "Signup" %}{% endblock %} @@ -13,11 +12,7 @@