Merge branch 'master' of gitlab.com:lilcity/backend into feature/cloudpayments

remotes/origin/feature/cloudpayments
gzbender 7 years ago
commit 422ab3d5bb
  1. 9
      apps/user/forms.py
  2. 33
      apps/user/migrations/0030_auto_20190318_1320.py
  3. 6
      apps/user/models.py
  4. 93
      apps/user/templates/user/profile-settings.html
  5. 22
      apps/user/templates/user/profile.html
  6. 129
      project/templates/lilcity/index.html
  7. 114
      project/templates/lilcity/layer.html
  8. 84
      project/templates/lilcity/links.html
  9. 3
      project/urls.py
  10. 4
      project/views.py
  11. 26
      web/src/components/CourseRedactor.vue
  12. BIN
      web/src/img/fill-profile-gramota.png
  13. BIN
      web/src/img/profile-edit-child-form.png
  14. 15
      web/src/js/modules/api.js
  15. 21
      web/src/js/pages/profile.js
  16. 47
      web/src/sass/_common.sass

@ -31,6 +31,11 @@ class UserEditForm(forms.ModelForm):
site = forms.URLField(required=False)
photo = forms.ImageField(required=False)
child_gender = forms.CharField(required=False)
child_birthday = forms.DateField(input_formats=['%d.%m.%Y'], required=False)
child_first_name = forms.CharField(required=False)
child_last_name = forms.CharField(required=False)
class Meta:
model = User
fields = (
@ -56,6 +61,10 @@ class UserEditForm(forms.ModelForm):
'vkontakte',
'site',
'photo',
'child_gender',
'child_birthday',
'child_first_name',
'child_last_name',
)

@ -0,0 +1,33 @@
# Generated by Django 2.0.7 on 2019-03-18 13:20
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('user', '0029_emaillog'),
]
operations = [
migrations.AddField(
model_name='user',
name='child_birthday',
field=models.DateField(blank=True, null=True, verbose_name='День рождения ребенка'),
),
migrations.AddField(
model_name='user',
name='child_first_name',
field=models.CharField(blank=True, max_length=30, verbose_name='Имя ребенка'),
),
migrations.AddField(
model_name='user',
name='child_gender',
field=models.CharField(choices=[('n', 'не указан'), ('m', 'Мужчина'), ('f', 'Женщина')], default='n', max_length=1, verbose_name='Пол ребенка'),
),
migrations.AddField(
model_name='user',
name='child_last_name',
field=models.CharField(blank=True, max_length=150, verbose_name='Фамилия ребенка'),
),
]

@ -89,6 +89,12 @@ class User(AbstractUser):
verbose_name='Галерея', null=True, blank=True,
)
child_first_name = models.CharField('Имя ребенка', max_length=30, blank=True)
child_last_name = models.CharField('Фамилия ребенка', max_length=150, blank=True)
child_gender = models.CharField(
'Пол ребенка', max_length=1, default='n', choices=GENDER_CHOICES)
child_birthday = models.DateField('День рождения ребенка', null=True, blank=True)
objects = UserManager()
USERNAME_FIELD = 'email'

@ -76,15 +76,6 @@
<div class="field__error">{{ error }}</div>
{% endfor %}
</div>
<div class="form__field field{% if form.phone.errors %} error{% endif %}">
<div class="field__label">Телефон</div>
<div class="field__wrap">
<input name='phone' class="field__input" type="phone" placeholder="+7 (999) 999-99-99" value="{{ user.phone }}">
</div>
{% for error in form.phone.errors %}
<div class="field__error">{{ error }}</div>
{% endfor %}
</div>
<div class="form__field field{% if form.slug.errors %} error{% endif %}">
<div class="field__label">Ссылка</div>
<div class="field__wrap field__wrap__appended">
@ -96,6 +87,82 @@
<div class="field__error">{{ error }}</div>
{% endfor %}
</div>
</div>
<!-- child form -->
<div class="user-child-form form__group">
<div class="form__title">Карточка ребёнка</div>
<div class="user-child-form__description">
Вся информация конфиденциальна и не передается третьим лицам. Необходима только для персонализации наград,
поздравлений с Днем Рождения и других персонализированных акций.
</div>
<div class="form__fieldset">
<div class="form__field field{% if form.child_first_name.errors %} error{% endif %}">
<div class="field__label">ИМЯ РЕБЕНКА</div>
<div class="field__wrap">
<input name='child_first_name' id="child-first-name" class="field__input" type="text" placeholder="Имя"
value="{{ user.child_first_name }}">
</div>
{% for error in form.child_first_name.errors %}
<div class="field__error">{{ error }}</div>
{% endfor %}
</div>
<div class="form__field field{% if form.child_last_name.errors %} error{% endif %}">
<div class="field__label">ФАМИЛИЯ РЕБЕНКА</div>
<div class="field__wrap">
<input name='child_last_name' id="child-last-name" class="field__input" type="text" placeholder="Фамилия"
value="{{ user.child_last_name }}">
</div>
{% for error in form.child_last_name.errors %}
<div class="field__error">{{ error }}</div>
{% endfor %}
</div>
</div>
<div class="form__fieldset">
<div class="form__field field{% if form.child_birthday.errors %} error{% endif %}">
<div class="field__label">ДАТА РОЖДЕНИЯ</div>
<div class="field__wrap">
<input name='child_birthday' class="field__input" type="text" placeholder="dd.mm.yyyy"
value="{% if user.child_birthday %}{{ user.child_birthday | date:'d.m.Y' }}{% endif %}">
</div>
{% for error in form.child_birthday.errors %}
<div class="field__error">{{ error }}</div>
{% endfor %}
</div>
<div class="form__field field{% if form.child_gender.errors %} error{% endif %}">
<div class="field__label">ПОЛ</div>
<div class="field__wrap">
<div class="field__select select js-select{% if user.child_gender and user.child_gender != 'n' %} selected{% endif %}">
<div class="select__head js-select-head">
{% if user.child_gender == 'f' %}Ж{% elif user.child_gender == 'm' %}M{% else %}М / Ж{% endif %}
</div>
<div class="select__drop js-select-drop" data-gender-select data-input="#child-gender">
<div class="select__option js-select-option" data-gender-option data-gender="m">
<div class="select__title">М</div>
</div>
<div class="select__option js-select-option" data-gender-option data-gender="f">
<div class="select__title">Ж</div>
</div>
</div>
<input id="child-gender" name='child_gender' class="select__input" type="hidden">
</div>
</div>
{% for error in form.child_gender.errors %}
<div class="field__error">{{ error }}</div>
{% endfor %}
</div>
</div>
<div class="form__field field{% if form.phone.errors %} error{% endif %}">
<div class="field__label">Телефон</div>
<div class="field__wrap">
<input name='phone' class="field__input" type="phone" placeholder="+7 (999) 999-99-99" value="{{ user.phone }}">
</div>
{% for error in form.phone.errors %}
<div class="field__error">{{ error }}</div>
{% endfor %}
</div>
</div>
<!-- end child form -->
<div class="form__group">
<div class="form__fieldset">
<div class="form__field field{% if form.city.errors %} error{% endif %}">
<div class="field__label">ГОРОД</div>
@ -133,7 +200,7 @@
<div class="select__head js-select-head">
{% if user.gender == 'f' %}Ж{% elif user.gender == 'm' %}M{% else %}М / Ж{% endif %}
</div>
<div class="select__drop js-select-drop">
<div class="select__drop js-select-drop" data-gender-select data-input="#gender">
<div class="select__option js-select-option" data-gender-option data-gender="m">
<div class="select__title">М</div>
</div>
@ -180,7 +247,7 @@
{% for error in form.old_password.errors %}
<div class="field__error">{{ error }}</div>
{% endfor %}
</div>
</div>
<div class="form__field field{% if form.new_password1.errors %} error{% endif %}">
<div class="field__label">НОВЫЙ ПАРОЛЬ</div>
<div class="field__wrap">
@ -189,7 +256,7 @@
{% for error in form.new_password1.errors %}
<div class="field__error">{{ error }}</div>
{% endfor %}
</div>
</div>
<div class="form__field field{% if form.new_password2.errors %} error{% endif %}">
<div class="field__label">ПОДТВЕРДИТЬ НОВЫЙ ПАРОЛЬ</div>
<div class="field__wrap">
@ -198,7 +265,7 @@
{% for error in form.new_password2.errors %}
<div class="field__error">{{ error }}</div>
{% endfor %}
</div>
</div>
</div>
<div class="form__group">
<div class="form__title">Соцсети</div>

@ -1,4 +1,26 @@
{% extends "templates/lilcity/index.html" %} {% load static %} {% load thumbnail %} {% block content %}
{% if not user.child_first_name and not user.child_last_name %}
<div class="section">
<div class="section__center center">
<div class="fill-profile">
<div class="fill-profile__text">Хотите получать грамоты Lil School<br>по окончании месяца обучения?</div>
<div class="fill-profile__img"></div>
<div class="fill-profile__btn">
<a class="btn btn_white" href="{% url 'user-edit-profile' %}">Заполни профиль</a>
</div>
<div class="fill-profile__arrow">
<a href="{% url 'user-edit-profile' %}">
<svg class="icon icon-arrow-right">
<use xlink:href="{% static 'img/sprite.svg' %}#icon-arrow-right"></use>
</svg>
</a>
</div>
</div>
</div>
</div>
{% endif %}
<div class="section">
<div class="section__center center">
<div class="profile">

@ -1,40 +1,18 @@
{% extends "templates/lilcity/layer.html" %}
{% load static %}
{% load setting from settings %}
{% load compress %}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>
{% block title %}Онлайн-курсы Lil School{% endblock title%}
</title>
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="theme-color" content="#fff">
<meta name="format-detection" content="telephone=no">
<meta name="description" content="{% block description %}Онлайн-курсы Lil School{% endblock description%}">
<!--Open Graph data-->
<meta property="og:title" content="{% block ogtitle %}Онлайн-курсы Lil School{% endblock ogtitle %}">
{% comment %} <meta property="og:type" content="article"> {% endcomment %}
<meta property="og:url" content="{% block ogurl %}{{ request.build_absolute_uri }}{% endblock ogurl %}">
<meta property="og:image" content="{% block ogimage %}http://{% setting 'MAIN_HOST' %}{% static 'img/video-1.jpg' %}{% endblock ogimage %}">
<meta property="og:image:width" content="{% block ogimage-width %}597{% endblock ogimage-width %}" />
<meta property="og:image:height" content="{% block ogimage-height %}318{% endblock ogimage-height %}" />
<meta property="og:description" content="{% block ogdescription %}Lil School — первая образовательная онлайн-платформа креативного мышления для детей{% endblock ogdescription %}">
<meta property="og:site_name" content="Онлайн-курсы Lil School">
<meta property="og:locale" content="ru_RU">
{% comment %} <meta property="fb:admins" content="Facebook numeric ID"> {% endcomment %}
<meta name="csrf-token" content="{{ csrf_token }}">
<meta name="yandex-verification" content="bb471d5abd9fdec7" />
<meta name="google-site-verification" content="3ULNxGYLRXUpDpKuZgMLTTrXAJx7UEzwAXseCcfdm1s" />
{% compress css %}
<link rel="stylesheet" media="all" href={% static "app.css" %}>
{% endcompress %}
<link rel="shortcut icon" type="image/png" href="{% static 'img/favicon.png' %}"/>
{% block layer_head %}
<script src="https://js.pusher.com/4.1/pusher.min.js"></script>
<script>
LIL_SERVER_TIME = "{% now 'U' %}";
LIL_SERVER_TIME_DIFF = Math.floor((new Date().getTime()) / 1000) - parseInt(LIL_SERVER_TIME);
USER_ID = "{{ request.user.id }}";
COURSE_ID = "{{ course.id }}";
MIXPANEL_CUSTOM_LIB_URL = "/static/mixpanel-2-latest.js";
</script>
<!-- Start of LiveChat (www.livechatinc.com) code -->
<script type="text/javascript">
window.__lc = window.__lc || {};
@ -49,86 +27,10 @@
})();
</script>
<!-- End of LiveChat code -->
<script src="https://js.pusher.com/4.1/pusher.min.js"></script>
<script>
var viewportmeta = document.querySelector('meta[name="viewport"]');
if (viewportmeta) {
if (screen.width <= 360) {
var newScale = screen.width / 360;
viewportmeta.content = 'width=360, minimum-scale=' + newScale + ', user-scalable=0, maximum-scale=1, initial-scale=' + newScale + '';
}
else {
viewportmeta.content = 'width=device-width, maximum-scale=1.6, initial-scale=1.0';
}
}
</script>
<script>
LIL_SERVER_TIME = "{% now 'U' %}";
LIL_SERVER_TIME_DIFF = Math.floor((new Date().getTime()) / 1000) - parseInt(LIL_SERVER_TIME);
USER_ID = "{{ request.user.id }}";
COURSE_ID = "{{ course.id }}";
MIXPANEL_CUSTOM_LIB_URL = "/static/mixpanel-2-latest.js";
</script>
<!-- Facebook Pixel Code -->
<script>
!function(f,b,e,v,n,t,s)
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];
s.parentNode.insertBefore(t,s)}(window,document,'script',
'https://connect.facebook.net/en_US/fbevents.js');
fbq('init', '194961257900508');
fbq('track', 'PageView');
</script>
<noscript>
<img height="1" width="1"
src="https://www.facebook.com/tr?id=194961257900508&ev=PageView
&noscript=1"/>
</noscript>
<!-- End Facebook Pixel Code -->
<!-- Global site tag (gtag.js) - Google Ads: 808701460 -->
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-808701460"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'AW-808701460');
</script>
<!-- Yandex.Metrika counter -->
<script type="text/javascript" >
(function (d, w, c) {
(w[c] = w[c] || []).push(function() {
try {
w.yaCounter49354039 = new Ya.Metrika2({
id:49354039,
clickmap:true,
trackLinks:true,
accurateTrackBounce:true,
webvisor:true
});
} catch(e) { }
});
var n = d.getElementsByTagName("script")[0],
s = d.createElement("script"),
f = function () { n.parentNode.insertBefore(s, n); };
s.type = "text/javascript";
s.async = true;
s.src = "https://mc.yandex.ru/metrika/tag.js";
if (w.opera == "[object Opera]") {
d.addEventListener("DOMContentLoaded", f, false);
} else { f(); }
})(document, window, "yandex_metrika_callbacks2");
</script>
<noscript><div><img src="https://mc.yandex.ru/watch/49354039" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
<!-- /Yandex.Metrika counter -->
{% include "templates/blocks/mixpanel.html" %}
{% block head %}{% endblock head %}
</head>
<body>
{% endblock layer_head %}
{% block layer_body %}
{% include "templates/blocks/social.html" %}
{% include "templates/blocks/baner.html" %}
<div class="outer js-outer">
@ -160,5 +62,4 @@
</script>
{% block foot %}{% endblock foot %}
{% block foot_js %}{% endblock foot_js %}
</body>
</html>
{% endblock layer_body %}

@ -0,0 +1,114 @@
<!DOCTYPE html>
{% load static %}
{% load setting from settings %}
{% load compress %}
<html>
<head>
<meta charset="utf-8">
<title>
{% block title %}Онлайн-курсы Lil School{% endblock title%}
</title>
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="theme-color" content="#fff">
<meta name="format-detection" content="telephone=no">
<meta name="description" content="{% block description %}Онлайн-курсы Lil School{% endblock description%}">
<!--Open Graph data-->
<meta property="og:title" content="{% block ogtitle %}Онлайн-курсы Lil School{% endblock ogtitle %}">
{% comment %} <meta property="og:type" content="article"> {% endcomment %}
<meta property="og:url" content="{% block ogurl %}{{ request.build_absolute_uri }}{% endblock ogurl %}">
<meta property="og:image" content="{% block ogimage %}http://{% setting 'MAIN_HOST' %}{% static 'img/video-1.jpg' %}{% endblock ogimage %}">
<meta property="og:image:width" content="{% block ogimage-width %}597{% endblock ogimage-width %}" />
<meta property="og:image:height" content="{% block ogimage-height %}318{% endblock ogimage-height %}" />
<meta property="og:description" content="{% block ogdescription %}Lil School — первая образовательная онлайн-платформа креативного мышления для детей{% endblock ogdescription %}">
<meta property="og:site_name" content="Онлайн-курсы Lil School">
<meta property="og:locale" content="ru_RU">
{% comment %} <meta property="fb:admins" content="Facebook numeric ID"> {% endcomment %}
<meta name="csrf-token" content="{{ csrf_token }}">
<meta name="yandex-verification" content="bb471d5abd9fdec7" />
<meta name="google-site-verification" content="3ULNxGYLRXUpDpKuZgMLTTrXAJx7UEzwAXseCcfdm1s" />
{% compress css %}
<link rel="stylesheet" media="all" href={% static "app.css" %}>
{% endcompress %}
<link rel="shortcut icon" type="image/png" href="{% static 'img/favicon.png' %}"/>
<script>
var viewportmeta = document.querySelector('meta[name="viewport"]');
if (viewportmeta) {
if (screen.width <= 360) {
var newScale = screen.width / 360;
viewportmeta.content = 'width=360, minimum-scale=' + newScale + ', user-scalable=0, maximum-scale=1, initial-scale=' + newScale + '';
}
else {
viewportmeta.content = 'width=device-width, maximum-scale=1.6, initial-scale=1.0';
}
}
</script>
<!-- Facebook Pixel Code -->
<script>
!function(f,b,e,v,n,t,s)
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];
s.parentNode.insertBefore(t,s)}(window,document,'script',
'https://connect.facebook.net/en_US/fbevents.js');
fbq('init', '194961257900508');
fbq('track', 'PageView');
</script>
<noscript>
<img height="1" width="1"
src="https://www.facebook.com/tr?id=194961257900508&ev=PageView
&noscript=1"/>
</noscript>
<!-- End Facebook Pixel Code -->
<!-- Global site tag (gtag.js) - Google Ads: 808701460 -->
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-808701460"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'AW-808701460');
</script>
<!-- Yandex.Metrika counter -->
<script type="text/javascript" >
(function (d, w, c) {
(w[c] = w[c] || []).push(function() {
try {
w.yaCounter49354039 = new Ya.Metrika2({
id:49354039,
clickmap:true,
trackLinks:true,
accurateTrackBounce:true,
webvisor:true
});
} catch(e) { }
});
var n = d.getElementsByTagName("script")[0],
s = d.createElement("script"),
f = function () { n.parentNode.insertBefore(s, n); };
s.type = "text/javascript";
s.async = true;
s.src = "https://mc.yandex.ru/metrika/tag.js";
if (w.opera == "[object Opera]") {
d.addEventListener("DOMContentLoaded", f, false);
} else { f(); }
})(document, window, "yandex_metrika_callbacks2");
</script>
<noscript><div><img src="https://mc.yandex.ru/watch/49354039" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
<!-- /Yandex.Metrika counter -->
{% include "templates/blocks/mixpanel.html" %}
{% block layer_head %}{% endblock layer_head %}
</head>
<body>
{% block layer_body %}
{% endblock layer_body %}
</body>
</html>

@ -0,0 +1,84 @@
{% extends "templates/lilcity/layer.html" %} {% load static %}
{% block title %}School LIL.CITY{% endblock title %}
{% block layer_head %}
<style>
</style>
{% endblock layer_head %}
{% block layer_body %}
<div class="main main_default" style="
min-height: auto;
padding-top: 20px;
padding-bottom: 0;
margin-top: 0;">
<div class="main__center center">
<a href="{% url 'index' %}?utm_source=posadochnaya_stranica&utm_medium=main_page&utm_campaign=main_page">
<div style="
height: 90px;
background: url({% static 'img/school-lil-city.svg' %}) no-repeat center 0;
"></div>
</a>
<div class="main__title">
<span class="main__bold">Lil School</span> — первая образовательная онлайн-платформа креативного мышления для детей! 5+
</div>
</div>
</div>
<div class="section">
<div class="section__center center">
<div style="display: flex; flex-direction: column;">
<a class="btn" style="margin: 10px 0;"
href="{% url 'index' %}?utm_source=posadochnaya_stranica&utm_medium=probniy_urok&utm_campaign=probniy_urok">
Бесплатный пробный урок</a>
<a class="btn" style="margin: 10px 0;"
href="{% url 'school:school' %}/?utm_source=posadochnaya_stranica&utm_medium=onlayn_shkola&utm_campaign=onlayn_shkola">
Онлайн школа</a>
<a class="btn" style="margin: 10px 0;"
href="{% url 'courses' %}/?utm_source=posadochnaya_stranica&utm_medium=Videokursy&utm_campaign=Videokursy">
Видеокурсы</a>
<a class="btn" style="margin: 10px 0;"
href="{% url 'gift-certificates' %}?utm_source=posadochnaya_stranica&utm_medium=Sertifikaty&utm_campaign=Sertifikaty">
Подарочные сертификаты</a>
<a class="btn" style="margin: 10px 0;"
href="{% url 'course' 'metodicheskoe-posobie-dlya-razvitiya-kreativnogo-mishleniya-detey' %}?utm_source=posadochnaya_stranica&utm_medium=Metodichka&utm_campaign=Metodichka">
Методическое пособие</a>
<a class="btn" style="margin: 10px 0;"
href="{% url 'course' 'kak-stat-illiustratorom' %}?utm_source=posadochnaya_stranica&utm_medium=Kurs_sashaKru&utm_campaign=Kurs_sashaKru">
Курс иллюстрации от SashaKru
</a>
</div>
</div>
</div>
<div class="section">
<div class="section__center center">
<div class="title title_center">Подписывайтесь на наши социальные сети</div>
</div>
</div>
<div style="font-size: 2.4em; display: flex; margin-bottom: 30px;">
<div style="margin: 0 auto;">
<a target="_blank" href="{{ config.SERVICE_INSTAGRAM_URL }}" style="margin: 0 20px; display: inline-block;">
<svg class="icon icon-instagram">
<use xlink:href="{% static 'img/sprite.svg' %}#icon-instagram"></use>
</svg>
</a>
<a target="_blank" href="{{ config.SERVICE_TWITTER_URL }}" style="margin: 0 20px; display: inline-block;">
<svg class="icon icon-twitter">
<use xlink:href="{% static 'img/sprite.svg' %}#icon-twitter"></use>
</svg>
</a>
<a target="_blank" href="{{ config.SERVICE_FB_URL }}" style="margin: 0 20px; display: inline-block;">
<svg class="icon icon-fb">
<use xlink:href="{% static 'img/sprite.svg' %}#icon-fb"></use>
</svg>
</a>
<a target="_blank" href="{{ config.SERVICE_YOUTUBE_URL }}" style="margin: 0 20px; display: inline-block;">
<svg class="icon icon-youtube">
<use xlink:href="{% static 'img/sprite.svg' %}#icon-youtube"></use>
</svg>
</a>
</div>
</div>
{% endblock layer_body %}

@ -37,7 +37,7 @@ from apps.payment.views import (
SchoolBuyView, GiftCertificatesView, GiftCertificateBuyView,
GiftCertificateBuySuccessView, GiftCertificateGetView, CloudPaymentsTestView, PaymentSuccessView)
from .views import AboutView, IndexView, SchoolSchedulesView
from .views import AboutView, IndexView, SchoolSchedulesView, LinksView
# TODO trim slash in the end
urlpatterns = [
@ -100,6 +100,7 @@ urlpatterns = [
name='gift-certificate-payment-success'),
path('gift-certificate/<str:slug>/get', GiftCertificateGetView.as_view(), name='gift-certificate-get'),
path('faq', FAQView.as_view(), name='faq'),
path('links', LinksView.as_view(), name='links'),
]

@ -117,3 +117,7 @@ class SchoolSchedulesView(TemplateView):
context = super().get_context_data()
context['school_schedules'] = SchoolSchedule.objects.all()
return context
class LinksView(TemplateView):
template_name = 'templates/lilcity/links.html'

@ -528,8 +528,7 @@
api.saveCourse(this.course, this.accessToken)
.then((response) => {
this.courseSaving = false;
this.course = api.convertCourseJson(response.data);
this.course.live = this.live;
this.processCourseJson(response.data);
})
.catch((err) => {
this.courseSaving = false;
@ -804,10 +803,7 @@
.catch((err) => {
this.courseSyncHook = false;
this.courseSaving = false;
//console.error(err);
this.changeSavingStatus(true, true);
// alert('Произошло что-то страшное: '+err.toString());
//console.log(err.response.data);
if(err.response) {
for(let i in err.response.data) {
if(typeof err.response.data[i] === "array") {
@ -959,19 +955,7 @@
}
});
// if (this.courseId) {
// this.loadCourse().then(()=>{this.updateViewSection(window.location, 'load')}).catch(()=>{
// this.updateViewSection(window.location, 'load err')
// })
// } else {
// this.loadCourseDraft().then(()=>{this.updateViewSection(window.location, 'load draft')}).catch(()=>{
// this.updateViewSection(window.location, 'load draft err')
// });
// }
//console.log('wait promises');
Promise.all(promises.map(p => p.catch(e => e))).then(()=>{
//console.log('promises end');
this.mounting = false;
let load;
if (this.courseId) {
@ -987,9 +971,6 @@
this.updateViewSection(window.location, 'load err '+this.courseId)
})
});
//console.log('mounted end');
// this.updateViewSection(window.location);
},
computed: {
displayPrice: {
@ -1019,17 +1000,12 @@
watch: {
'course': {
handler: function (newValue, oldValue) {
// //console.log('watch', JSON.stringify(newValue), JSON.stringify(oldValue));
// Если курс загрузился и есть ID - делаем кнопки превью и публикации активными
//console.log('newValue.id', newValue.id);
if (newValue.id) {
// //console.log('newValue.id disabled remove', newValue.id);
$('#course-redactor__preview-button').removeAttr('disabled');
$('#course-redactor__publish-button').removeAttr('disabled');
}
// //console.log('courseSyncHook', this.courseSyncHook);
if (this.courseSyncHook || this.courseLoading) {
//console.log('abort save draft', this.courseSyncHook, this.courseLoading);
return;
}
this.saveCourseDraft(newValue, oldValue);

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

@ -90,7 +90,7 @@ export const api = {
});
},
saveCourse: (courseObject, accessToken) => {
const isAdding = (!courseObject.hasOwnProperty('id') || !courseObject.hasOwnProperty('id'));
const isAdding = !courseObject.id;
let deferredStart = null;
if (courseObject.is_deferred) {
@ -114,7 +114,7 @@ export const api = {
access_duration: courseObject.is_paid && courseObject.access_duration || 0,
is_featured: courseObject.is_featured,
slug: (courseObject.slug || '').toLowerCase(),
date: (courseObject.date) ? courseObject.date.value:null,
date: (courseObject.date) ? courseObject.date.value : null,
stream: courseObject.stream,
cover: courseObject.coverImageId ? courseObject.coverImageId : null,
gallery: {
@ -212,14 +212,14 @@ export const api = {
},
convertContentJson: (contentJson, forSaving) => {
if(forSaving){
return contentJson.map((block, index) => {
let content = contentJson.map((block, index) => {
if (block.type === 'text') {
return {
'type': 'text',
'data': {
'id': block.data.id ? block.data.id : null,
'uuid': block.uuid,
'position': ++index,
'position': index + 1,
'title': block.data.title,
'txt': block.data.text,
}
@ -230,7 +230,7 @@ export const api = {
'data': {
'id': block.data.id ? block.data.id : null,
'uuid': block.uuid,
'position': ++index,
'position': index + 1,
'title': block.data.title,
'img': block.data.image_id,
}
@ -241,7 +241,7 @@ export const api = {
'data': {
'id': block.data.id ? block.data.id : null,
'uuid': block.uuid,
'position': ++index,
'position': index + 1,
'title': block.data.title,
'img': block.data.image_id,
'txt': block.data.text,
@ -253,7 +253,7 @@ export const api = {
'data': {
'id': block.data.id ? block.data.id : null,
'uuid': block.uuid,
'position': ++index,
'position': index + 1,
'title': block.data.title,
'images': api.convertGalleryImagesJson(block.data.images),
}
@ -271,6 +271,7 @@ export const api = {
}
}
});
return content;
}
return contentJson.sort((a, b) => {
if (a.position < b.position) {

@ -14,16 +14,19 @@ $(document).ready(function () {
});
return;
}
// Обработчик выбора пола
let genderInput = $('#gender')
$('div.js-select-option[data-gender-option]').on('click', function (e) {
e.preventDefault();
const currentGender = $(this).attr('data-gender');
$('[data-gender]').removeClass('active');
$(`[data-gender=${currentGender}]`).addClass('active');
genderInput.val(currentGender)
});
$('.js-select-drop[data-gender-select]').each((i, el) => {
var $el = $(el);
var $input = $($el.data('input'));
$el.find('div.js-select-option[data-gender-option]').on('click', function (e) {
e.preventDefault();
const currentGender = $(this).attr('data-gender');
$('[data-gender]').removeClass('active');
$(`[data-gender=${currentGender}]`).addClass('active');
$input.val(currentGender)
});
})
$('#user-photo-upload').change(file => {
const input = file.target;

@ -3266,6 +3266,40 @@ a.grey-link
+m
display: block
.fill-profile
width: 100%
display: flex
align-items: center
position: relative
padding: 40px 35px
background: url(../img/fill-profile-gramota.png) center bottom no-repeat
&:before
content: ''
position: absolute
top: 0
left: 0
right: 0
bottom: 0
opacity: .8
z-index: -2
background-image: linear-gradient(-225deg, #FFE2EB 0%, #D8F5F5 100%)
&__text
flex: 0 0 300px
font-size: 18px
&__img
flex: 1
&__btn
flex: 0 0 205px
text-align: right
&__arrow
flex: 0 0 50px
text-align: right
.tabs
&__nav
display: flex
@ -4510,3 +4544,16 @@ a
background: $cyan
&__preview.theme_violet2
background: $viol2
.user-child-form
padding: 30px 80px 40px 160px
margin: 30px -80px 30px -160px
background: url(../img/profile-edit-child-form.png) no-repeat 7px bottom white
border-radius: 20px
box-shadow: 0 10px 24px 0 rgba(0, 0, 0, 0.05)
&__description
margin-bottom: 40px
margin-top: -20px
color: #333333
font-size: 12px

Loading…
Cancel
Save