diff --git a/apps/payment/views.py b/apps/payment/views.py
index 846b5a4a..8b1c2544 100644
--- a/apps/payment/views.py
+++ b/apps/payment/views.py
@@ -98,16 +98,17 @@ class SchoolBuyView(TemplateView):
host = urlsplit(self.request.META.get('HTTP_REFERER'))
host = str(host[0]) + '://' + str(host[1])
weekdays = set(request.GET.getlist('weekdays', []))
+ use_bonuses = request.GET.get('use_bonuses')
add_days = 'add_days' in request.GET
roistat_visit = request.COOKIES.get('roistat_visit', None)
if not weekdays:
messages.error(request, 'Выберите несколько дней недели.')
- return redirect('school:summer-school')
+ return redirect('school:school')
try:
weekdays = [int(weekday) for weekday in weekdays]
except ValueError:
messages.error(request, 'Ошибка выбора дней недели.')
- return redirect('school:summer-school')
+ return redirect('school:school')
if add_days:
_school_payment = SchoolPayment.objects.filter(
user=request.user,
@@ -128,7 +129,7 @@ class SchoolBuyView(TemplateView):
)
if school_payment.amount <= 0:
messages.error(request, 'Выбранные дни отсутствуют в оставшемся периоде подписки')
- return redirect(reverse_lazy('school:summer-school'))
+ return redirect(reverse_lazy('school:school'))
else:
school_payment = SchoolPayment.objects.create(
user=request.user,
diff --git a/apps/user/templates/blocks/profile-menu.html b/apps/user/templates/blocks/profile-menu.html
index 35c4df2d..9db83d44 100644
--- a/apps/user/templates/blocks/profile-menu.html
+++ b/apps/user/templates/blocks/profile-menu.html
@@ -1,9 +1,14 @@
diff --git a/apps/user/templates/user/bonus-history.html b/apps/user/templates/user/bonus-history.html
index 43e45fbd..b5461970 100644
--- a/apps/user/templates/user/bonus-history.html
+++ b/apps/user/templates/user/bonus-history.html
@@ -3,7 +3,7 @@
{% load rupluralize from plural %}
{% block content %}
-{% include "../blocks/profile-menu.html" %}
+{% include "../blocks/profile-menu.html" with active="bonuses" %}
@@ -37,11 +37,7 @@
Школа. {% if payment.date_start and payment.date_end %}{{ payment.date_start }} - {{ payment.date_end }}{% endif %}
{% endif %}
- {% if payment.balance %}
-
{{payment.balance.amount}}
- {% else %}
-
{{payment.amount|floatformat }}
- {% endif %}
+
{{payment.amount }}
{% if bonus.referral %}
{% endif %}
diff --git a/apps/user/templates/user/notification-settings.html b/apps/user/templates/user/notification-settings.html
index 725922bd..b73bb35d 100644
--- a/apps/user/templates/user/notification-settings.html
+++ b/apps/user/templates/user/notification-settings.html
@@ -1,5 +1,5 @@
{% extends "templates/lilcity/index.html" %} {% load static %} {% block content %}
-{% include "../blocks/profile-menu.html" %}
+{% include "../blocks/profile-menu.html" with active="notifications" %}
{% if not user.is_email_proved %}
diff --git a/apps/user/templates/user/payment-history.html b/apps/user/templates/user/payment-history.html
index 798ffb2b..8b7d332c 100644
--- a/apps/user/templates/user/payment-history.html
+++ b/apps/user/templates/user/payment-history.html
@@ -1,5 +1,5 @@
{% extends "templates/lilcity/index.html" %} {% load static %} {% block content %}
-{% include "../blocks/profile-menu.html" %}
+{% include "../blocks/profile-menu.html" with active="payments" %}
{% if not user.is_email_proved %}
diff --git a/apps/user/templates/user/profile-settings.html b/apps/user/templates/user/profile-settings.html
index 1d0619cf..08e56da8 100644
--- a/apps/user/templates/user/profile-settings.html
+++ b/apps/user/templates/user/profile-settings.html
@@ -1,5 +1,5 @@
{% extends "templates/lilcity/index.html" %} {% load static %} {% load thumbnail %} {% block content %}
-{% include "../blocks/profile-menu.html" %}
+{% include "../blocks/profile-menu.html" with active="profile" %}
{% if not user.is_email_proved %}
diff --git a/apps/user/views.py b/apps/user/views.py
index 7ff653b5..ee027821 100644
--- a/apps/user/views.py
+++ b/apps/user/views.py
@@ -158,7 +158,7 @@ class NotificationEditView(TemplateView):
request.user.email_subscription.categories.set(
SubscriptionCategory.objects.filter(id__in=categories)
)
- return redirect('user-edit-notifications', request.user.id)
+ return redirect('user-edit-notifications')
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
@@ -195,7 +195,7 @@ class PaymentHistoryView(FormView):
return self.form_invalid(form)
def get_success_url(self):
- success_url = reverse_lazy('user-edit-payments', args=[self.request.user.id])
+ success_url = reverse_lazy('user-edit-payments')
return success_url
diff --git a/project/templates/blocks/popup_buy.html b/project/templates/blocks/popup_buy.html
index 0321b2ea..cf21ff64 100644
--- a/project/templates/blocks/popup_buy.html
+++ b/project/templates/blocks/popup_buy.html
@@ -88,11 +88,19 @@
ШКОЛА
-
Вторник, Четверг, Воскресенье
+
+ {% if request.user.bonuses %}
+
+ {% endif %}
diff --git a/project/templates/blocks/user_menu.html b/project/templates/blocks/user_menu.html
index 1e20df2d..a1fdbca8 100644
--- a/project/templates/blocks/user_menu.html
+++ b/project/templates/blocks/user_menu.html
@@ -12,7 +12,7 @@