diff --git a/apps/school/templates/blocks/_schedule_purchased_item.html b/apps/school/templates/blocks/_schedule_purchased_item.html new file mode 100644 index 00000000..5c9bb6f1 --- /dev/null +++ b/apps/school/templates/blocks/_schedule_purchased_item.html @@ -0,0 +1,75 @@ +{% load static %} {% load thumbnail %} +
+
+ {% if school_schedule.is_purchased %} +
+
+ {{ school_schedule }} +
+ {% if live_lesson %} +
{{ live_lesson.date }}
+ {% endif %} +
+
+
{{ school_schedule.start_at }} (МСК)
+ {% if live_lesson %} + {% include './open_lesson.html' %} + {% endif %} +
+ {% else %} + {% include './pay_btn.html' %} + {% endif %} +
+
+
+ {% thumbnail live_lesson.cover.image "70x70" crop="center" as im %} + + {% empty %} + + {% endthumbnail %} +
+
+
+
{{ school_schedule.title }}{% if live_lesson %}, + {{ live_lesson.title }} + {% endif %} +
+ {% if live_lesson %} +
{{ live_lesson.short_description }}
+ {% endif %} +
+
Материалы
+
+
+
+

{{ school_schedule.description }}

+
+
+
+
+ {{ school_schedule.materials }} +
+
+
+ {% if school_schedule.schoolschedule_images.exists %} +
Результаты прошлых уроков
+
+ {% for image in school_schedule.schoolschedule_images.all %} + + {% thumbnail image.img.image "48x48" crop="center" as im %} + + {% endthumbnail %} + + {% endfor %} +
+ {% endif %} +
+
+
+ +
+
diff --git a/apps/school/templates/blocks/open_lesson.html b/apps/school/templates/blocks/open_lesson.html index 35250658..0bcf435f 100644 --- a/apps/school/templates/blocks/open_lesson.html +++ b/apps/school/templates/blocks/open_lesson.html @@ -1,4 +1,4 @@ смотреть урок diff --git a/apps/school/templates/blocks/schedule_purchased.html b/apps/school/templates/blocks/schedule_purchased.html index e22e6b57..e17a3d61 100644 --- a/apps/school/templates/blocks/schedule_purchased.html +++ b/apps/school/templates/blocks/schedule_purchased.html @@ -21,92 +21,20 @@
Новые уроки
{% for school_schedule in school_schedules %} - {% with current_live_lesson=school_schedule.current_live_lesson %} -
-
- {% if school_schedule.is_purchased %} -
-
- {{ school_schedule }} -
- {% if current_live_lesson %} -
{{ current_live_lesson.date }}
- {% endif %} -
-
-
{{ school_schedule.start_at }} (МСК)
- {% if current_live_lesson %} - {% include './open_lesson.html' %} - {% endif %} -
- {% else %} - {% include './pay_btn.html' %} - {% endif %} -
-
-
- {% thumbnail current_live_lesson.cover.image "70x70" crop="center" as im %} - - {% empty %} - - {% endthumbnail %} -
-
-
-
{{ school_schedule.title }}{% if current_live_lesson %}, - {{ current_live_lesson.title }} - {% endif %} -
- {% if current_live_lesson %} -
{{ current_live_lesson.short_description }}
- {% endif %} -
-
Материалы
-
-
-
-

{{ school_schedule.description }}

-
-
-
-
- {{ school_schedule.materials }} -
-
-
- {% if school_schedule.schoolschedule_images.exists %} -
Результаты прошлых уроков
-
- {% for image in school_schedule.schoolschedule_images.all %} - - {% thumbnail image.img.image "48x48" crop="center" as im %} - - {% endthumbnail %} - - {% endfor %} -
- {% endif %} -
-
-
- -
-
- {% endwith %} + {% if is_previous %} + {% include './_schedule_purchased_item.html' with school_schedule=school_schedule live_lesson=school_schedule.previous_live_lesson %} + {% else %} + {% include './_schedule_purchased_item.html' with school_schedule=school_schedule live_lesson=school_schedule.current_live_lesson %} + {% endif %} {% endfor %}
diff --git a/apps/school/views.py b/apps/school/views.py index 93e9493d..3cb8b707 100644 --- a/apps/school/views.py +++ b/apps/school/views.py @@ -76,10 +76,12 @@ class SchoolView(TemplateView): def get_context_data(self): context = super().get_context_data() + is_previous = 'is_previous' in self.request.GET date_now = now().date() school_payment = SchoolPayment.objects.filter(date_start__lte=date_now, date_end__gte=date_now) school_payment_exists = school_payment.exists() context.update({ + 'is_previous': is_previous, 'course_items': Course.objects.filter(status=Course.PUBLISHED)[:6], 'is_purchased': school_payment_exists, 'min_school_price': SchoolSchedule.objects.aggregate(Min('month_price'))['month_price__min'], diff --git a/web/src/sass/_common.sass b/web/src/sass/_common.sass index 9ce1eb14..73a5108c 100755 --- a/web/src/sass/_common.sass +++ b/web/src/sass/_common.sass @@ -3836,11 +3836,11 @@ a.grey-link top: 0 left: 0 opacity: 0 - &__input:checked + &__wrap &__item - &:first-child - background: #f8f8f8 - &:last-child - background: transparent + // &__input:checked + &__wrap &__item + // &:first-child + // background: #f8f8f8 + // &:last-child + // background: transparent &__wrap display: flex background: linear-gradient(to right, #cdff82, #5efff4) @@ -3849,13 +3849,17 @@ a.grey-link &__item padding: 11px 20px border-radius: 23px + color: black +fb font-size: 12px text-transform: uppercase user-select: none cursor: pointer - &:last-child + &.active background: #f8f8f8 + // &:last-child + // background: #f8f8f8 + .casing display: flex