django-countries==7.3.2
# A version compatible with Django 2.2+, with long help text and editable max_length.
--e git+https://github.com/rczajka/django-forms-builder@6bdb2345cfc02ebf7e0fb049e43e4e0a38b52940#egg=django-forms-builder
+-e git+https://github.com/rczajka/django-forms-builder@30beb889cbf297be35963c15501c764a0689b539#egg=django-forms-builder
oauthlib>=3.0.1,<3.1
sorl-thumbnail==12.8.0
# home-brewed & dependencies
-librarian==2.4.10
+librarian==2.4.12
# celery tasks
celery[redis]==5.2.7
def get_absolute_catalogue_url(self):
# TODO: remove magic.
- return reverse(f'{self.category}_catalogue')
+ if self.category == 'set':
+ return reverse('social_my_shelf')
+ else:
+ return reverse(f'{self.category}_catalogue')
def has_description(self):
return len(self.description) > 0
<div class="row">
- <h2>O autorze</h2>
+ <h2>
+ {% if tag.category == 'author' %}O autorze
+ {% elif tag.category == 'kind' %}O rodzaju
+ {% elif tag.category == 'genre' %}O gatunku
+ {% elif tag.category == 'epoch' %}O epoce
+ {% elif tag.category == 'set' %}Półka
+ {% endif %}
+ </h2>
<div>
- {% if author.photo %}
+ {% if tag.photo %}
<figure class="l-author__photo">
- <img src="{{ author.photo.url }}" alt="{{ author.name }}" style="width: 238px;">
+ <img src="{{ tag.photo.url }}" alt="{{ tag.name }}" style="width: 238px;">
<figcaption>
- {{ author.photo_attribution|safe }}
+ {{ tag.photo_attribution|safe }}
</figcaption>
</figure>
{% endif %}
<article class="l-author__info">
- <h3><a href="{{ author.get_absolute_url }}">{{ author.name }}</a></h3>
+ {% if tag.category == 'set' %}
+ {% load chunks %}
+ {% chunk 'polka-how-to' %}
+ {% else %}
+ <h3><a href="{{ tag.get_absolute_url }}">{{ tag.name }}</a></h3>
<div class="l-article__overlay" data-max-height="327">
- {{ author.description|safe }}
+ {{ tag.description|safe }}
</div>
<button class="l-article__read-more" aria-label="Kliknij aby rozwinąć" data-label="Czytaj więcej" data-action="Zwiń tekst">Czytaj więcej</button>
+ {% endif %}
</article>
</div>
</div>
{% if tags %}
<section class="l-section">
<div class="l-author">
- {% with author=tags.0 %}
+ {% with tag=tags.0 %}
{% include 'catalogue/2022/author_box.html' %}
{% endwith %}
{% choose_cites 3 author=tags.0 as cites %}
<a class="l-author__quotes__slider__item" href="{{ fragment.get_absolute_url }}">
<em>
- {{ fragment.short_text|safe }}
+ {% if fragment.short_text %}
+ {{ fragment.short_text|safe }}
+ {% else %}
+ {{ fragment.text|safe }}
+ {% endif %}
</em>
<p>{{ fragment.book.pretty_title }}</p>
</a>
Tag.objects.usage_for_queryset(
objects, counts=True
).exclude(category='set').exclude(pk__in=tag_ids))
+ related_tag_lists.append(
+ Tag.objects.usage_for_queryset(
+ objects, counts=True
+ ).filter(
+ user=request.user
+ ).exclude(name='').exclude(pk__in=tag_ids)
+ )
if not (extra and extra.get('theme_is_set')):
if fragments is None:
if list_type == 'gallery':
categories = split_tags(*related_tag_lists)
suggest = []
- for c in ['author', 'epoch', 'kind', 'genre']:
- #if len(categories.get(c, [])) > 1:
+ for c in ['set', 'author', 'epoch', 'kind', 'genre']:
suggest.extend(sorted(categories[c], key=lambda t: -t.count)[:3])
objects = list(objects)
if extra:
result.update(extra)
- is_set = any((x.category == 'set' for x in tags))
is_theme = len(tags) == 1 and tags[0].category == 'theme'
has_theme = any((x.category == 'theme' for x in tags))
new_layout = request.EXPERIMENTS['layout']
- if is_set and new_layout.value:
- template = 'social/2022/set_detail.html'
- elif is_theme and new_layout.value:
+ if is_theme and new_layout.value:
template = 'catalogue/2022/theme_detail.html'
elif new_layout.value and not has_theme:
template = 'catalogue/2022/author_detail.html'
--- /dev/null
+# Generated by Django 4.0.8 on 2023-05-08 12:46
+
+from django.db import migrations, models
+
+
+def last_amount_wide(apps, schema_editor):
+ SingleAmount = apps.get_model('club', 'SingleAmount')
+ a = SingleAmount.objects.last()
+ a.wide = True
+ a.save()
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('club', '0042_auto_20220826_1458'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='monthlyamount',
+ name='wide',
+ field=models.BooleanField(default=False),
+ ),
+ migrations.AddField(
+ model_name='singleamount',
+ name='wide',
+ field=models.BooleanField(default=False),
+ ),
+ migrations.RunPython(
+ last_amount_wide,
+ migrations.RunPython.noop
+ )
+ ]
def __str__(self):
return 'Klub'
+ def get_amounts(self):
+ c = {}
+ single = list(self.singleamount_set.all())
+ monthly = list(self.monthlyamount_set.all())
+ for tag, amounts in ('single', single), ('monthly', monthly):
+ wide_spot = narrow_spot = 0
+ for i, p in enumerate(amounts):
+ if p.description or p.wide:
+ if not p.description:
+ p.narrow_wide = True
+ if narrow_spot == 1:
+ amounts[i-1].narrow_wide = True
+ narrow_spot = 0
+ if p.wide:
+ if wide_spot == 2:
+ p.wide_not_wide = True
+ wide_spot += 1
+ else:
+ wide_spot += 2
+ else:
+ wide_spot += 1
+ wide_spot %= 3
+ c[tag] = amounts
+ c[f'{tag}_wide_spot'] = wide_spot
+ return c
+
+
class SingleAmount(models.Model):
club = models.ForeignKey(Club, models.CASCADE)
amount = models.IntegerField()
description = models.TextField(blank=True)
+ wide = models.BooleanField(default=False)
class Meta:
ordering = ['amount']
club = models.ForeignKey(Club, models.CASCADE)
amount = models.IntegerField()
description = models.TextField(blank=True)
+ wide = models.BooleanField(default=False)
class Meta:
ordering = ['amount']
</div>
</div>
+ {% with amounts=club.get_amounts %}
<div class="l-checkout__payments payments-once">
- {% for amount in club.singleamount_set.all %}
- <div class="l-checkout__payments__box once{% if not schedule.monthly and schedule.amount == amount.amount or not schedule and club.default_single_amount == amount.amount %} is-active{% endif %}{% if forloop.last %} l-checkout__payments__box--xl{% endif %}">
+ {% for amount in amounts.single %}
+ <div class="l-checkout__payments__box once{% if not schedule.monthly and schedule.amount == amount.amount or not schedule and club.default_single_amount == amount.amount %} is-active{% endif %}{% if amount.narrow_wide %} narrow-wide{% endif %}{% if amount.wide %} l-checkout__payments__box--special{% if not amount.wide_not_wide %} l-checkout__payments__box--xl{% endif %}{% endif %}">
<div>
<h3>{{ amount.amount }} zł</h3>
<div class="l-checkout__payments__box__btn-wrp">
<div class="l-checkout__payments payments-recurring">
- {% for amount in club.monthlyamount_set.all %}
- <div class="l-checkout__payments__box{% if schedule.monthly and schedule.amount == amount.amount or not schedule and amount.amount == club.default_monthly_amount %} is-active{% endif %}">
+ {% for amount in amounts.monthly %}
+ <div class="l-checkout__payments__box{% if schedule.monthly and schedule.amount == amount.amount or not schedule and amount.amount == club.default_monthly_amount %} is-active{% endif %}{% if amount.narrow_wide %} narrow-wide{% endif %}{% if amount.wide and not amount.wide_not_wide %} l-checkout__payments__box--xl{% endif %}">
<h3>{{ amount.amount }} zł <span>/mies.</span></h3>
<div class="l-checkout__payments__box__btn-wrp">
<p>{{ amount.description|safe }}</p>
</div>
<button>Dalej</button>
</div>
+ {% endwith %}
</form>
-<img src="{% static '2022/images/checkout-footer.png' %}" alt="Bezpieczne płatności zapewniają" class="l-checkout__footer__img">
+<div class="l-checkout__secure">
+<img src="{% static '2022/images/payments-padlock.png' %}" class="l-checkout__secure__padlock">
+Bezpieczne płatności zapewniają:
+<img src="{% static '2022/images/payments-2.png' %}" class="l-checkout__secure__img">
+</div>
+
<div class="l-checkout__cols bt-w">
<div class="l-checkout__col full">
<div class="l-checkout__form">
translator = b.translator()
if translator:
author_str += ' (tłum. ' + translator + ')'
- data.append(
- {
- 'label': b.title,
- 'author': author_str,
- 'id': b.id,
- 'url': b.get_absolute_url()
- }
- )
+ data.append(
+ {
+ 'label': b.title,
+ 'author': author_str,
+ 'id': b.id,
+ 'url': b.get_absolute_url()
+ }
+ )
if mozhint:
data = [
'django.contrib.admin',
'django.contrib.admindocs',
'django.contrib.staticfiles',
- 'admin_auto_filters',
'admin_ordering',
'rest_framework',
'fnp_django_pagination',
]
FORMS_BUILDER_HELPTEXT_MAX_LENGTH = 2048
FORMS_BUILDER_REQUIRED_CSS_CLASS = 'required'
+FORMS_BUILDER_INACTIVE_VISIBLE = True
overflow-y: hidden;
}
-.l-change-pop {
- margin-top: 18px;
-}
-.is-open .l-change-pop {
- height: auto;
- margin-top: 18px;
- padding: 10px 50px;
-}
-
.l-navigation__logo {
height: 44px;
}
.l-books__item {
@include rwd($break-wide) {
- width: 214.5px;
+ width: 214.4px;
margin-left: 17px;
margin-right: 0;
&:first-of-type {
overflow: hidden;
}
-
-.l-change-pop {
- margin-bottom: 18px;
-}
-
-
.poll-bar {
height: 10px;
width: 100%;
}
.l-article__cols {
- display: flex;
-
- .left-column {
- padding-right: 27px;
- }
-
- .right-column {
- padding-left: 27px;
- }
+ @include rwd($break-flow) {
+ display: flex;
+ gap: 22px;
+ }
.left-column,
.right-column {
- width: 50%;
+ padding: 0 16px;
+
+ @include rwd($break-flow) {
+ width: 50%;
+ }
p {
margin-top: 0;
margin-bottom: 38px;
padding-bottom: 20px;
border-bottom: 1px solid #D9D9D9;
+ margin-left: 16px;
+ margin-right: 16px;
* {
margin-top: 0;
font-weight: $regular;
//Support bar
.l-checkout__support {
- margin-bottom: 22px;
+ margin-bottom: 22px;
+
+ margin-left: 16px;
+ margin-right: 16px;
}
.l-checkout__support__bar {
border-radius: 10px;
padding-bottom: 30px;
overflow: hidden;
+ margin: 0 16px;
}
.l-checkout__box__header {
display: flex;
background: #083F4D;
+
+ img {
+ display: none;
+ @include rwd($break-flow) {
+ display: block;
+ }
+ }
}
.l-checkout__box__header__content h1 {
//Steps
.l-checkout__steps {
display: flex;
- padding: 0 125px;
- justify-content: space-between;
margin-top: -24px;
+ justify-content: space-around;
+
+ @include rwd($break-flow) {
+ padding: 0 125px;
+ justify-content: space-between;
+ }
div {
width: 145px;
text-align: center;
letter-spacing: -0.01em;
color: #083F4D;
+ display: none;
+ @include rwd($break-flow) {
+ display: block;
+ }
}
&.is-completed {
//Payments
.l-checkout__payments {
display: none;
- padding: 0 30px;
+ padding: 0 16px;
margin-top: 34px;
margin-bottom: 0;
flex-wrap: wrap;
justify-content: flex-start;
- flex-direction: column;
+ flex-direction: row;
+ column-gap: 16px;
@include rwd($break-flow) {
- flex-direction: row;
+ //flex-direction: row;
+ padding: 0 30px;
+ column-gap: 30px;
}
}
.l-checkout__payments__box {
display: flex;
flex-direction: column;
- width: calc(33.333% - 20px);
background: #FFFFFF;
border-radius: 10px;
overflow: hidden;
transition: box-shadow $ease-out 250ms;
box-shadow: 0px 0px 0px rgba(55, 170, 156, 0);
margin-bottom: 30px;
- margin-right: 30px;
+ width: calc(50% - 8px);
- &:nth-child(3) {
- margin-right: 0;
+ &.narrow-wide {
+ flex-direction: row;
+ width: 100%;
}
-
- &:nth-child(5) {
- margin-right: 0;
- width: calc(67.4% - 20px);
+
+ @include rwd($break-flow) {
+ width: calc(33.333% - 20px);
}
-
h3 {
margin: 0;
font-weight: bold;
}
}
.l-checkout__payments__box__btn-wrp {
- padding: 20px;
+ padding: 0 20px 20px 20px;
margin-bottom: 0;
margin-top: auto;
+ @include rwd($break-flow) {
+ padding-top: 20px;
+ }
}
p {
margin-top: 0;
outline: 0;
cursor: pointer;
font-weight: 600;
- font-size: 20px;
- line-height: 25px;
+ font-size: 16px;
+ line-height: 24px;
display: flex;
align-items: center;
justify-content: center;
color: #083F4D;
transition: background $ease-out 250ms;
+ @include rwd($break-flow) {
+ font-size: 20px;
+ line-height: 25px;
+ }
+
&:hover {
background: rgba(#92BD39, 0.75);
}
}
&.is-active {
- box-shadow: 0px 0px 20px rgba(55, 170, 156, 0.35);
+ box-shadow: 0px 0px 20px rgba(55, 170, 156, 0.35);
+ background: #083F4D;
+ color: white;
+ @include rwd($break-flow) {
+ background: white;
+ color: black;
+ }
h3 {
color: white;
background: #083F4D;
}
&.l-checkout__payments__box--xl {
- flex-direction: row;
- & > div {
- display: flex;
- &:first-child {
- width: 50%;
- flex-wrap: wrap;
- max-width: 340px;
- margin-right: 20px;
+ width: 100%;
+ @include rwd($break-flow) {
+ width: calc(67.4% - 20px);
+ width: calc(67.4% - 20px);
+ flex-direction: row;
+ & > div {
+ display: flex;
+ &:first-child {
+ width: 50%;
+ flex-wrap: wrap;
+ max-width: 340px;
+ margin-right: 20px;
+ }
+
+ &:last-child {
+ width: 49%;
+ align-items: center;
+ justify-content: center;
+ }
+ }
}
- &:last-child {
- width: 49%;
- align-items: center;
- justify-content: center;
- }
- }
-
h3 {
width: 100%;
}
width: 100%;
}
+ &.once {
+ h3 {
+ text-indent: 0;
+ padding-left: 0;
+ }
+ }
+ }
+ &.l-checkout__payments__box--special {
button {
border-color: #FFA500;
background-color: #FFA500;
background: darken(#FFA500, 5%);
}
}
-
- &.once {
- h3 {
- text-indent: 0;
- padding-left: 0;
- }
- }
}
}
//Amount
.l-checkout__amount {
display: flex;
- align-items: flex-end;
- justify-content: flex-end;
- padding-right: 30px;
+ flex-direction: column;
+ padding: 0 16px;
+ row-gap: 16px;
+ @include rwd($break-flow) {
+ flex-direction: row;
+ align-items: flex-end;
+ justify-content: flex-end;
+ padding-right: 30px;
+ }
+
button {
border: none;
height: 56px;
align-items: center;
justify-content: center;
text-align: center;
- margin-left: 32px;
color: #FFFFFF;
- width: 340px;
+
+ @include rwd($break-flow) {
+ margin-left: 32px;
+ width: 340px;
+ }
+
}
.l-checkout__input {
- width: 340px;
+ @include rwd($break-flow) {
+ width: 340px;
+ }
}
}
//Cols
.l-checkout__cols {
display: flex;
- padding: 0 30px;
+ flex-direction: column;
margin-top: 50px;
+ padding: 0 16px;
+ @include rwd($break-flow) {
+ padding: 0 30px;
+ flex-direction: row;
+ }
+
&.bt-w {
margin-top: 30px;
padding-top: 20px;
}
.l-checkout__col {
+ @include rwd($break-flow) {
&:nth-child(1) {
width: 402px;
padding-right: 62px;
}
}
}
+ }
}
-.l-checkout__footer__img {
- display: flex;
- margin-right: 30px;
- margin-left: auto;
- margin-top: 30px;
+.l-checkout__secure {
+ margin-top: 30px;
+ margin-right: 30px;
+ text-align: right;
+ font-size: 15px;
+ color: #888;
+
+ .l-checkout__secure__padlock {
+ margin-right: 5px;
+ vertical-align: baseline;
+ }
+
+ .l-checkout__secure__img {
+ margin-left: 10px;
+ vertical-align: bottom;
+ }
}
+
//Form
.l-checkout__form {
display: flex;
flex-wrap: wrap;
margin-top: 12px;
margin-bottom: 52px;
+ margin-left: 16px;
+ margin-right: 16px;
}
.l-checkout__footer > img {
.l-checkout__footer__content__item {
display: flex;
+ flex-direction: column;
+ @include rwd($break-flow) {
+ flex-direction: row;
+ }
+
&:not(:last-child) {
padding-bottom: 30px;
margin-bottom: 30px;
}
.l-checkout__footer__content h3 {
+ @include rwd($break-flow) {
font-weight: 600;
font-size: 21.5px;
line-height: 140%;
letter-spacing: -0.01em;
color: #083F4D;
width: 318px;
+ }
}
.l-checkout__footer__content__item > div {
+ @include rwd($break-flow) {
width: 100%;
padding-left: 120px;
+ }
}
.l-checkout__footer__content__item > div p {
}
}
}
+
+
+.payments-recurring {
+ .l-checkout__payments__box {
+ width: 100%;
+ &.is-active {
+ background: white;
+ color: black;
+ }
+ @include rwd($break-flow) {
+ width: calc(33.333% - 20px);
+ //margin-right: 30px;
+ }
+ }
+}
max-width: 1140px;
border-radius: 10px;
padding: 10px 50px;
- width: 100%;
- margin-bottom: 10px;
+ width: auto;
+
+ margin-top: 18px;
+ margin-bottom: 18px;
background-color: #FBC40F;
position: relative;
display: none;
+ margin-left: 16px;
+ margin-right: 16px;
+ flex-direction: column;
+ column-gap: 48px;
+
+ @include rwd($break-flow) {
+ flex-direction: row;
+ }
+
&.show {
display: flex;
}
line-height: 100%;
letter-spacing: -0.02em;
color: #333333;
- margin: 0;
+ margin: 20px 0;
min-width: 189px;
- margin-right: 48px;
}
p {
$red: #FF4C54;
-.l-change-pop {
- transition: 350ms all;
-
- p {
- a {
- color: $teal;
- }
- }
-}
-
-
-.is-open .l-change-pop {
- height: 0;
- margin-top: 0;
- margin-bottom: 0;
- padding-top: 0;
- padding-bottom: 0;
-}
-
-
.ui-autocomplete a {
display: block;
transition: none;
padding: 5px 10px;
margin-left: 5px;
border-radius: 15px;
+ white-space: nowrap;
a {
color: currentColor;
</div>
{% endif %}
- <div class="l-container l-change-pop">
- <h3>Przekaż 1,5%</h3>
- <p>
- Przekaż 1,5% podatku na Wolne Lektury KRS 00000 70056<br>
- Ufunduj darmowe książki dla tysięcy dzieciaków.<br>
- <a href="/info/wesprzyj-nas/">WIĘCEJ</a>
- </p>
- <!-- button class="l-change-pop__close">
- <i class="icon icon-close"></i>
- </button -->
- </div>
-
{% block global-content %}
<div class="l-container">
<div class="l-breadcrumb">
</main>
{% endblock %}
- <div class="l-container l-change-pop">
+ <div class="l-main">
+ <div class="l-change-pop">
<h3>Zmieniamy się!</h3>
<p>
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ę – <a href='/formularz/ux-strona-ksiazki-T1/' target="_blank">możesz nam ją przesłać tutaj</a>.
Jeżeli wolisz klasyczny wygląd - wystarczy, że <a class="quit-experiment" href="#">klikniesz tutaj</a>
</p>
- <!-- button class="l-change-pop__close">
- <i class="icon icon-close"></i>
- </button -->
+ </div>
</div>
<section class="l-section">
- <div class="l-collections js-new-books-slider">
+ <div class="l-collections js-collections">
<div class="l-collections__header">
<h3><a href="/katalog/nowe/">Nowości</a></h3>
<div class="l-your-books__header__actions">
<button class="js-next-slide"><i class="icon icon-arrow-right"></i></button>
</div>
</div>
- <div class="l-books">
+ <div class="l-books" style="display:block;">
{% for book in last_published %}
{% include 'catalogue/2022/book_box.html' %}
{% endfor %}
{% load honeypot %}
{% load more %}
+{% load i18n %}
<h1>{{ form.title }}</h1>
{{ form.intro|first_part:"---"|safe }}
</div>
+ {% if form_published %}
{% if request.EXPERIMENTS.layout.value %}
{{ form_for_form.as_p }}
{% if form_for_form.fields %}
{% endif %}
</table>
{% endif %}
+ {% else %}
+ <p class="l-change-pop show">FORMULARZ ZAMKNIĘTY</p>
+ {% endif %}
<div class="form-info" style="margin-top:2em;">