From d47a09bf9e1a75ed2ceb201eddd978fc0a47eeba Mon Sep 17 00:00:00 2001 From: Ivlev Denis Date: Fri, 11 May 2018 12:21:04 +0300 Subject: [PATCH 1/2] Update school buy popup --- project/templates/blocks/popup_buy.html | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/project/templates/blocks/popup_buy.html b/project/templates/blocks/popup_buy.html index 1b87695f..f35c3474 100644 --- a/project/templates/blocks/popup_buy.html +++ b/project/templates/blocks/popup_buy.html @@ -20,6 +20,28 @@
+ {% if all_school_schedules %} + {% for school_schedule in all_school_schedules %} + + {% endfor %} + {% else %} {% for school_schedule in school_schedules %} {% endfor %} + {% endif %}
From 02b3e9572d2fa061d37fb8c6c40aca6e0942d3e4 Mon Sep 17 00:00:00 2001 From: Ivlev Denis Date: Fri, 11 May 2018 12:21:32 +0300 Subject: [PATCH 2/2] Add messages to empty user profile tabs --- apps/user/templates/user/profile.html | 41 +++++++++++++++++++++++++++ apps/user/views.py | 1 + 2 files changed, 42 insertions(+) diff --git a/apps/user/templates/user/profile.html b/apps/user/templates/user/profile.html index 3f5203b6..db42b502 100644 --- a/apps/user/templates/user/profile.html +++ b/apps/user/templates/user/profile.html @@ -75,12 +75,42 @@
+ {% if is_purchased %} {% include "blocks/schedule_purchased.html" %} + {% else %} +
+
+
Вы не подписаны на школу!
+ +
+
+ {% endif %}
+ {% if paid.exists %} {% include "course/course_items.html" with course_items=paid %} + {% else %} +
+
+
Нет приобретённых курсов!
+ +
+
+ {% endif %}
@@ -88,7 +118,18 @@
+ {% if published.exists %} {% include "course/course_items.html" with course_items=published %} + {% else %} +
+
+
Нет опубликованных курсов!
+ +
+
+ {% endif %}
diff --git a/apps/user/views.py b/apps/user/views.py index 8bdc6824..5af22e43 100644 --- a/apps/user/views.py +++ b/apps/user/views.py @@ -89,6 +89,7 @@ class UserView(DetailView): calk=F('weekday') - now().isoweekday(), weight=(7 + F('calk') % 7) % 7, ).order_by('weight') + context['all_school_schedules'] = SchoolSchedule.objects.all() return context