Merge branch 'dev' of gitlab.com:lilcity/backend into dev

remotes/origin/hasaccess
Ivlev Denis 8 years ago
commit 675aa601ce
  1. 7
      apps/school/templates/blocks/_schedule_purchased_item.html
  2. 2
      apps/school/templates/blocks/online.html
  3. 2
      apps/school/templates/blocks/schedule.html
  4. 4
      apps/school/templates/blocks/schedule_purchased.html
  5. 34
      apps/school/templates/school/schedules_print.html
  6. 11
      project/templates/blocks/header.html
  7. 2
      project/templates/blocks/live.html
  8. 2
      project/templates/blocks/school_schedules.html
  9. 36
      project/templates/lilcity/edit_index.html
  10. 4
      web/src/components/CourseRedactor.vue
  11. 2
      web/src/js/modules/api.js
  12. 21
      web/src/js/modules/popup.js
  13. 8
      web/src/js/modules/toggle.js
  14. 11
      web/src/sass/_common.sass

@ -1,5 +1,5 @@
{% load static %} {% load thumbnail %}
<div class="timing__item{% if not live_lesson %} timing__item_bg{% endif %} js-timing-item">
<div class="timing__item {% if not live_lesson %} timing__item_bg{% endif %} js-timing-item js-timing-toggle">
<div class="timing__cell">
{% if school_schedule.is_purchased %}
<div class="timing__info">
@ -16,6 +16,11 @@
{% include './open_lesson.html' %}
{% endif %}
</div>
{% comment %}
<!-- это нужно чтобы в попапе продления школы всегда знать какие дни выбраны(куплены) -->
{% endcomment %}
<span style="display: none;" data-purchased="{{ school_schedule.weekday }}"></span>
{% else %}
{% include './pay_btn.html' %}
{% endif %}

@ -1,5 +1,5 @@
{% load static %}
<a class="online" href="#" 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__type">ПРЯМОЙ ЭФИР</div>
<div class="online__title">Каждый день в 17.00 (по Мск) </div>

@ -7,7 +7,7 @@
<div class="timing__week">
{% for school_schedule in school_schedules %}
{% with current_live_lesson=school_schedule.current_live_lesson %}
<div class="timing__item{% if not current_live_lesson %} timing__item_bg{% endif %} js-timing-item">
<div class="timing__item{% if not current_live_lesson %} timing__item_bg{% endif %} js-timing-item js-timing-toggle">
<div class="timing__cell">
<div class="timing__info">
<div class="timing__day{% if school_schedule.is_online %} active{% endif %}">

@ -42,7 +42,7 @@
</div>
<div class="timing__foot">
{% include './pay_btn.html' %}
<a class="timing__print" href="#">Распечатать расписание
<a target="_blank" class="timing__print" href="{% url 'school:school_schedules-print' %}">Распечатать расписание
<span class="bold">чтобы не забыть</span>
<svg class="icon icon-print">
<use xlink:href="{% static 'img/sprite.svg' %}#icon-print"></use>
@ -53,5 +53,5 @@
</div>
</div>
</div>
{% include './last_courses.html' %}
</div>
{% include './last_courses.html' %}

@ -19,7 +19,7 @@
<div class="timing js-timing">
<div class="timing__week">
{% for school_schedule in school_schedules %} {% with current_live_lesson=school_schedule.current_live_lesson %}
<div class="timing__item{% if not current_live_lesson %} timing__item_bg{% endif %} js-timing-item open">
<div class="timing__item {% if not current_live_lesson %} timing__item_bg{% endif %} js-timing-item open">
<div class="timing__cell">
<div class="timing__info">
<div class="timing__day{% if school_schedule.is_online %} active{% endif %}">
@ -51,27 +51,27 @@
<div class="timing__more">
<div class="timing__head">Материалы</div>
<div class="timing__row">
<div class="timing__col">
<div class="timing__text">
<p>{{ school_schedule.description }}</p>
</div>
</div>
<div class="timing__col">
<!--<div class="timing__col">-->
<!--<div class="timing__text">-->
<!--<p>{{ school_schedule.description }}</p>-->
<!--</div>-->
<!--</div>-->
<div class="timing__col" style="flex: 0 0 100%;">
<div class="timing__text">
{{ school_schedule.materials }}
</div>
</div>
</div>
{% if school_schedule.schoolschedule_images.exists %}
<div class="timing__head">Результаты прошлых уроков</div>
<div class="timing__works gallery">
{% for image in school_schedule.schoolschedule_images.all %} {% thumbnail image.img.image "48x48" crop="center" as im %}
<a class="timing__work" href="{{ image.img.image.url }}">
<img class="timing__pic" src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}" />
</a>
{% endthumbnail %} {% endfor %}
</div>
{% endif %}
<!--{% if school_schedule.schoolschedule_images.exists %}-->
<!--<div class="timing__head">Результаты прошлых уроков</div>-->
<!--<div class="timing__works gallery">-->
<!--{% for image in school_schedule.schoolschedule_images.all %} {% thumbnail image.img.image "48x48" crop="center" as im %}-->
<!--<a class="timing__work" href="{{ image.img.image.url }}">-->
<!--<img class="timing__pic" src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}" />-->
<!--</a>-->
<!--{% endthumbnail %} {% endfor %}-->
<!--</div>-->
<!--{% endif %}-->
</div>
</div>
</div>

@ -104,7 +104,10 @@
{% endif %}
{% if request.user.role == request.user.TEACHER_ROLE or request.user.role == request.user.ADMIN_ROLE %}
<a class="header__link header__link_green" href="{% url 'school:lessons-create' %}">
<div class="header__title">ДОБАВИТЬ ОНЛАЙН-УРОК</div>
<div class="header__title">ДОБАВИТЬ УРОК ШКОЛЫ</div>
</a>
<a class="header__link" href="{% url 'school:lessons' %}">
<div class="header__title">УРОКИ ШКОЛЫ</div>
</a>
{% endif %}
{% endif %}
@ -112,9 +115,9 @@
<a class="header__link" href="{% url 'user' request.user.id %}">
<div class="header__title">ПРОФИЛЬ</div>
</a>
<a class="header__link" href="#">
<div class="header__title">НАСТРОЙКИ</div>
</a>
<!--<a class="header__link" href="#">-->
<!--<div class="header__title">НАСТРОЙКИ</div>-->
<!--</a>-->
<a class="header__link" href="{% url 'lilcity:logout' %}">
<div class="header__title">ВЫЙТИ</div>
</a>

@ -1,5 +1,5 @@
{% load static %}
<a class="online" href="#" 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__type">ПРЯМОЙ ЭФИР</div>
<div class="online__title">Каждый день в 17.00 (по Мск) </div>

@ -24,6 +24,6 @@
{% endfor %}
</div>
<div class="text text_mb0">
<a target="_blank" href="{% url 'school_schedules' %}">Распечатать расписание</a> чтобы не забыть</div>
<a target="_blank" href="{% url 'school:school_schedules-print' %}">Распечатать расписание</a> чтобы не забыть</div>
</div>
</div>

@ -1,4 +1,5 @@
{% load static %}
{% load thumbnail %}
{% load active_link_tags %}
{% load category_menu_items from lilcity_category %}
@ -56,27 +57,40 @@
</div>
{% if request.user.is_authenticated %}
<div class="header__login">
{% if request.user.photo %}
<div class="header__ava ava"><img class="ava__pic" src="{{ request.user.photo.url }}"></div>
{% else %}
<div class="header__ava ava"><img class="ava__pic" src="{% static 'img/user.jpg' %}"></div>
{% endif %}
<div class="header__ava ava">
{% thumbnail request.user.photo "48x48" crop="center" as im %}
<img class="ava__pic" src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}" />
{% empty %}
<img class="ava__pic" src="{% static 'img/no_cover.png' %}" width="48px" height="48px" />
{% endthumbnail %}
</div>
<div class="header__drop">
{% comment %} <a class="header__link header__link_border" href="#">234.120.345 руб.</a> {% endcomment %}
{% if request.user.auth_token %}
{% if request.user.role >= request.user.AUTHOR_ROLE %}
<a class="header__link header__link_border" href="{% url 'user-edit-payments' request.user.id %}">
{{ request.user.balance }} руб.
</a>
{% if request.user.auth_token %}
{% if request.user.role == request.user.AUTHOR_ROLE or request.user.role == request.user.ADMIN_ROLE %}
<a class="header__link header__link_green" href="{% url 'course_create' %}">
{% comment %} <a class="header__link header__link_gray disabled" href="#"> {% endcomment %}
<div class="header__title">ДОБАВИТЬ КУРС</div>
</a>
{% endif %}
{% if request.user.role == request.user.TEACHER_ROLE or request.user.role == request.user.ADMIN_ROLE %}
<a class="header__link header__link_green" href="{% url 'school:lessons-create' %}">
<div class="header__title">ДОБАВИТЬ УРОК ШКОЛЫ</div>
</a>
<a class="header__link" href="{% url 'school:lessons' %}">
<div class="header__title">УРОКИ ШКОЛЫ</div>
</a>
{% endif %}
{% endif %}
{% endif %}
<a class="header__link" href="{% url 'user' request.user.id %}">
<div class="header__title">ПРОФИЛЬ</div>
</a>
<a class="header__link" href="#">
<div class="header__title">НАСТРОЙКИ</div>
</a>
<!--<a class="header__link" href="#">-->
<!--<div class="header__title">НАСТРОЙКИ</div>-->
<!--</a>-->
<a class="header__link" href="{% url 'lilcity:logout' %}">
<div class="header__title">ВЫЙТИ</div>
</a>

@ -607,7 +607,7 @@
this.course = api.convertCourseJson(response.data);
this.course.live = this.live;
if (this.course.date) {
if (this.live && this.course.date) {
this.course.date = _.find(this.scheduleOptions, (item) => {
return item.value == this.course.date;
})
@ -749,7 +749,7 @@
this.course.id = courseData.id;
}
if(courseData.date) {
if(this.live && courseData.date) {
this.course.date = _.find(this.scheduleOptions, function(item){
return item.value == courseData.date;
});

@ -64,7 +64,7 @@ export const api = {
if (courseObject.is_deferred) {
if (courseObject.date && courseObject.time && courseObject.time.value) {
let deferredStartTime = moment(courseObject.time.value, "HH:mm");
let deferredStartDate = moment(courseObject.date).hour(deferredStartTime.hour());
let deferredStartDate = moment(courseObject.date).hour(deferredStartTime.hour()).minute(deferredStartTime.minute());
deferredStart = deferredStartDate.format();
}
}

@ -1,5 +1,6 @@
import $ from 'jquery';
var selectedWeekdays = {};
$(document).ready(function () {
let body = $('body'),
popup;
@ -12,10 +13,26 @@ $(document).ready(function () {
popup = $(data);
showPopup();
if(data === '.js-popup-buy') {
console.log('reset selected');
$('[data-day]').prop('checked', false);
if ($(this).text() === 'продлить') {
//data-purchased
//restore purchased selection
console.log('restore purchased');
$('[data-purchased]').each(function(){
$('[data-day='+$(this).data('purchased')+']').prop('checked', true);
});
}
}
if($(this).data('day')) {
let day = $(this).data('day');
$('[data-day='+day+']').prop('checked', true);
}
$('[data-day]').trigger('change');
});
$('.js-popup-close').on('click', function(e){
@ -57,8 +74,8 @@ $(document).ready(function () {
}
}
var selectedWeekdays = {};
$(document).on('change', '[data-day]', function(){
console.log('on change data-day');
var weekday = $(this).data('day');
var price = $(this).data('price');
if($(this).is(':checked')) {
@ -74,7 +91,7 @@ $(document).ready(function () {
function updateCart(){
var days = ['', 'Понедельник', 'Вторник', 'Среда', 'Четверг', 'Пятница', 'Суббота', 'Воскресенье'];
var weekdays = [], daysText = [], price = 0, discount = 0;
var weekdays = [], daysText = [], price = 0;
for(var i in selectedWeekdays) {
price += parseInt(selectedWeekdays[i].price);
weekdays.push(i);

@ -10,8 +10,10 @@ $(document).ready(function () {
$('.js-timing-toggle').on('click', function(e){
e.preventDefault();
let _this = $(this);
let _parent = _this.closest('.timing__item')
_parent.toggleClass('open');
// _parent.next().slideToggle();
if(!$(e.target).data('popup')) {
let _parent = _this.closest('.timing__item')
_parent.toggleClass('open');
// _parent.next().slideToggle();
}
});
});

@ -2440,10 +2440,10 @@ a.grey-link
display: flex
align-items: center
&__item
&:not(:last-child)
margin-right: 40px
+t
margin-right: 30px
//&:not(:last-child)
margin-right: 40px
+t
margin-right: 30px
&__icon
margin-right: 10px
font-size: 0
@ -2974,6 +2974,7 @@ a.grey-link
height: 120px
margin-right: 25px
flex: 0 0 120px
margin: 15px auto
+m
width: 140px
height: 140px
@ -3657,6 +3658,8 @@ a.grey-link
display: flex
position: relative
padding: 20px 0
cursor: pointer
page-break-inside: avoid
+nf
border-top: 1px solid $border
&_bg

Loading…
Cancel
Save