diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3a25f056..3d4ff10c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -35,8 +35,6 @@ deploy_review: - review only: - branches - except: - - master stop-review: stage: stop @@ -51,8 +49,6 @@ stop-review: when: manual only: - branches - except: - - master tags: - review @@ -66,7 +62,5 @@ prod-db: when: manual only: - branches - except: - - master tags: - review diff --git a/apps/school/models.py b/apps/school/models.py index ead3f30a..24ce0590 100644 --- a/apps/school/models.py +++ b/apps/school/models.py @@ -44,7 +44,7 @@ class SchoolSchedule(models.Model): return dict(self.WEEKDAY_CHOICES).get(self.weekday, '') def is_online(self): - end_at = datetime.combine(now().today(), self.start_at) + timedelta(hours=2) + end_at = datetime.combine(now().today(), self.start_at) + timedelta(hours=1) return self.start_at <= now().time() and end_at.time() >= now().time() and self.weekday == now().isoweekday() def current_live_lesson(self): @@ -132,5 +132,5 @@ class LiveLesson(BaseModel, DeactivatedMixin): return False else: start_at = school_schedule.start_at - end_at = datetime.combine(now().today(), start_at) + timedelta(hours=2) + end_at = datetime.combine(now().today(), start_at) + timedelta(hours=1) return start_at <= now().time() and end_at.time() >= now().time() diff --git a/apps/school/templates/blocks/_schedule_purchased_item.html b/apps/school/templates/blocks/_schedule_purchased_item.html index 416a4f4f..b9d1db1f 100644 --- a/apps/school/templates/blocks/_schedule_purchased_item.html +++ b/apps/school/templates/blocks/_schedule_purchased_item.html @@ -6,15 +6,17 @@ {{ school_schedule }} {% if live_lesson %} - +
{{ live_lesson.date }}
{% endif %}
{{ school_schedule.start_at }} (МСК)
- {% if school_schedule.weekday in school_schedules_purchased and live_lesson %} - {% include './open_lesson.html' %} + {% if school_schedule.weekday in school_schedules_purchased %} + {% if live_lesson and live_lesson.title %} + {% include './open_lesson.html' %} + {% endif %} {% else %} - {% include './day_pay_btn.html' %} + {% include './day_pay_btn.html' %} {% endif %}
{% comment %} @@ -34,12 +36,12 @@
-
{{ school_schedule.title }}{% if live_lesson %}, +
{{ school_schedule.title }}{% if live_lesson and live_lesson.title %}, {{ live_lesson.title }} {% endif %}
- {% if live_lesson %} + {% if live_lesson and live_lesson.short_description %} {{ live_lesson.short_description }} {% else %} {{ school_schedule.description }} diff --git a/apps/school/templates/school/livelesson_detail.html b/apps/school/templates/school/livelesson_detail.html index 92ca42e1..1bcb3227 100644 --- a/apps/school/templates/school/livelesson_detail.html +++ b/apps/school/templates/school/livelesson_detail.html @@ -10,7 +10,7 @@
{{ livelesson.short_description }}
{% if livelesson.stream_index %} - Если видео не загрузилось обновите страницу diff --git a/apps/school/templates/summer/_schedule_purchased_item.html b/apps/school/templates/summer/_schedule_purchased_item.html index 416a4f4f..b9d1db1f 100644 --- a/apps/school/templates/summer/_schedule_purchased_item.html +++ b/apps/school/templates/summer/_schedule_purchased_item.html @@ -6,15 +6,17 @@ {{ school_schedule }}
{% if live_lesson %} - +
{{ live_lesson.date }}
{% endif %}
{{ school_schedule.start_at }} (МСК)
- {% if school_schedule.weekday in school_schedules_purchased and live_lesson %} - {% include './open_lesson.html' %} + {% if school_schedule.weekday in school_schedules_purchased %} + {% if live_lesson and live_lesson.title %} + {% include './open_lesson.html' %} + {% endif %} {% else %} - {% include './day_pay_btn.html' %} + {% include './day_pay_btn.html' %} {% endif %}
{% comment %} @@ -34,12 +36,12 @@
-
{{ school_schedule.title }}{% if live_lesson %}, +
{{ school_schedule.title }}{% if live_lesson and live_lesson.title %}, {{ live_lesson.title }} {% endif %}
- {% if live_lesson %} + {% if live_lesson and live_lesson.short_description %} {{ live_lesson.short_description }} {% else %} {{ school_schedule.description }} diff --git a/apps/school/views.py b/apps/school/views.py index ae9b64f0..7f4ab734 100644 --- a/apps/school/views.py +++ b/apps/school/views.py @@ -61,26 +61,26 @@ class LiveLessonsDetailView(DetailView): def get(self, request, pk=None): response = super().get(request, pk=pk) - try: - school_payment = SchoolPayment.objects.get( - user=request.user, - add_days=False, - date_start__lte=now(), - date_end__gte=now(), - status__in=[ - Pingback.PINGBACK_TYPE_REGULAR, - Pingback.PINGBACK_TYPE_GOODWILL, - Pingback.PINGBACK_TYPE_RISK_REVIEWED_ACCEPTED, - ], - ) - except SchoolPayment.DoesNotExist: - school_payment = None - if request.user.role not in [User.ADMIN_ROLE, User.TEACHER_ROLE] and not ( - request.user.role == User.USER_ROLE and - school_payment and - school_payment.is_deliverable() - ): - raise Http404 + #try: + # school_payment = SchoolPayment.objects.get( + # user=request.user, + # add_days=False, + # date_start__lte=now(), + # date_end__gte=now(), + # status__in=[ + # Pingback.PINGBACK_TYPE_REGULAR, + # Pingback.PINGBACK_TYPE_GOODWILL, + # Pingback.PINGBACK_TYPE_RISK_REVIEWED_ACCEPTED, + # ], + # ) + #except SchoolPayment.DoesNotExist: + # school_payment = None + #if request.user.role not in [User.ADMIN_ROLE, User.TEACHER_ROLE] and not ( + # request.user.role == User.USER_ROLE and + # school_payment and + # school_payment.is_deliverable() + #): + # raise Http404 return response @@ -122,7 +122,7 @@ class SchoolView(TemplateView): end_at = datetime.combine(now_time.today(), school_schedule.start_at) online = ( school_schedule.start_at <= now_time.time() and - (end_at + timedelta(hours=2)).time() >= now_time.time() and + (end_at + timedelta(hours=1)).time() >= now_time.time() and school_schedule.current_live_lesson() ) if self.request.user.is_authenticated: @@ -183,7 +183,7 @@ class SummerSchoolView(TemplateView): end_at = datetime.combine(now_time.today(), school_schedule.start_at) online = ( school_schedule.start_at <= now_time.time() and - (end_at + timedelta(hours=2)).time() >= now_time.time() and + (end_at + timedelta(hours=1)).time() >= now_time.time() and school_schedule.current_live_lesson() ) if self.request.user.is_authenticated: diff --git a/project/templates/blocks/about.html b/project/templates/blocks/about.html index 4caf08de..8deec906 100644 --- a/project/templates/blocks/about.html +++ b/project/templates/blocks/about.html @@ -44,21 +44,19 @@
- - {% if not is_purchased and not is_purchased_future %}купить доступ от {{ min_school_price }} руб./месяц{% endif %} - {% if is_purchased_future and not is_purchased %}ваша подписка начинается {{school_purchased_future.date_start}}{% endif %} - {% if is_purchased %}ваша подписка истекает {{ subscription_ends_humanize }}
перейти к оплате{% endif %} -
+ > + купить доступ от {{ min_school_price }} руб./месяц + + {% endif %}
diff --git a/project/templates/blocks/promo.html b/project/templates/blocks/promo.html index ba61ac8e..74d66932 100644 --- a/project/templates/blocks/promo.html +++ b/project/templates/blocks/promo.html @@ -12,11 +12,11 @@ Lil School — первая образовательная онлайн-платформа креативного мышления для детей
- Урок Рисовальный лагерь, Альбрехт Дюрер начнется завтра в 17:00 + Урок Рисовальный лагерь, Поль Синьяк пройдет сегодня в 17:00
{% if is_purchased %} - Перейти в урок + Перейти в урок {% else %} {% comment %} ROISTAT {% endcomment %} {% block foot %}{% endblock foot %} diff --git a/project/views.py b/project/views.py index 61e62c90..6e4eca8d 100644 --- a/project/views.py +++ b/project/views.py @@ -31,7 +31,7 @@ class IndexView(TemplateView): end_at = datetime.combine(now_time.today(), school_schedule.start_at) online = ( school_schedule.start_at <= now_time.time() and - (end_at + timedelta(hours=2)).time() >= now_time.time() and + (end_at + timedelta(hours=1)).time() >= now_time.time() and school_schedule.current_live_lesson() ) date_now = now_time.date()