diff --git a/apps/user/forms.py b/apps/user/forms.py index 6066c132..b56bf133 100644 --- a/apps/user/forms.py +++ b/apps/user/forms.py @@ -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', ) diff --git a/apps/user/migrations/0030_auto_20190318_1320.py b/apps/user/migrations/0030_auto_20190318_1320.py new file mode 100644 index 00000000..7f926b45 --- /dev/null +++ b/apps/user/migrations/0030_auto_20190318_1320.py @@ -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='Фамилия ребенка'), + ), + ] diff --git a/apps/user/models.py b/apps/user/models.py index 5713e6db..87d43490 100644 --- a/apps/user/models.py +++ b/apps/user/models.py @@ -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' diff --git a/apps/user/templates/user/profile-settings.html b/apps/user/templates/user/profile-settings.html index 7de0e74c..2f3a4b66 100644 --- a/apps/user/templates/user/profile-settings.html +++ b/apps/user/templates/user/profile-settings.html @@ -76,15 +76,6 @@
{{ error }}
{% endfor %} -
-
Телефон
-
- -
- {% for error in form.phone.errors %} -
{{ error }}
- {% endfor %} -
Ссылка
@@ -96,6 +87,82 @@
{{ error }}
{% endfor %}
+
+ +
+
Карточка ребёнка
+
+ Вся информация конфиденциальна и не передается третьим лицам. Необходима только для персонализации наград, + поздравлений с Днем Рождения и других персонализированных акций. +
+
+
+
ИМЯ РЕБЕНКА
+
+ +
+ {% for error in form.child_first_name.errors %} +
{{ error }}
+ {% endfor %} +
+
+
ФАМИЛИЯ РЕБЕНКА
+
+ +
+ {% for error in form.child_last_name.errors %} +
{{ error }}
+ {% endfor %} +
+
+
+
+
ДАТА РОЖДЕНИЯ
+
+ +
+ {% for error in form.child_birthday.errors %} +
{{ error }}
+ {% endfor %} +
+
+
ПОЛ
+
+
+
+ {% if user.child_gender == 'f' %}Ж{% elif user.child_gender == 'm' %}M{% else %}М / Ж{% endif %} +
+
+
+
М
+
+
+
Ж
+
+
+ +
+
+ {% for error in form.child_gender.errors %} +
{{ error }}
+ {% endfor %} +
+
+
+
Телефон
+
+ +
+ {% for error in form.phone.errors %} +
{{ error }}
+ {% endfor %} +
+
+ +
ГОРОД
@@ -133,7 +200,7 @@
{% if user.gender == 'f' %}Ж{% elif user.gender == 'm' %}M{% else %}М / Ж{% endif %}
-
+
М
@@ -180,7 +247,7 @@ {% for error in form.old_password.errors %}
{{ error }}
{% endfor %} -
+
НОВЫЙ ПАРОЛЬ
@@ -189,7 +256,7 @@ {% for error in form.new_password1.errors %}
{{ error }}
{% endfor %} -
+
ПОДТВЕРДИТЬ НОВЫЙ ПАРОЛЬ
@@ -198,7 +265,7 @@ {% for error in form.new_password2.errors %}
{{ error }}
{% endfor %} -
+
Соцсети
diff --git a/apps/user/templates/user/profile.html b/apps/user/templates/user/profile.html index bb3b909a..55739737 100644 --- a/apps/user/templates/user/profile.html +++ b/apps/user/templates/user/profile.html @@ -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 %} +
+
+
+
Хотите получать грамоты Lil School
по окончании месяца обучения?
+
+ + +
+
+
+{% endif %} +
diff --git a/project/templates/lilcity/index.html b/project/templates/lilcity/index.html index acb8efc4..1e406194 100644 --- a/project/templates/lilcity/index.html +++ b/project/templates/lilcity/index.html @@ -1,40 +1,18 @@ +{% extends "templates/lilcity/layer.html" %} + {% load static %} {% load setting from settings %} {% load compress %} - - - - - - {% block title %}Онлайн-курсы Lil School{% endblock title%} - - - - - - - - - {% comment %} {% endcomment %} - - - - - - - - {% comment %} {% endcomment %} - - - - - - {% compress css %} - - {% endcompress %} - - +{% block layer_head %} + + - - - - - - - - - - - - - - - {% include "templates/blocks/mixpanel.html" %} {% block head %}{% endblock head %} - - +{% endblock layer_head %} + +{% block layer_body %} {% include "templates/blocks/social.html" %} {% include "templates/blocks/baner.html" %}
@@ -160,5 +62,4 @@ {% block foot %}{% endblock foot %} {% block foot_js %}{% endblock foot_js %} - - +{% endblock layer_body %} diff --git a/project/templates/lilcity/layer.html b/project/templates/lilcity/layer.html new file mode 100644 index 00000000..a94ffab0 --- /dev/null +++ b/project/templates/lilcity/layer.html @@ -0,0 +1,114 @@ + +{% load static %} +{% load setting from settings %} +{% load compress %} + + + + + {% block title %}Онлайн-курсы Lil School{% endblock title%} + + + + + + + + + {% comment %} {% endcomment %} + + + + + + + + {% comment %} {% endcomment %} + + + + + + {% compress css %} + + {% endcompress %} + + + + + + + + + + + + + + + + + {% include "templates/blocks/mixpanel.html" %} + {% block layer_head %}{% endblock layer_head %} + + + {% block layer_body %} + {% endblock layer_body %} + + diff --git a/project/templates/lilcity/links.html b/project/templates/lilcity/links.html new file mode 100644 index 00000000..54445428 --- /dev/null +++ b/project/templates/lilcity/links.html @@ -0,0 +1,84 @@ +{% extends "templates/lilcity/layer.html" %} {% load static %} + +{% block title %}School LIL.CITY{% endblock title %} + +{% block layer_head %} + +{% endblock layer_head %} + +{% block layer_body %} +
+
+ +
+
+
+ Lil School — первая образовательная онлайн-платформа креативного мышления для детей! 5+ +
+
+
+ + +
+
+
Подписывайтесь на наши социальные сети
+
+
+ +{% endblock layer_body %} diff --git a/project/urls.py b/project/urls.py index 9b0a5b00..6e71969e 100644 --- a/project/urls.py +++ b/project/urls.py @@ -37,7 +37,7 @@ from apps.payment.views import ( SchoolBuyView, GiftCertificatesView, GiftCertificateBuyView, GiftCertificateBuySuccessView, GiftCertificateGetView) -from .views import AboutView, IndexView, SchoolSchedulesView +from .views import AboutView, IndexView, SchoolSchedulesView, LinksView # TODO trim slash in the end urlpatterns = [ @@ -98,6 +98,7 @@ urlpatterns = [ name='gift-certificate-payment-success'), path('gift-certificate//get', GiftCertificateGetView.as_view(), name='gift-certificate-get'), path('faq', FAQView.as_view(), name='faq'), + path('links', LinksView.as_view(), name='links'), ] diff --git a/project/views.py b/project/views.py index 7404e317..224aeade 100644 --- a/project/views.py +++ b/project/views.py @@ -123,3 +123,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' diff --git a/web/src/img/fill-profile-gramota.png b/web/src/img/fill-profile-gramota.png new file mode 100644 index 00000000..ceab2aae Binary files /dev/null and b/web/src/img/fill-profile-gramota.png differ diff --git a/web/src/img/profile-edit-child-form.png b/web/src/img/profile-edit-child-form.png new file mode 100644 index 00000000..80da21e4 Binary files /dev/null and b/web/src/img/profile-edit-child-form.png differ diff --git a/web/src/js/pages/profile.js b/web/src/js/pages/profile.js index 9ac8120a..3156c84b 100644 --- a/web/src/js/pages/profile.js +++ b/web/src/js/pages/profile.js @@ -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; diff --git a/web/src/sass/_common.sass b/web/src/sass/_common.sass index 05759516..70e754e6 100755 --- a/web/src/sass/_common.sass +++ b/web/src/sass/_common.sass @@ -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