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

@ -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()

@ -6,15 +6,17 @@
{{ school_schedule }}
</div>
{% if live_lesson %}
<!--<div class="timing__date">{{ live_lesson.date }}</div>-->
<div class="timing__date">{{ live_lesson.date }}</div>
{% endif %}
</div>
<div class="timing__buy">
<div class="timing__time">{{ school_schedule.start_at }} (МСК)</div>
{% 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 %}
</div>
{% comment %}
@ -34,12 +36,12 @@
</div>
</div>
<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>
{% endif %}
</div>
<div class="timing__content">
{% if live_lesson %}
{% if live_lesson and live_lesson.short_description %}
{{ live_lesson.short_description }}
{% else %}
{{ school_schedule.description }}

@ -10,7 +10,7 @@
<div class="lesson__content">{{ livelesson.short_description }}</div>
<a class="lesson__video video" href="#">
{% 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>
</iframe>
<a href="#" onclick="location.reload();">Если видео не загрузилось обновите страницу</a>

@ -6,15 +6,17 @@
{{ school_schedule }}
</div>
{% if live_lesson %}
<!--<div class="timing__date">{{ live_lesson.date }}</div>-->
<div class="timing__date">{{ live_lesson.date }}</div>
{% endif %}
</div>
<div class="timing__buy">
<div class="timing__time">{{ school_schedule.start_at }} (МСК)</div>
{% 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 %}
</div>
{% comment %}
@ -34,12 +36,12 @@
</div>
</div>
<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>
{% endif %}
</div>
<div class="timing__content">
{% if live_lesson %}
{% if live_lesson and live_lesson.short_description %}
{{ live_lesson.short_description }}
{% else %}
{{ school_schedule.description }}

@ -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:

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

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

@ -75,8 +75,7 @@
</script>
{% comment %} ROISTAT {% endcomment %}
<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', 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' %}');
</script>
{% block foot %}{% endblock foot %}
</body>

@ -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()

Loading…
Cancel
Save