From: Radek Czajka Date: Thu, 3 Nov 2022 13:26:13 +0000 (+0100) Subject: Funding view X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/150c16b9cecccacdbf17360d334fc618172f4179?ds=sidebyside;hp=8db46b44b9824b66f10c1b8030b1bdb5a5cc9795 Funding view --- diff --git a/src/funding/locale/pl/LC_MESSAGES/django.mo b/src/funding/locale/pl/LC_MESSAGES/django.mo index 99760e1bb..2f5ef468d 100644 Binary files a/src/funding/locale/pl/LC_MESSAGES/django.mo and b/src/funding/locale/pl/LC_MESSAGES/django.mo differ diff --git a/src/funding/locale/pl/LC_MESSAGES/django.po b/src/funding/locale/pl/LC_MESSAGES/django.po index 55ec93d2a..f7107ce9c 100644 --- a/src/funding/locale/pl/LC_MESSAGES/django.po +++ b/src/funding/locale/pl/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2021-06-10 14:06+0200\n" +"PO-Revision-Date: 2022-10-31 13:47+0100\n" "Last-Translator: Radek Czajka \n" "Language-Team: \n" "Language: pl\n" @@ -16,7 +16,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " "|| n%100>=20) ? 1 : 2);\n" -"X-Generator: Poedit 2.4.1\n" +"X-Generator: Poedit 3.0.1\n" #: funding/admin.py:27 msgid "payment complete" @@ -434,8 +434,8 @@ msgid "" "We need %(target)s zł to digitize it,\n" " compile it and publish for free in multiple formats." msgstr "" -"Potrzebujemy %(target)s zł, by ją zdigitalizować, opracować i bezpłatnie " -"udostępnić w serwisie w wielu formatach." +"Potrzebujemy %(target)s zł, by zdigitalizować tę książkę, opracować i " +"bezpłatnie udostępnić w serwisie w wielu formatach." #: funding/templates/funding/includes/offer_status.html:17 #, python-format @@ -602,10 +602,12 @@ msgid "" " from successful fundraisers.\n" " " msgstr "" +"\n" "Jeśli nie udało się zebrać pełnej kwoty potrzebnej do opublikowania książki, " "środki przekazujemy na redakcję innych utworów " "oczekujących na publikację w serwisie. Na ten cel przekazujemy również " -"nadmiarowe środki ze zbiórek ukończonych sukcesem." +"nadmiarowe środki ze zbiórek ukończonych sukcesem.\n" +" " #: funding/templates/funding/wlfund.html:21 msgid "Spending these remaining funds is recorded in this table." diff --git a/src/funding/models.py b/src/funding/models.py index 838d2ab35..7d0e74247 100644 --- a/src/funding/models.py +++ b/src/funding/models.py @@ -69,8 +69,10 @@ class Offer(models.Model): def clear_cache(self): clear_cached_renders(self.top_bar) + clear_cached_renders(self.top_bar_2022) clear_cached_renders(self.list_bar) clear_cached_renders(self.detail_bar) + clear_cached_renders(self.detail_bar_2022) clear_cached_renders(self.status) clear_cached_renders(self.status_more) @@ -243,6 +245,24 @@ class Offer(models.Model): def status_more(self): return {'offer': self} + @cached_render('funding/2022/includes/funding.html') + def top_bar_2022(self): + ctx = self.basic_info() + ctx.update({ + 'link': True, + 'closeable': True, + 'add_class': 'funding-top-header', + }) + return ctx + + @cached_render('funding/2022/includes/funding.html') + def detail_bar_2022(self): + ctx = self.basic_info() + ctx.update({ + 'show_title': False, + }) + return ctx + class Perk(models.Model): """ A perk offer. diff --git a/src/funding/templates/funding/2022/includes/funding.html b/src/funding/templates/funding/2022/includes/funding.html new file mode 100644 index 000000000..f80a07547 --- /dev/null +++ b/src/funding/templates/funding/2022/includes/funding.html @@ -0,0 +1,42 @@ +{% load i18n %} +{% load time_tags %} + +{% if offer %} + + + + +{% endif %} diff --git a/src/funding/templates/funding/2022/offer_detail.html b/src/funding/templates/funding/2022/offer_detail.html new file mode 100644 index 000000000..b6d89e6d1 --- /dev/null +++ b/src/funding/templates/funding/2022/offer_detail.html @@ -0,0 +1,99 @@ +{% extends '2022/base.html' %} +{% load i18n %} +{% load chunks %} +{% load thumbnail %} +{% load fundings from funding_tags %} + + +{% block settings %} + {% load title %} + {% title object %} +{% endblock %} + + +{% block breadcrumbs %} + Zbiórki + {{ object }} +{% endblock %} + + +{% block main %} + {{ object.detail_bar_2022 }} + +
+

{{ object }}

+ +
+
+
+ {% if object.cover %} + {% thumbnail object.cover '320x1000' as th %} + + {% endthumbnail %} + {% endif %} +
+
+
+
+ {{ object.description|safe }} +
+ {% if object.is_current %} +
+ {{ form.as_p }} + + {{ form.data_processing }} + + +
+ {% else %} + {{ object.status }} + {{ object.status_more }} + {% endif %} +
+
+ +
+ + + + +
+

{% trans "Supporters" %}

+ {% fundings object %} +
+ + {# pomóż uwolnić #} + {# 1% #} + {# share? #} + + +{% endblock %} diff --git a/src/funding/templatetags/funding_tags.py b/src/funding/templatetags/funding_tags.py index bfd0e5462..3e4889200 100644 --- a/src/funding/templatetags/funding_tags.py +++ b/src/funding/templatetags/funding_tags.py @@ -16,6 +16,11 @@ def funding_top_bar(): offer = Offer.current() return offer.top_bar() if offer is not None else '' +@register.simple_tag +def funding_top_bar_2022(): + offer = Offer.current() + return offer.top_bar_2022() if offer is not None else '' + @register.simple_tag(takes_context=True) def fundings(context, offer): diff --git a/src/funding/views.py b/src/funding/views.py index 71373ae26..d34eccc00 100644 --- a/src/funding/views.py +++ b/src/funding/views.py @@ -71,7 +71,12 @@ class WLFundView(TemplateView): class OfferDetailView(FormView): form_class = FundingForm - template_name = "funding/offer_detail.html" + + def get_template_names(self): + if self.request.EXPERIMENTS['layout'].value: + return 'funding/2022/offer_detail.html' + else: + return "funding/offer_detail.html" @csrf_exempt def dispatch(self, request, slug=None): diff --git a/src/wolnelektury/settings/static.py b/src/wolnelektury/settings/static.py index 776b47f7d..9e07efb27 100644 --- a/src/wolnelektury/settings/static.py +++ b/src/wolnelektury/settings/static.py @@ -143,6 +143,13 @@ PIPELINE = { 'js/2022.js', '2022/book/filter.js', 'chunks/edit.js', + + 'js/contrib/jquery.countdown.js', 'js/contrib/jquery.countdown-pl.js', + 'js/contrib/jquery.countdown-de.js', 'js/contrib/jquery.countdown-uk.js', + 'js/contrib/jquery.countdown-es.js', 'js/contrib/jquery.countdown-lt.js', + 'js/contrib/jquery.countdown-ru.js', 'js/contrib/jquery.countdown-fr.js', + 'pdcounter/pdcounter.js', + ], 'output_filename': 'js/2022.min.js' }, diff --git a/src/wolnelektury/static/2021/scripts/main.js b/src/wolnelektury/static/2021/scripts/main.js index 21c76a023..3dd799a25 100644 --- a/src/wolnelektury/static/2021/scripts/main.js +++ b/src/wolnelektury/static/2021/scripts/main.js @@ -155,7 +155,7 @@ $('.js-collections').each(function() { let collectionsSlider = $('.l-books', this); - if ($collectionsSlider.children().length < 2) return; + if (collectionsSlider.children().length < 2) return; let collectionsNextSlide = $('.js-next-slide', this); let collectionsPrevSlide = $('.js-prev-slide', this); diff --git a/src/wolnelektury/static/2022/more.scss b/src/wolnelektury/static/2022/more.scss index 424125394..754578dd5 100644 --- a/src/wolnelektury/static/2022/more.scss +++ b/src/wolnelektury/static/2022/more.scss @@ -324,6 +324,21 @@ form { margin-right: 50px; width: auto; } + + .wlfund { + margin: 0; + width: 90%; + border-collapse: separate; + + tr { + td { + padding: .625rem .3125rem .625rem; + border-top: .625rem solid rgba(255,255,255,0); + border-bottom: 1px solid #083F4D; + text-align: center; + } + } + } } .page-simple, .nice-controls { @@ -402,3 +417,41 @@ form { } } } + + +.funding-promo-bar { + margin: 18px auto; + + .l-checkout__support { + margin: 0; + a { + display: flex; + align-items: start; + + .buttonlike { + margin-right: 10px; + background: #FFA500; + //color: #083F4D; + color: black; + border-radius: 5px; + font-size: 1.125rem; + line-height: 50px; + letter-spacing: -0.01em; + padding: 0 20px; + font-weight: 600; + transition: all cubic-bezier(0.25, 1, 0.5, 1) 350ms; + &:hover { + background: #92BD39; + } + } + .funding-bar-container { + flex-grow: 1; + } + } + } +} + + +.l-change-pop { + margin-bottom: 18px; +} diff --git a/src/wolnelektury/static/2022/styles/local.scss b/src/wolnelektury/static/2022/styles/local.scss index 46626e6f3..d9aafcf2d 100644 --- a/src/wolnelektury/static/2022/styles/local.scss +++ b/src/wolnelektury/static/2022/styles/local.scss @@ -73,3 +73,21 @@ $teal: #007880; } } } + + + + +.l-checkout__support__bar span.little-progress::after { + white-space: nowrap; + justify-content: left; + width: 200px; + right: -210px; + color: #083F4D; +} +.funding-description { + h2 { + margin-top: 0; + font-size: 1.125rem; + line-height: 1.35; + } +} diff --git a/src/wolnelektury/templates/2022/base.html b/src/wolnelektury/templates/2022/base.html index f314f1f85..36b1452fb 100644 --- a/src/wolnelektury/templates/2022/base.html +++ b/src/wolnelektury/templates/2022/base.html @@ -1,6 +1,8 @@ +{% load cache %} {% load pipeline %} {% load static %} +{% load funding_tags %} {% load piwik_tags %} {% load title %} @@ -29,17 +31,13 @@ {% block under-menu %}{% endblock %} -
-

Zmieniamy się!

-

- Jeżeli to czytasz jesteś jedną z osób, której prezentujemy nowy wygląd części stron. - Będziemy bardzo! wdzięczni za Twoją opinię – możesz nam ją przesłać tutaj. - Jeżeli wolisz klasyczny wygląd - wystarczy, że klikniesz tutaj -

- -
+ {% if not funding_no_show_current %} +
+ {% cache 120 funding_top_bar LANGUAGE_CODE %} + {% funding_top_bar_2022 %} + {% endcache %} +
+ {% endif %} {% block global-content %}
@@ -54,11 +52,27 @@ {% endblock %} +
+

Zmieniamy się!

+

+ Jeżeli to czytasz jesteś jedną z osób, której prezentujemy nowy wygląd części stron. + Będziemy bardzo! wdzięczni za Twoją opinię – możesz nam ją przesłać tutaj. + Jeżeli wolisz klasyczny wygląd - wystarczy, że klikniesz tutaj +

+ +
+ + {% include '2022/footer.html' %} + {% javascript '2022' %} {% javascript '2022_player' %} {% block extrabody %}{% endblock %} diff --git a/src/wolnelektury/templates/2022/main_page.html b/src/wolnelektury/templates/2022/main_page.html index 35149f3b6..b541467ad 100644 --- a/src/wolnelektury/templates/2022/main_page.html +++ b/src/wolnelektury/templates/2022/main_page.html @@ -144,10 +144,12 @@

{{ recommended_collection.title }}

+ {% comment %}
+ {% endcomment %}
{% for book in recommended_collection.get_books %}