fnp
/
wolnelektury.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
12db7e7
)
More donation form fixes.
master
author
Radek Czajka
<rczajka@rczajka.pl>
Wed, 3 Dec 2025 14:21:42 +0000
(15:21 +0100)
committer
Radek Czajka
<rczajka@rczajka.pl>
Wed, 3 Dec 2025 14:21:42 +0000
(15:21 +0100)
src/club/templates/club/donation_infobox.html
patch
|
blob
|
history
src/club/templates/club/donation_step3.html
patch
|
blob
|
history
src/club/views.py
patch
|
blob
|
history
src/wolnelektury/static/js/main.js
patch
|
blob
|
history
diff --git
a/src/club/templates/club/donation_infobox.html
b/src/club/templates/club/donation_infobox.html
index
6008f07
..
cdbd67e
100644
(file)
--- a/
src/club/templates/club/donation_infobox.html
+++ b/
src/club/templates/club/donation_infobox.html
@@
-1,8
+1,10
@@
<div class="checkout-infobar" style="background: yellow; padding:20px; border: 1px solid yellow; border-radius: 10px; margin: 0 0 20px;">
<div class="if-monthly">
<div class="checkout-infobar" style="background: yellow; padding:20px; border: 1px solid yellow; border-radius: 10px; margin: 0 0 20px;">
<div class="if-monthly">
- Dziękujemy za wybranie comiesięcznej wpłaty.
+ Dziękujemy, że decydujesz się wspierać nas co miesiąc.<br/>
+ Jeśli to pomyłka, możesz zmienić darowiznę na <a class="donation-mod-monthly" data-url="{% url 'donation_set_monthly' schedule.key %}" data-monthly="false" href="{% url 'donation_step1' schedule.key %}">jednorazową</a>.
</div>
<div class="if-not-monthly">
</div>
<div class="if-not-monthly">
- Czy na pewno nie comiesięczna? <a class="donation-mod-monthly" data-url="{% url 'donation_set_monthly' schedule.key %}" href="{% url 'donation_step1' schedule.key %}">Zmień na comiesięczną wpłatę.</a>
+ Wolę wspierać co miesiąc!
+ <a class="donation-mod-monthly" data-url="{% url 'donation_set_monthly' schedule.key %}" data-monthly="true" href="{% url 'donation_step1' schedule.key %}">Zmień na comiesięczną wpłatę.</a>
</div>
</div>
</div>
</div>
diff --git
a/src/club/templates/club/donation_step3.html
b/src/club/templates/club/donation_step3.html
index
c9b615b
..
999c708
100644
(file)
--- a/
src/club/templates/club/donation_step3.html
+++ b/
src/club/templates/club/donation_step3.html
@@
-25,7
+25,7
@@
{% include "club/donation_infobox.html" %}
{% if schedule.monthly %}
{% include "club/donation_infobox.html" %}
{% if schedule.monthly %}
- <h3>
Comiesięczna darowizna będzie pobierana automatycznie
</h3>
+ <h3>
Darowizna będzie pobierana automatycznie co miesiąc.
</h3>
<p>Możesz z niej zrezygnować w dowolnej chwili, korzystając z linku który dostaniesz mailem.</p>
{% endif %}
<p>Możesz z niej zrezygnować w dowolnej chwili, korzystając z linku który dostaniesz mailem.</p>
{% endif %}
diff --git
a/src/club/views.py
b/src/club/views.py
index
679e575
..
503a431
100644
(file)
--- a/
src/club/views.py
+++ b/
src/club/views.py
@@
-64,7
+64,7
@@
class DonationStep2(UpdateView):
def set_monthly(request, key):
schedule = get_object_or_404(models.Schedule, payed_at=None, key=key)
if request.POST:
def set_monthly(request, key):
schedule = get_object_or_404(models.Schedule, payed_at=None, key=key)
if request.POST:
- schedule.monthly =
True
+ schedule.monthly =
request.POST.get('monthly') == 'true'
schedule.save(update_fields=['monthly'])
return JsonResponse({
"amount": schedule.amount,
schedule.save(update_fields=['monthly'])
return JsonResponse({
"amount": schedule.amount,
diff --git
a/src/wolnelektury/static/js/main.js
b/src/wolnelektury/static/js/main.js
index
076277e
..
9821c77
100644
(file)
--- a/
src/wolnelektury/static/js/main.js
+++ b/
src/wolnelektury/static/js/main.js
@@
-354,6
+354,7
@@
method: 'POST',
data: {
csrfmiddlewaretoken: $("[name=csrfmiddlewaretoken]").val(),
method: 'POST',
data: {
csrfmiddlewaretoken: $("[name=csrfmiddlewaretoken]").val(),
+ monthly: $(this).data('monthly'),
},
url: $(this).data('url'),
success: function(data) {
},
url: $(this).data('url'),
success: function(data) {