remotes/origin/hasaccess^2
root 8 years ago
commit 3d8bf5bde6
  1. 6
      .gitlab-ci.yml
  2. 4
      apps/school/models.py
  3. 14
      apps/school/templates/blocks/_schedule_purchased_item.html
  4. 2
      apps/school/templates/school/livelesson_detail.html
  5. 14
      apps/school/templates/summer/_schedule_purchased_item.html
  6. 44
      apps/school/views.py
  7. 14
      project/templates/blocks/about.html
  8. 4
      project/templates/blocks/promo.html
  9. 3
      project/templates/lilcity/index.html
  10. 2
      project/views.py

@ -35,8 +35,6 @@ deploy_review:
- review - review
only: only:
- branches - branches
except:
- master
stop-review: stop-review:
stage: stop stage: stop
@ -51,8 +49,6 @@ stop-review:
when: manual when: manual
only: only:
- branches - branches
except:
- master
tags: tags:
- review - review
@ -66,7 +62,5 @@ prod-db:
when: manual when: manual
only: only:
- branches - branches
except:
- master
tags: tags:
- review - review

@ -44,7 +44,7 @@ class SchoolSchedule(models.Model):
return dict(self.WEEKDAY_CHOICES).get(self.weekday, '') return dict(self.WEEKDAY_CHOICES).get(self.weekday, '')
def is_online(self): 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() return self.start_at <= now().time() and end_at.time() >= now().time() and self.weekday == now().isoweekday()
def current_live_lesson(self): def current_live_lesson(self):
@ -132,5 +132,5 @@ class LiveLesson(BaseModel, DeactivatedMixin):
return False return False
else: else:
start_at = school_schedule.start_at 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() return start_at <= now().time() and end_at.time() >= now().time()

@ -6,15 +6,17 @@
{{ school_schedule }} {{ school_schedule }}
</div> </div>
{% if live_lesson %} {% if live_lesson %}
<!--<div class="timing__date">{{ live_lesson.date }}</div>--> <div class="timing__date">{{ live_lesson.date }}</div>
{% endif %} {% endif %}
</div> </div>
<div class="timing__buy"> <div class="timing__buy">
<div class="timing__time">{{ school_schedule.start_at }} (МСК)</div> <div class="timing__time">{{ school_schedule.start_at }} (МСК)</div>
{% if school_schedule.weekday in school_schedules_purchased and live_lesson %} {% if school_schedule.weekday in school_schedules_purchased %}
{% include './open_lesson.html' %} {% if live_lesson and live_lesson.title %}
{% include './open_lesson.html' %}
{% endif %}
{% else %} {% else %}
{% include './day_pay_btn.html' %} {% include './day_pay_btn.html' %}
{% endif %} {% endif %}
</div> </div>
{% comment %} {% comment %}
@ -34,12 +36,12 @@
</div> </div>
</div> </div>
<div class="timing__cell"> <div class="timing__cell">
<div class="timing__title">{{ school_schedule.title }}{% if live_lesson %}, <div class="timing__title">{{ school_schedule.title }}{% if live_lesson and live_lesson.title %},
<span class="bold">{{ live_lesson.title }}</span> <span class="bold">{{ live_lesson.title }}</span>
{% endif %} {% endif %}
</div> </div>
<div class="timing__content"> <div class="timing__content">
{% if live_lesson %} {% if live_lesson and live_lesson.short_description %}
{{ live_lesson.short_description }} {{ live_lesson.short_description }}
{% else %} {% else %}
{{ school_schedule.description }} {{ school_schedule.description }}

@ -10,7 +10,7 @@
<div class="lesson__content">{{ livelesson.short_description }}</div> <div class="lesson__content">{{ livelesson.short_description }}</div>
<a class="lesson__video video" href="#"> <a class="lesson__video video" href="#">
{% if livelesson.stream_index %} {% if livelesson.stream_index %}
<iframe class="lesson__video_frame" src="https://player.vimeo.com/video/{{ livelesson.stream_index }}" frameborder="0" webkitallowfullscreen <iframe class="lesson__video_frame" src="https://player.vimeo.com/video/{{ livelesson.stream_index }}?autoplay=1" frameborder="0" webkitallowfullscreen
mozallowfullscreen allowfullscreen> mozallowfullscreen allowfullscreen>
</iframe> </iframe>
<a href="#" onclick="location.reload();">Если видео не загрузилось обновите страницу</a> <a href="#" onclick="location.reload();">Если видео не загрузилось обновите страницу</a>

@ -6,15 +6,17 @@
{{ school_schedule }} {{ school_schedule }}
</div> </div>
{% if live_lesson %} {% if live_lesson %}
<!--<div class="timing__date">{{ live_lesson.date }}</div>--> <div class="timing__date">{{ live_lesson.date }}</div>
{% endif %} {% endif %}
</div> </div>
<div class="timing__buy"> <div class="timing__buy">
<div class="timing__time">{{ school_schedule.start_at }} (МСК)</div> <div class="timing__time">{{ school_schedule.start_at }} (МСК)</div>
{% if school_schedule.weekday in school_schedules_purchased and live_lesson %} {% if school_schedule.weekday in school_schedules_purchased %}
{% include './open_lesson.html' %} {% if live_lesson and live_lesson.title %}
{% include './open_lesson.html' %}
{% endif %}
{% else %} {% else %}
{% include './day_pay_btn.html' %} {% include './day_pay_btn.html' %}
{% endif %} {% endif %}
</div> </div>
{% comment %} {% comment %}
@ -34,12 +36,12 @@
</div> </div>
</div> </div>
<div class="timing__cell"> <div class="timing__cell">
<div class="timing__title">{{ school_schedule.title }}{% if live_lesson %}, <div class="timing__title">{{ school_schedule.title }}{% if live_lesson and live_lesson.title %},
<span class="bold">{{ live_lesson.title }}</span> <span class="bold">{{ live_lesson.title }}</span>
{% endif %} {% endif %}
</div> </div>
<div class="timing__content"> <div class="timing__content">
{% if live_lesson %} {% if live_lesson and live_lesson.short_description %}
{{ live_lesson.short_description }} {{ live_lesson.short_description }}
{% else %} {% else %}
{{ school_schedule.description }} {{ school_schedule.description }}

@ -61,26 +61,26 @@ 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,
add_days=False, # add_days=False,
date_start__lte=now(), # date_start__lte=now(),
date_end__gte=now(), # date_end__gte=now(),
status__in=[ # status__in=[
Pingback.PINGBACK_TYPE_REGULAR, # Pingback.PINGBACK_TYPE_REGULAR,
Pingback.PINGBACK_TYPE_GOODWILL, # Pingback.PINGBACK_TYPE_GOODWILL,
Pingback.PINGBACK_TYPE_RISK_REVIEWED_ACCEPTED, # Pingback.PINGBACK_TYPE_RISK_REVIEWED_ACCEPTED,
], # ],
) # )
except SchoolPayment.DoesNotExist: #except SchoolPayment.DoesNotExist:
school_payment = None # school_payment = None
if request.user.role not in [User.ADMIN_ROLE, User.TEACHER_ROLE] and not ( #if request.user.role not in [User.ADMIN_ROLE, User.TEACHER_ROLE] and not (
request.user.role == User.USER_ROLE and # request.user.role == User.USER_ROLE and
school_payment and # school_payment and
school_payment.is_deliverable() # school_payment.is_deliverable()
): #):
raise Http404 # raise Http404
return response return response
@ -122,7 +122,7 @@ class SchoolView(TemplateView):
end_at = datetime.combine(now_time.today(), school_schedule.start_at) end_at = datetime.combine(now_time.today(), school_schedule.start_at)
online = ( online = (
school_schedule.start_at <= now_time.time() and 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() school_schedule.current_live_lesson()
) )
if self.request.user.is_authenticated: if self.request.user.is_authenticated:
@ -183,7 +183,7 @@ class SummerSchoolView(TemplateView):
end_at = datetime.combine(now_time.today(), school_schedule.start_at) end_at = datetime.combine(now_time.today(), school_schedule.start_at)
online = ( online = (
school_schedule.start_at <= now_time.time() and 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() school_schedule.current_live_lesson()
) )
if self.request.user.is_authenticated: if self.request.user.is_authenticated:

@ -44,21 +44,19 @@
</div> </div>
</div> </div>
<div class="letsgo"> <div class="letsgo">
<a {% if not is_purchased and not is_purchased_future %}
{% if not is_purchased_future %} <a
{% if not user.is_authenticated %} {% if not user.is_authenticated %}
data-popup=".js-popup-auth" data-popup=".js-popup-auth"
{% else %} {% else %}
data-popup=".js-popup-buy" data-popup=".js-popup-buy"
{% endif %} {% endif %}
{% endif %}
class="main__btn btn" class="main__btn btn"
href="#" href="#"
> >
{% if not is_purchased and not is_purchased_future %}купить доступ от {{ min_school_price }} руб./месяц{% endif %} купить доступ от {{ min_school_price }} руб./месяц
{% if is_purchased_future and not is_purchased %}ваша подписка начинается {{school_purchased_future.date_start}}{% endif %} </a>
{% if is_purchased %}ваша подписка истекает {{ subscription_ends_humanize }}<br/>перейти к оплате{% endif %} {% endif %}
</a>
</div> </div>
</div> </div>
</div> </div>

@ -12,11 +12,11 @@
<span class="main__bold">Lil School</span> — первая образовательная онлайн-платформа креативного мышления для детей <span class="main__bold">Lil School</span> — первая образовательная онлайн-платформа креативного мышления для детей
</div> </div>
<div class="main__subtitle"> <div class="main__subtitle">
Урок <b>Рисовальный лагерь, Альбрехт Дюрер</b> начнется завтра в 17:00 Урок <b>Рисовальный лагерь, Поль Синьяк</b> пройдет сегодня в 17:00 <br/>
</div> </div>
<div class="main__actions"> <div class="main__actions">
{% if is_purchased %} {% if is_purchased %}
<a class="main__btn btn" href="/school/lessons/214">Перейти в урок</a> <a class="main__btn btn" href="/school/lessons/216/">Перейти в урок</a>
{% else %} {% else %}
<a <a
{% if not is_purchased_future %} {% if not is_purchased_future %}

@ -75,8 +75,7 @@
</script> </script>
{% comment %} ROISTAT {% endcomment %} {% comment %} ROISTAT {% endcomment %}
<script> <script>
ROISTAT_COUNTER_ID = "{% setting 'ROISTAT_COUNTER_ID' %}" (function(w, d, s, h, id) { w.roistatProjectId = id; w.roistatHost = h; var p = d.location.protocol == "https:" ? "https://" : "http://"; var u = /^.*roistat_visit=[^;]+(.*)?$/.test(d.cookie) ? "/dist/module.js" : "/api/site/1.0/"+id+"/init"; var js = d.createElement(s); js.charset="UTF-8"; js.async = 1; js.src = p+h+u; var js2 = d.getElementsByTagName(s)[0]; js2.parentNode.insertBefore(js, js2);})(window, document, 'script', 'cloud.roistat.com', '{% setting 'ROISTAT_COUNTER_ID' %}');
(function(w, d, s, h, id) { w.roistatProjectId = id; w.roistatHost = h; var p = d.location.protocol == "https:" ? "https://" : "http://"; var u = /^.*roistat_visit=[^;]+(.*)?$/.test(d.cookie) ? "/dist/module.js" : "/api/site/1.0/"+id+"/init"; var js = d.createElement(s); js.charset="UTF-8"; js.async = 1; js.src = p+h+u; var js2 = d.getElementsByTagName(s)[0]; js2.parentNode.insertBefore(js, js2);})(window, document, 'script', 'cloud.roistat.com', ROISTAT_COUNTER_ID);
</script> </script>
{% block foot %}{% endblock foot %} {% block foot %}{% endblock foot %}
</body> </body>

@ -31,7 +31,7 @@ class IndexView(TemplateView):
end_at = datetime.combine(now_time.today(), school_schedule.start_at) end_at = datetime.combine(now_time.today(), school_schedule.start_at)
online = ( online = (
school_schedule.start_at <= now_time.time() and 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() school_schedule.current_live_lesson()
) )
date_now = now_time.date() date_now = now_time.date()

Loading…
Cancel
Save