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 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 %}