Merge branch 'hotfix/LIL-622' into 'master'

Hotfix/lil 622

See merge request lilcity/backend!117
remotes/origin/hotfix/LIL-661
cfwme 8 years ago
commit f23929572c
  1. 17
      apps/payment/views.py
  2. 10
      apps/school/models.py
  3. 2
      apps/school/templates/blocks/online.html
  4. 2
      apps/school/templates/blocks/promo.html
  5. 2
      apps/school/templates/blocks/schedule_item.html
  6. 2
      apps/school/templates/school/livelessons_list.html
  7. 4
      apps/school/templates/summer/online.html
  8. 6
      apps/school/templates/summer/promo.html
  9. 6
      apps/school/templates/summer/schedule_purchased.html
  10. 3
      apps/school/urls.py
  11. 89
      apps/school/views.py
  12. 8
      apps/user/templates/user/profile.html
  13. 6
      project/templates/blocks/about.html
  14. 1
      project/templates/blocks/footer.html
  15. 11
      project/templates/blocks/header.html
  16. 2
      project/templates/blocks/last_courses.html
  17. 4
      project/templates/blocks/live.html
  18. 2
      project/templates/blocks/promo.html
  19. 4
      project/views.py

@ -109,12 +109,15 @@ class SchoolBuyView(TemplateView):
messages.error(request, 'Ошибка выбора дней недели.') messages.error(request, 'Ошибка выбора дней недели.')
return redirect('school:summer-school') return redirect('school:summer-school')
if add_days: if add_days:
_school_payment = SchoolPayment.objects.get( _school_payment = SchoolPayment.objects.filter(
user=request.user, user=request.user,
date_start__lte=now().date(), date_start__lte=now().date(),
date_end__gte=now().date(), date_end__gte=now().date(),
add_days=False, add_days=False,
) ).first()
if not _school_payment:
add_days = False
if add_days:
school_payment = SchoolPayment.objects.create( school_payment = SchoolPayment.objects.create(
user=request.user, user=request.user,
weekdays=weekdays, weekdays=weekdays,
@ -175,6 +178,7 @@ class PaymentwallCallbackView(View):
def get(self, request, *args, **kwargs): def get(self, request, *args, **kwargs):
payment_raw_data = request.GET.copy() payment_raw_data = request.GET.copy()
pingback = Pingback(payment_raw_data, self.get_request_ip()) pingback = Pingback(payment_raw_data, self.get_request_ip())
september2018 = datetime.date(2018, 9, 1)
if pingback.validate(): if pingback.validate():
product_type_name, payment_id = pingback.get_product().get_id().split('_') product_type_name, payment_id = pingback.get_product().get_id().split('_')
@ -223,16 +227,15 @@ class PaymentwallCallbackView(View):
).last() ).last()
if school_payment: if school_payment:
if payment.add_days: if payment.add_days:
date_start = self.add_months(sourcedate=now().replace(hour=0, minute=0, day=1), months=1) date_start = now().date()
date_end = school_payment.date_end date_end = school_payment.date_end
else: else:
date_start = arrow.get(school_payment.date_end, settings.TIME_ZONE).shift(days=1).datetime date_start = arrow.get(school_payment.date_end, settings.TIME_ZONE).shift(days=1).datetime
date_end = arrow.get(date_start, settings.TIME_ZONE).shift(months=1).datetime date_end = arrow.get(date_start, settings.TIME_ZONE).shift(months=1).datetime
else: else:
#month = 0 if now().day >= 1 and now().day <= 10 else 1 date_start = now().date()
# Логика июльского лагеря: до конца июля приобретаем только на текущий месяц if date_start < september2018:
month = 0 date_start = september2018
date_start = self.add_months(sourcedate=now().replace(hour=0, minute=0, day=1), months=month)
date_end = arrow.get(date_start, settings.TIME_ZONE).shift(months=1, minutes=-1).datetime date_end = arrow.get(date_start, settings.TIME_ZONE).shift(months=1, minutes=-1).datetime
payment.date_start = date_start payment.date_start = date_start
payment.date_end = date_end payment.date_end = date_end

@ -1,9 +1,10 @@
import arrow import arrow
from datetime import datetime, timedelta from datetime import datetime, timedelta, date
from django.conf import settings from django.conf import settings
from django.db import models from django.db import models
from django.urls import reverse_lazy from django.urls import reverse_lazy
from django.utils.functional import cached_property
from django.utils.timezone import now from django.utils.timezone import now
from project.mixins import BaseModel, DeactivatedMixin from project.mixins import BaseModel, DeactivatedMixin
@ -50,15 +51,18 @@ class SchoolSchedule(models.Model):
end_at = datetime.combine(now().today(), self.start_at) + timedelta(hours=1) 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() return self.start_at <= now().time() and end_at.time() >= now().time() and self.weekday == now().isoweekday()
@cached_property
def current_live_lesson(self): def current_live_lesson(self):
now_time = now() september2018 = date(2018, 9, 1)
date_start = max(september2018, now().date())
live_lesson = LiveLesson.objects.filter( live_lesson = LiveLesson.objects.filter(
date__week_day=self.weekday % 7 + 1, date__week_day=self.weekday % 7 + 1,
date__range=[now_time.date(), (now_time + timedelta(days=6)).date()], date__range=[date_start, date_start + timedelta(days=6)],
deactivated_at__isnull=True, deactivated_at__isnull=True,
).first() ).first()
return live_lesson return live_lesson
@cached_property
def previous_live_lesson(self): def previous_live_lesson(self):
now_time = now() now_time = now()
live_lesson = LiveLesson.objects.filter( live_lesson = LiveLesson.objects.filter(

@ -1,7 +1,7 @@
{% load static %} {% load static %}
<a class="online" target="_blank" href="https://www.youtube.com/watch?v=PhZ8qQbIej0" style="background-image: url({% static 'img/video-1.jpg' %});"> <a class="online" target="_blank" href="https://www.youtube.com/watch?v=PhZ8qQbIej0" style="background-image: url({% static 'img/video-1.jpg' %});">
<div class="online__center center"> <div class="online__center center">
<div class="online__type">ПРЯМОЙ ЭФИР</div> <div class="online__type">ВИДЕОУРОКИ</div>
<div class="online__title">Каждый день в 17.00 (по Мск) </div> <div class="online__title">Каждый день в 17.00 (по Мск) </div>
<div class="online__text text">Кроме выходных. Запись эфира доступна по завершению трансляции</div> <div class="online__text text">Кроме выходных. Запись эфира доступна по завершению трансляции</div>
<div class="online__action"> <div class="online__action">

@ -17,7 +17,7 @@
<use xlink:href="{% static 'img/sprite.svg' %}#icon-online"></use> <use xlink:href="{% static 'img/sprite.svg' %}#icon-online"></use>
</svg> </svg>
</div> </div>
<div class="school__title">Прямой эфир</div> <div class="school__title">Видеоуроки</div>
<div class="school__text">С понедельника по&nbsp;пятницу кроме выходных</div> <div class="school__text">С понедельника по&nbsp;пятницу кроме выходных</div>
</div> </div>
<div class="school__col"> <div class="school__col">

@ -15,8 +15,6 @@
{% if live_lesson and live_lesson.title %} {% if live_lesson and live_lesson.title %}
{% include './open_lesson.html' %} {% include './open_lesson.html' %}
{% endif %} {% endif %}
{% else %}
{% include './day_pay_btn.html' %}
{% endif %} {% endif %}
{% endif %} {% endif %}
</div> </div>

@ -9,7 +9,7 @@
<div class="kit__body"> <div class="kit__body">
<div class="lessons__list"> <div class="lessons__list">
{% for livelesson in livelesson_list %} {% for livelesson in livelesson_list %}
<div class="lessons__item" v-for="(lesson, index) in lessons"> <div class="lessons__item">
<div class="lessons__actions lessons__actions__no-hover"> <div class="lessons__actions lessons__actions__no-hover">
<a target="_blank" class="lessons__action" href="{% url 'school:lesson-detail' livelesson.id %}"> <a target="_blank" class="lessons__action" href="{% url 'school:lesson-detail' livelesson.id %}">
<svg class="icon icon-eye"> <svg class="icon icon-eye">

@ -1,9 +1,9 @@
{% load static %} {% load static %}
<a class="online" target="_blank" href="https://www.youtube.com/watch?v=PhZ8qQbIej0" style="background-image: url({% static 'img/video-1.jpg' %});"> <a class="online" target="_blank" href="https://www.youtube.com/watch?v=PhZ8qQbIej0" style="background-image: url({% static 'img/video-1.jpg' %});">
<div class="online__center center"> <div class="online__center center">
<div class="online__type">ПРЯМОЙ ЭФИР</div> <div class="online__type">ВИДЕОУРОКИ</div>
<div class="online__title">В 17.00 (по Мск) </div> <div class="online__title">В 17.00 (по Мск) </div>
<div class="online__text text">Понедельник, среда, пятница.</div> <div class="online__text text">Каждый день с 1 сентября</div>
<div class="online__action"> <div class="online__action">
<svg class="icon icon-play"> <svg class="icon icon-play">
<use xlink:href="{% static 'img/sprite.svg' %}#icon-play"></use> <use xlink:href="{% static 'img/sprite.svg' %}#icon-play"></use>

@ -5,7 +5,7 @@
<span class="main__bold">Lil School</span> — первая образовательная онлайн-платформа креативного мышления для детей <span class="main__bold">Lil School</span> — первая образовательная онлайн-платформа креативного мышления для детей
</div> </div>
<div class="main__subtitle"> <div class="main__subtitle">
Присоединяйтесь в Рисовальный лагерь Присоединяйтесь к школе с 1 сентября
</div> </div>
<div class="main__actions"> <div class="main__actions">
<a <a
@ -32,8 +32,8 @@
<use xlink:href="{% static 'img/sprite.svg' %}#icon-online"></use> <use xlink:href="{% static 'img/sprite.svg' %}#icon-online"></use>
</svg> </svg>
</div> </div>
<div class="school__title">Прямой эфир</div> <div class="school__title">Видеоуроки</div>
<div class="school__text">Понедельник, среда, пятница</div> <div class="school__text">Каждый день с 1 сентября</div>
</div> </div>
<div class="school__col"> <div class="school__col">
<div class="school__preview"> <div class="school__preview">

@ -26,14 +26,12 @@
<div class="casing__title title">Новые уроки</div> <div class="casing__title title">Новые уроки</div>
{% endif %} {% endif %}
{% comment %}
<label class="casing__switcher switcher"> <label class="casing__switcher switcher">
<span class="switcher__wrap"> <span class="switcher__wrap">
<a href="{% url 'school:summer-school' %}?is_previous=true" class="switcher__item{% if is_previous %} active{% endif %}">запись уроков</a> <a href="{% url 'school:school' %}?is_previous=true" class="switcher__item{% if is_previous %} active{% endif %}">запись уроков</a>
<a href="{% url 'school:summer-school' %}" class="switcher__item{% if not is_previous %} active{% endif %}">новые уроки</a> <a href="{% url 'school:school' %}" class="switcher__item{% if not is_previous %} active{% endif %}">новые уроки</a>
</span> </span>
</label> </label>
{% endcomment %}
</div> </div>
{% endif %} {% endif %}
<div class="casing__timing timing js-timing"> <div class="casing__timing timing js-timing">

@ -3,12 +3,11 @@ from django.urls import path, include
from .views import ( from .views import (
LiveLessonsView, LiveLessonEditView, LiveLessonsView, LiveLessonEditView,
LiveLessonsDetailView, SchoolView, LiveLessonsDetailView, SchoolView,
SchoolSchedulesPrintView, SummerSchoolView, SchoolSchedulesPrintView,
) )
urlpatterns = [ urlpatterns = [
path('', SchoolView.as_view(), name='school'), path('', SchoolView.as_view(), name='school'),
path('summer', SummerSchoolView.as_view(), name='summer-school'),
path('schedules/print', SchoolSchedulesPrintView.as_view(), name='school_schedules-print'), path('schedules/print', SchoolSchedulesPrintView.as_view(), name='school_schedules-print'),
path('lessons/', LiveLessonsView.as_view(), name='lessons'), path('lessons/', LiveLessonsView.as_view(), name='lessons'),
path('lessons/create', LiveLessonEditView.as_view(), name='lessons-create'), path('lessons/create', LiveLessonEditView.as_view(), name='lessons-create'),

@ -1,4 +1,4 @@
from datetime import datetime, timedelta from datetime import datetime, timedelta, date
from paymentwall import Pingback from paymentwall import Pingback
from django.contrib.auth import get_user_model from django.contrib.auth import get_user_model
@ -34,19 +34,22 @@ class LiveLessonsView(ListView):
template_name = 'school/livelessons_list.html' template_name = 'school/livelessons_list.html'
def get_queryset(self): def get_queryset(self):
september2018 = date(2018, 9, 1)
date_start = (now() - timedelta(days=7)).date()
if date_start < september2018:
date_start = september2018
date_range = Q( date_range = Q(
date__range=[ date__range=[
(now() - timedelta(days=7)).date(), date_start,
(now() + timedelta(days=10)).date(), date_start + timedelta(days=17),
] ]
) )
queryset = LiveLesson.objects.filter(date_range) queryset = LiveLesson.objects.filter(date_range)
if queryset.count() < 17: if queryset.count() < 17:
start_date = now() - timedelta(days=7)
for i in range(18): for i in range(18):
try: try:
LiveLesson.objects.create( LiveLesson.objects.create(
date=(start_date + timedelta(days=i)).date(), date=date_start + timedelta(days=i),
) )
except IntegrityError: except IntegrityError:
pass pass
@ -61,6 +64,7 @@ class LiveLessonsDetailView(DetailView):
def get(self, request, pk=None): def get(self, request, pk=None):
response = super().get(request, pk=pk) response = super().get(request, pk=pk)
# ??? где проверка?
#try: #try:
# school_payment = SchoolPayment.objects.get( # school_payment = SchoolPayment.objects.get(
# user=request.user, # user=request.user,
@ -107,75 +111,8 @@ class LiveLessonEditView(TemplateView):
class SchoolView(TemplateView): class SchoolView(TemplateView):
template_name = 'school/school.html'
def get_context_data(self):
context = super().get_context_data()
is_previous = 'is_previous' in self.request.GET
date_now = now().date()
now_time = now()
try:
school_schedule = SchoolSchedule.objects.get(weekday=now_time.isoweekday())
except SchoolSchedule.DoesNotExist:
online = False
else:
end_at = datetime.combine(now_time.today(), school_schedule.start_at)
online = (
school_schedule.start_at <= 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:
school_payment = SchoolPayment.objects.filter(
user=self.request.user,
status__in=[
Pingback.PINGBACK_TYPE_REGULAR,
Pingback.PINGBACK_TYPE_GOODWILL,
Pingback.PINGBACK_TYPE_RISK_REVIEWED_ACCEPTED,
],
date_start__lte=date_now,
date_end__gte=date_now
)
school_payment_exists = school_payment.exists()
school_schedules_purchased = school_payment.annotate(
joined_weekdays=Func(F('weekdays'), function='unnest',)
).values_list('joined_weekdays', flat=True).distinct()
else:
school_payment_exists = False
school_schedules_purchased = []
if school_payment_exists and is_previous:
live_lessons = LiveLesson.objects.filter(
date__gte=school_payment.last().date_start,
date__range=[(now_time - timedelta(days=8)).date(), (now_time - timedelta(days=1)).date()],
deactivated_at__isnull=True,
)
live_lessons_exists = live_lessons.exists()
else:
live_lessons = None
live_lessons_exists = False
context.update({
'online': online,
'live_lessons': live_lessons,
'live_lessons_exists': live_lessons_exists,
'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'],
'school_schedules': SchoolSchedule.objects.all(),
'school_schedules_purchased': school_schedules_purchased,
'subscription_ends': school_payment.filter(add_days=False).first().date_end if school_payment_exists else None,
})
return context
class SummerSchoolView(TemplateView):
template_name = 'school/summer_school.html' template_name = 'school/summer_school.html'
def get(self, request, *args, **kwargs):
context = self.get_context_data(**kwargs)
if not context.get('is_purchased'):
return redirect('/')
return self.render_to_response(context)
def get_context_data(self): def get_context_data(self):
context = super().get_context_data() context = super().get_context_data()
is_previous = 'is_previous' in self.request.GET is_previous = 'is_previous' in self.request.GET
@ -193,10 +130,14 @@ class SummerSchoolView(TemplateView):
online = ( online = (
school_schedule.start_at <= now_time.time() and school_schedule.start_at <= now_time.time() and
(end_at + timedelta(hours=1)).time() >= now_time.time() and (end_at + timedelta(hours=1)).time() >= now_time.time() and
school_schedule.current_live_lesson() school_schedule.current_live_lesson
) )
school_schedules = SchoolSchedule.objects.all() school_schedules = SchoolSchedule.objects.all()
try:
school_schedules = sorted(school_schedules, key=lambda ss: ss.current_live_lesson and ss.current_live_lesson.date)
except Exception:
pass
school_schedules_dict = {ss.weekday: ss for ss in school_schedules} school_schedules_dict = {ss.weekday: ss for ss in school_schedules}
school_schedules_dict[0] = school_schedules_dict.get(7) school_schedules_dict[0] = school_schedules_dict.get(7)
all_schedules_purchased = [] all_schedules_purchased = []
@ -250,7 +191,7 @@ class SummerSchoolView(TemplateView):
school_schedules_purchased = [] school_schedules_purchased = []
if all_schedules_purchased and is_previous: if all_schedules_purchased and is_previous:
live_lessons = LiveLesson.objects.filter( live_lessons = LiveLesson.objects.filter(
date__range=[month_start, yesterday], date__range=[yesterday - timedelta(days=7), yesterday],
deactivated_at__isnull=True, deactivated_at__isnull=True,
date__week_day__in=all_schedules_purchased, date__week_day__in=all_schedules_purchased,
).order_by('-date') ).order_by('-date')

@ -64,7 +64,7 @@
<div class="section__center center"> <div class="section__center center">
<div class="tabs js-tabs"> <div class="tabs js-tabs">
<div class="tabs__nav"> <div class="tabs__nav">
{# <button class="tabs__btn js-tabs-btn active">ЛАГЕРЬ</button> #} <button class="tabs__btn js-tabs-btn active">ОНЛАЙН-ШКОЛА</button>
<button class="tabs__btn js-tabs-btn">ПРИОБРЕТЕННЫЕ <button class="tabs__btn js-tabs-btn">ПРИОБРЕТЕННЫЕ
<span class="mobile-hide">КУРСЫ</span> <span class="mobile-hide">КУРСЫ</span>
</button> </button>
@ -75,7 +75,6 @@
{% endif %} {% endif %}
</div> </div>
<div class="tabs__container"> <div class="tabs__container">
{% comment %}
<div class="tabs__item js-tabs-item" style="display: block;"> <div class="tabs__item js-tabs-item" style="display: block;">
{% if is_purchased_future %} {% if is_purchased_future %}
<div class="center center_xs"> <div class="center center_xs">
@ -89,7 +88,7 @@
{% else %} {% else %}
<div class="center center_xs"> <div class="center center_xs">
<div class="done"> <div class="done">
<div class="done__title title">Вы не подписаны на лагерь!</div> <div class="done__title title">Вы не подписаны на онлайн-школу!</div>
<div class="done__foot"> <div class="done__foot">
<a <a
{% if not user.is_authenticated %} {% if not user.is_authenticated %}
@ -106,8 +105,7 @@
{% endif %} {% endif %}
{% endif %} {% endif %}
</div> </div>
{% endcomment %} <div class="tabs__item js-tabs-item">
<div class="tabs__item js-tabs-item" style="display: block;">
<div class="courses courses_scroll"> <div class="courses courses_scroll">
<div class="courses__list"> <div class="courses__list">
{% if paid.exists %} {% if paid.exists %}

@ -12,8 +12,8 @@
<use xlink:href="{% static 'img/sprite.svg' %}#icon-online"></use> <use xlink:href="{% static 'img/sprite.svg' %}#icon-online"></use>
</svg> </svg>
</div> </div>
<div class="school__title">Прямой эфир</div> <div class="school__title">Видеоуроки</div>
<div class="school__text">Понедельник, среда, пятница</div> <div class="school__text">Каждый день с 1 сентября</div>
</div> </div>
<div class="school__col"> <div class="school__col">
<div class="school__preview"> <div class="school__preview">
@ -44,7 +44,6 @@
</div> </div>
</div> </div>
<div class="letsgo"> <div class="letsgo">
{% comment %}
{% if not is_purchased and not is_purchased_future %} {% if not is_purchased and not is_purchased_future %}
<a <a
{% if not user.is_authenticated %} {% if not user.is_authenticated %}
@ -58,7 +57,6 @@
купить доступ от {{ min_school_price }} руб./месяц купить доступ от {{ min_school_price }} руб./месяц
</a> </a>
{% endif %} {% endif %}
{% endcomment %}
</div> </div>
</div> </div>
</div> </div>

@ -19,7 +19,6 @@
<div class="footer__col"> <div class="footer__col">
<div class="footer__title">Программы</div> <div class="footer__title">Программы</div>
<nav class="footer__nav"> <nav class="footer__nav">
<a class="footer__link" href="{% url 'school:summer-school' %}">Лагерь</a>
<a class="footer__link" href="{% url 'school:school' %}">Онлайн-школа</a> <a class="footer__link" href="{% url 'school:school' %}">Онлайн-школа</a>
<a class="footer__link" href="{% url 'courses' %}">Онлайн-курсы</a> <a class="footer__link" href="{% url 'courses' %}">Онлайн-курсы</a>
<a class="footer__link" href="{% url 'author_request' %}">Стать автором</a> <a class="footer__link" href="{% url 'author_request' %}">Стать автором</a>

@ -25,19 +25,10 @@
</form> </form>
</div> </div>
<nav class="header__nav"> <nav class="header__nav">
{% if is_summer_school_purchased %}
<div class="header__group">
<a class="header__section {% active_link 'school:summer-school' %}" href="{% url 'school:summer-school' %}?is_previous=true">
ЛАГЕРЬ {% if online or livelesson.is_online %}
<div class="header__dot"></div>
{% endif %}
</a>
</div>
{% endif %}
<div class="header__group"> <div class="header__group">
<a class="header__section {% active_link 'school:school' %}" href="{% url 'school:school' %}"> <a class="header__section {% active_link 'school:school' %}" href="{% url 'school:school' %}">
ОНЛАЙН-ШКОЛА {% if online or livelesson.is_online %} ОНЛАЙН-ШКОЛА {% if online or livelesson.is_online %}
<!--<div class="header__dot"></div>--> <div class="header__dot"></div>
{% endif %} {% endif %}
</a> </a>
</div> </div>

@ -2,7 +2,7 @@
<div class="section section_courses"> <div class="section section_courses">
<div class="section__center center"> <div class="section__center center">
<div class="title title_center">Видео-курсы без расписания</div> <div class="title title_center">Видео-курсы без расписания</div>
<div class="text text_courses">Если вам не совсем удобно заниматься с нами в прямом эфире каждый день как в нашей онлайн-школе, специально для вас мы <div class="text text_courses">Если вам не совсем удобно заниматься с нами каждый день в нашей онлайн-школе, специально для вас мы
делаем отдельные уроки в записи, которые вы можете проходить когда вам будем удобно.</div> делаем отдельные уроки в записи, которые вы можете проходить когда вам будем удобно.</div>
<div class="head"> <div class="head">
<div class="head__text">Учите и развивайте креативное мышление когда и где угодно</div> <div class="head__text">Учите и развивайте креативное мышление когда и где угодно</div>

@ -1,9 +1,9 @@
{% load static %} {% load static %}
<a class="online" target="_blank" href="https://www.youtube.com/watch?v=PhZ8qQbIej0" style="background-image: url({% static 'img/video-1.jpg' %});"> <a class="online" target="_blank" href="https://www.youtube.com/watch?v=PhZ8qQbIej0" style="background-image: url({% static 'img/video-1.jpg' %});">
<div class="online__center center"> <div class="online__center center">
<div class="online__type">ПРЯМОЙ ЭФИР</div> <div class="online__type">ВИДЕОУРОКИ</div>
<div class="online__title">В 17.00 (по Мск) </div> <div class="online__title">В 17.00 (по Мск) </div>
<div class="online__text text">Понедельник, среда, пятница.</div> <div class="online__text text">Каждый день с 1 сентября</div>
<div class="online__action"> <div class="online__action">
<svg class="icon icon-play"> <svg class="icon icon-play">
<use xlink:href="{% static 'img/sprite.svg' %}#icon-play"></use> <use xlink:href="{% static 'img/sprite.svg' %}#icon-play"></use>

@ -46,7 +46,6 @@
</div> </div>
{% else %} {% else %}
<div class="main__subtitle"> <div class="main__subtitle">
{# Присоединяйтесь в Рисовальный лагерь #}
Приглашаем вас на месяц открытых дверей в Lil School Приглашаем вас на месяц открытых дверей в Lil School
</div> </div>
<div class="main__actions"> <div class="main__actions">
@ -67,7 +66,6 @@
</a> </a>
{% endif %} {% endif %}
{% endcomment %} {% endcomment %}
{# <a class="main__btn btn btn_white" href="{% url 'school:summer-school' %}">О лагере</a> #}
<a class="main__btn btn btn_white" href="{% url 'course' pk=50 %}">Подробнее</a> <a class="main__btn btn btn_white" href="{% url 'course' pk=50 %}">Подробнее</a>
</div> </div>
{% endif %} {% endif %}

@ -34,14 +34,14 @@ class IndexView(TemplateView):
online = ( online = (
school_schedule.start_at <= now_time.time() and school_schedule.start_at <= now_time.time() and
(end_at + timedelta(hours=1)).time() >= now_time.time() and (end_at + timedelta(hours=1)).time() >= now_time.time() and
school_schedule.current_live_lesson() school_schedule.current_live_lesson
) )
online_coming_soon = ( online_coming_soon = (
school_schedule.start_at > now_time.time() and school_schedule.start_at > now_time.time() and
( (
datetime.combine(datetime.today(), school_schedule.start_at) - timedelta(hours=12) datetime.combine(datetime.today(), school_schedule.start_at) - timedelta(hours=12)
).time() <= now_time.time() and ).time() <= now_time.time() and
school_schedule.current_live_lesson() school_schedule.current_live_lesson
) )
date_now = now_time.date() date_now = now_time.date()

Loading…
Cancel
Save