From d85926213d547ddf99ef7dc52353f57638e3b5f3 Mon Sep 17 00:00:00 2001 From: gzbender Date: Mon, 24 Jun 2019 13:57:27 +0300 Subject: [PATCH 1/6] =?UTF-8?q?=D1=81=D0=BB=D0=B0=D0=B9=D0=B4=D0=B5=D1=80?= =?UTF-8?q?=20=D0=B8=D0=B7=20=D0=B1=D0=B0=D0=BD=D0=BD=D0=B5=D1=80=D0=BE?= =?UTF-8?q?=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/v1/serializers/content.py | 3 + apps/content/admin.py | 4 + .../migrations/0027_auto_20190621_1107.py | 29 ++++ apps/content/models.py | 12 +- apps/course/templates/course/courses.html | 1 + apps/course/views.py | 2 + project/templates/blocks/banners.html | 38 ++++++ .../lilcity/{main.html => home.html} | 0 project/templates/lilcity/index.html | 1 - project/views.py | 6 +- web/package.json | 1 + web/src/js/app.js | 15 +-- web/src/js/modules/common.js | 4 +- web/src/sass/_common.sass | 125 ++++-------------- 14 files changed, 123 insertions(+), 118 deletions(-) create mode 100644 apps/content/migrations/0027_auto_20190621_1107.py create mode 100644 project/templates/blocks/banners.html rename project/templates/lilcity/{main.html => home.html} (100%) diff --git a/api/v1/serializers/content.py b/api/v1/serializers/content.py index f3553867..b2d47d15 100644 --- a/api/v1/serializers/content.py +++ b/api/v1/serializers/content.py @@ -37,8 +37,11 @@ class BannerSerializer(serializers.ModelSerializer): 'image', 'use', 'color', + 'color2', 'stretch_image', 'future_date', + 'pages', + 'main_banner', 'created_at', 'update_at', ) diff --git a/apps/content/admin.py b/apps/content/admin.py index 84a91f3e..a407d671 100644 --- a/apps/content/admin.py +++ b/apps/content/admin.py @@ -19,6 +19,10 @@ class BannerAdmin(admin.ModelAdmin): 'button_text', 'url', 'image', + 'color', + 'color2', + 'pages', + 'main_banner', ) diff --git a/apps/content/migrations/0027_auto_20190621_1107.py b/apps/content/migrations/0027_auto_20190621_1107.py new file mode 100644 index 00000000..966233c0 --- /dev/null +++ b/apps/content/migrations/0027_auto_20190621_1107.py @@ -0,0 +1,29 @@ +# Generated by Django 2.0.7 on 2019-06-21 11:07 + +import django.contrib.postgres.fields +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('content', '0026_banner_stretch_image'), + ] + + operations = [ + migrations.AddField( + model_name='banner', + name='color2', + field=models.CharField(blank=True, default='', max_length=7), + ), + migrations.AddField( + model_name='banner', + name='main_banner', + field=django.contrib.postgres.fields.ArrayField(base_field=models.IntegerField(), blank=True, default=[], size=None), + ), + migrations.AddField( + model_name='banner', + name='pages', + field=django.contrib.postgres.fields.ArrayField(base_field=models.IntegerField(), blank=True, default=[], size=None), + ), + ] diff --git a/apps/content/models.py b/apps/content/models.py index 872d8044..5d93a2d7 100644 --- a/apps/content/models.py +++ b/apps/content/models.py @@ -5,6 +5,7 @@ from django.db import models from django.contrib.auth import get_user_model from django.urls import reverse_lazy from django.utils import timezone +from django.contrib.postgres.fields import ArrayField from imagekit.models import ImageSpecField from imagekit.processors import ResizeToCover @@ -141,27 +142,28 @@ class GalleryImage(models.Model): class Banner(models.Model): + PAGE_INDEX = 1 + PAGE_COURSES = 2 + text = models.TextField() button_text = models.CharField(max_length=50) url = models.URLField() image = models.ImageField() use = models.BooleanField(default=False) color = models.CharField(max_length=7, blank=True, default='') + color2 = models.CharField(max_length=7, blank=True, default='') stretch_image = models.BooleanField(default=True) future_date = models.DateTimeField(blank=True, null=True) created_at = models.DateTimeField(auto_now_add=True) update_at = models.DateTimeField(auto_now=True) + pages = ArrayField(models.IntegerField(), default=[], blank=True) + main_banner = ArrayField(models.IntegerField(), default=[], blank=True) class Meta: verbose_name = 'Банер' verbose_name_plural = 'Банеры' ordering = ('-created_at',) - def save(self, *args, **kwargs): - if self.use: - Banner.objects.filter(use=True).update(use=False) - return super().save(*args, **kwargs) - class Contest(models.Model): title = models.CharField(max_length=255) diff --git a/apps/course/templates/course/courses.html b/apps/course/templates/course/courses.html index afeba814..64720f65 100644 --- a/apps/course/templates/course/courses.html +++ b/apps/course/templates/course/courses.html @@ -4,6 +4,7 @@ {% block ogimage %}http://{{request.META.HTTP_HOST}}{% static 'img/og_courses.jpg' %}{% endblock ogimage %} {% block content %} + {% include "templates/blocks/banners.html" %}
Онлайн-курсы LilCity
diff --git a/apps/course/views.py b/apps/course/views.py index 73bdeab1..9ed23e92 100644 --- a/apps/course/views.py +++ b/apps/course/views.py @@ -15,6 +15,7 @@ from django.views.decorators.http import require_http_methods from django.utils.translation import gettext as _ from django.utils.timezone import now +from apps.content.models import Banner from apps.payment.models import AuthorBalance, CoursePayment from .models import Course, Like, Lesson, CourseComment, LessonComment, Category from .filters import CourseFilter @@ -318,6 +319,7 @@ class CoursesView(ListView): context = super().get_context_data() filtered = CourseFilter(self.request.GET) context.update(filtered.data) + context['banners'] = Banner.objects.filter(use=True) context['course_items'] = Course.shuffle(context.get('course_items')) context['ages'] = Course.AGE_CHOICES[1:] age = context.get('age') diff --git a/project/templates/blocks/banners.html b/project/templates/blocks/banners.html new file mode 100644 index 00000000..c0120447 --- /dev/null +++ b/project/templates/blocks/banners.html @@ -0,0 +1,38 @@ + + {% for banner in banners %} + + + + {% endfor %} +
+
diff --git a/project/templates/lilcity/main.html b/project/templates/lilcity/home.html similarity index 100% rename from project/templates/lilcity/main.html rename to project/templates/lilcity/home.html diff --git a/project/templates/lilcity/index.html b/project/templates/lilcity/index.html index cca2d6fd..1d32d684 100644 --- a/project/templates/lilcity/index.html +++ b/project/templates/lilcity/index.html @@ -32,7 +32,6 @@ {% block layer_body %} {% include "templates/blocks/social.html" %} - {% include "templates/blocks/banner.html" %}
{% include "templates/blocks/header.html" %}
diff --git a/project/views.py b/project/views.py index 93a87f39..13b1c756 100644 --- a/project/views.py +++ b/project/views.py @@ -11,6 +11,7 @@ from paymentwall.pingback import Pingback from apps.course.models import Course from apps.school.models import SchoolSchedule from apps.payment.models import SchoolPayment, UserGiftCertificate, Payment, DrawingCampPayment +from apps.content.models import Banner User = get_user_model() @@ -20,7 +21,7 @@ class AboutView(TemplateView): class IndexView(TemplateView): - template_name = 'templates/lilcity/main.html' + template_name = 'templates/lilcity/home.html' def get_context_data(self): referrer = self.request.GET.get('referrer') @@ -98,7 +99,10 @@ class IndexView(TemplateView): review_images = list(map(str, range(1, 107))) shuffle(review_images) + banners = Banner.objects.filter(use=True) + context.update({ + 'banners': banners, 'is_drawing_camp': True, 'review_images': review_images, 'gift_certificate': user_gift_certificate.gift_certificate if user_gift_certificate else None, diff --git a/web/package.json b/web/package.json index eaa18164..9c71cc60 100755 --- a/web/package.json +++ b/web/package.json @@ -61,6 +61,7 @@ "validator": "^9.2.0", "vue": "^2.5.13", "vue-autosize": "^1.0.2", + "vue-awesome-swiper": "^3.1.3", "vuedraggable": "^2.16.0", "vuejs-datepicker": "^0.9.25", "vuelidate": "^0.6.1" diff --git a/web/src/js/app.js b/web/src/js/app.js index 14e66e65..a59403d6 100644 --- a/web/src/js/app.js +++ b/web/src/js/app.js @@ -3,6 +3,7 @@ */ import 'ilyabirman-likely/release/likely.js'; import 'ilyabirman-likely/release/likely.css'; +import 'swiper/dist/css/swiper.css'; import "./modules/common"; import "./modules/header"; import "./modules/search"; @@ -27,6 +28,7 @@ import Comments from '../components/Comments'; import Likes from '../components/blocks/Likes.vue'; import FAQ from '../components/FAQ.vue'; import Countdown from '../components/blocks/Countdown.vue'; +import { swiper, swiperSlide } from 'vue-awesome-swiper'; Vue.use(Vuelidate); Vue.use(VueAutosize); @@ -41,6 +43,9 @@ const components = { 'comments': Comments, 'faq': FAQ, 'vue-datepicker': DatePicker, + 'countdown': Countdown, + swiper, + swiperSlide, }; Object.assign(components, window.LIL_STORE.components); @@ -54,13 +59,3 @@ const app = new Vue({ }, components: components }); - -const bannerApp = new Vue({ - el: '.banner', - data() { - return { - store: window.LIL_STORE, - } - }, - components: {'countdown': Countdown,} -}); diff --git a/web/src/js/modules/common.js b/web/src/js/modules/common.js index 5faffb0b..1700b113 100644 --- a/web/src/js/modules/common.js +++ b/web/src/js/modules/common.js @@ -24,11 +24,11 @@ $(document).ready(function () { }); // Инициируем начальное состояние шапки - updateHeader(); + /* updateHeader(); $(window).on('scroll', function () { updateHeader(); - }); + }); */ //===========BANNERS=============== const $banner = $('[data-banner]'); diff --git a/web/src/sass/_common.sass b/web/src/sass/_common.sass index 0e8435db..1457d2f6 100755 --- a/web/src/sass/_common.sass +++ b/web/src/sass/_common.sass @@ -334,7 +334,7 @@ a.btn width: 100% .header - position: fixed + position: absolute left: 0 right: 0 z-index: 100 @@ -664,7 +664,6 @@ a.btn display: flex position: relative min-height: 500px - margin-top: -100px padding: 120px 0 50px background-position: 50% 50% background-repeat: no-repeat @@ -4379,142 +4378,70 @@ a width: 640px; height: 360px; +.banners + margin-top: -100px .banner - height: 140px + padding-top: 100px text-align: center color: #fff position: relative - +m - height: auto - &__bg - background-repeat: no-repeat - position: absolute - width: 100% - height: 100% - left: 0 - top: 0 - &_countdown - +m - height: 140px - &__image-wrap - background: -moz-linear-gradient(top, rgba(0,0,0,0) 0%, rgba(159,159,159,0) 72%, rgba(221,221,221,0.65) 100%) - background: -webkit-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(159,159,159,0) 72%,rgba(221,221,221,0.65) 100%) - background: linear-gradient(to bottom, rgba(0,0,0,0) 0%,rgba(159,159,159,0) 72%,rgba(221,221,221,0.65) 100%) - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00000000', endColorstr='#a6dddddd',GradientType=0 ) - width: 100% - height: 100% - &__image - +m - width: 100% - display: block - margin: 0 auto - &_colored &__image - +m - max-width: 100% - width: auto - opactiy: 0.8 &__content - position: absolute - width: 100% - margin-top: 50px - +m - margin-top: 0px - top: 0 - &_countdown &__content - margin-top: 15px - +m - margin-top: 5px - &__content-center width: 1024px - margin: 0 auto + padding: 70px 20px 0 display: flex - padding: 0 40px + margin: 0 auto + height: 240px +t width: 100% +m width: 100% - padding: 0 10px - &_countdown &__content-center - +m - display: block &__text font-size: 30px - text-shadow: 0px 0px 3px rgba(0, 0, 0, 1) - +m - font-size: 16px - &_countdown &__text - font-size: 22px text-shadow: none color: black - width: 300px +m font-size: 16px width: auto font-weight: bold &__link - display: block - color: #fff - font-size: 20px - text-shadow: 0px 0px 3px rgba(0, 0, 0, 1) - margin-top: 20px - +m - margin-top: 0px - font-size: 16px - &_countdown &__link font-size: 15px color: black text-shadow: none background: white - font-weight: bold - padding: 7px 20px - border-radius: 20px + padding: 12px 22px + border-radius: 25px border: 1px solid #ddd text-align: center - margin-top: 10px + margin-top: 50px display: inline-block + text-transform: uppercase + font-family: 'ProximaNova-Bold' + box-shadow: 0 10px 20px 0 rgba(0, 0, 0, 0.05), 0 9px 24px 0 rgba(33, 74, 211, 0.1) +m margin-top: 25px - &_countdown &__link:hover + &__link:hover background: #ddd - &__hide - position: absolute - right: 5px - top: 5px - display: block - color: #fff - text-shadow: 0px 0px 3px rgba(0, 0, 0, 1) - text-transform: uppercase - border-bottom: 1px dotted #fff - opacity: 0.3 - +m - font-size: 11px + &__image-column + flex: 50% + text-align: center + position: relative + & img + position: absolute + bottom: 0 + transform: translateX(-50%) + left: 50% &__text-column - flex: 1 - &_countdown &__text-column + flex: 50% text-align: left - +m - text-align: center - &__countdown-column - padding: 0 20px - +m - padding: 0 - display: flex - & > div:nth-child(1) - +m - padding: 0 10px - border-radius: 3px - background: rgba(255, 255, 255, 0.3) - margin-right: 10px - & > div:nth-child(2) - +m - flex: 1 &__countdown-title color: black font-size: 15px margin-bottom: 5px +m font-size: 15px + &__countdown-wrap + display: inline-block &__countdown display: flex color: black From d851d7cc8cb1a2a4d868002533f7fd519f55e34e Mon Sep 17 00:00:00 2001 From: gzbender Date: Tue, 25 Jun 2019 16:51:37 +0300 Subject: [PATCH 2/6] =?UTF-8?q?=D1=81=D0=BB=D0=B0=D0=B9=D0=B4=D0=B5=D1=80?= =?UTF-8?q?=20=D0=B8=D0=B7=20=D0=B1=D0=B0=D0=BD=D0=BD=D0=B5=D1=80=D0=BE?= =?UTF-8?q?=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/content/models.py | 8 ++++ apps/course/templates/course/courses.html | 3 +- apps/course/views.py | 2 +- .../templates/school/summer_school.html | 11 +++--- apps/school/templates/summer/buy.html | 18 +++++++++ apps/school/templates/summer/online.html | 8 ++-- .../templates/summer/schedule_purchased.html | 3 +- apps/school/views.py | 3 ++ project/templates/blocks/about.html | 39 +------------------ project/templates/blocks/banners.html | 10 ++++- project/templates/blocks/buy.html | 15 +++++++ project/templates/blocks/counters.html | 37 ++++++++++++++++++ project/templates/lilcity/home.html | 12 ++---- project/templates/lilcity/index.html | 3 ++ project/views.py | 4 +- web/src/js/modules/common.js | 34 ---------------- web/src/sass/_common.sass | 39 +++++++------------ 17 files changed, 126 insertions(+), 123 deletions(-) create mode 100644 apps/school/templates/summer/buy.html create mode 100644 project/templates/blocks/buy.html create mode 100644 project/templates/blocks/counters.html diff --git a/apps/content/models.py b/apps/content/models.py index 5d93a2d7..57f744b5 100644 --- a/apps/content/models.py +++ b/apps/content/models.py @@ -3,6 +3,7 @@ from urllib.parse import urlparse from django.conf import settings from django.db import models from django.contrib.auth import get_user_model +from django.db.models.expressions import RawSQL from django.urls import reverse_lazy from django.utils import timezone from django.contrib.postgres.fields import ArrayField @@ -144,6 +145,7 @@ class GalleryImage(models.Model): class Banner(models.Model): PAGE_INDEX = 1 PAGE_COURSES = 2 + PAGE_SCHOOL = 3 text = models.TextField() button_text = models.CharField(max_length=50) @@ -164,6 +166,12 @@ class Banner(models.Model): verbose_name_plural = 'Банеры' ordering = ('-created_at',) + @classmethod + def get_for_page(cls, page): + return Banner.objects.filter(use=True, pages__contains=[page]).annotate( + is_main=RawSQL('main_banner @> %s', ([page],)) + ).order_by('-is_main') + class Contest(models.Model): title = models.CharField(max_length=255) diff --git a/apps/course/templates/course/courses.html b/apps/course/templates/course/courses.html index 64720f65..10a16ff9 100644 --- a/apps/course/templates/course/courses.html +++ b/apps/course/templates/course/courses.html @@ -4,12 +4,13 @@ {% block ogimage %}http://{{request.META.HTTP_HOST}}{% static 'img/og_courses.jpg' %}{% endblock ogimage %} {% block content %} - {% include "templates/blocks/banners.html" %} + {% if not banners|length %}
Онлайн-курсы LilCity
+ {% endif %}
diff --git a/apps/course/views.py b/apps/course/views.py index 9ed23e92..edd6ffa6 100644 --- a/apps/course/views.py +++ b/apps/course/views.py @@ -319,7 +319,7 @@ class CoursesView(ListView): context = super().get_context_data() filtered = CourseFilter(self.request.GET) context.update(filtered.data) - context['banners'] = Banner.objects.filter(use=True) + context['banners'] = Banner.get_for_page(Banner.PAGE_COURSES) context['course_items'] = Course.shuffle(context.get('course_items')) context['ages'] = Course.AGE_CHOICES[1:] age = context.get('age') diff --git a/apps/school/templates/school/summer_school.html b/apps/school/templates/school/summer_school.html index e0e05514..68523315 100644 --- a/apps/school/templates/school/summer_school.html +++ b/apps/school/templates/school/summer_school.html @@ -3,14 +3,15 @@ {% block ogimage %}http://{{request.META.HTTP_HOST}}{% static 'img/og_main.jpg' %}{% endblock %} {% block content %} {% if not is_purchased and not prev_school_payments_exists %} -{% include "../summer/promo.html" %} -{% include "../summer/about.html" %} -{% include "../summer/advantages.html" %} -{% include "../summer/online.html" %} +{% include "../summer/buy.html" %} {% include "../blocks/schedule.html" %} -{% include "templates/blocks/game.html" %} +{% include "../summer/advantages.html" %} +{% include "../summer/about.html" %} {% include "templates/blocks/partners.html" %} {% else %} +{% include 'templates/blocks/messages.html' %} +{% include "../summer/online.html" %} {% include "../summer/schedule_purchased.html" %} +{% include "templates/blocks/partners.html" %} {% endif %} {% endblock %} diff --git a/apps/school/templates/summer/buy.html b/apps/school/templates/summer/buy.html new file mode 100644 index 00000000..a7a7cf71 --- /dev/null +++ b/apps/school/templates/summer/buy.html @@ -0,0 +1,18 @@ + diff --git a/apps/school/templates/summer/online.html b/apps/school/templates/summer/online.html index 53957d3f..03241770 100644 --- a/apps/school/templates/summer/online.html +++ b/apps/school/templates/summer/online.html @@ -1,9 +1,7 @@ {% load static %} - +
-
ВИДЕОУРОКИ
-
В 17.00 (по Мск)
-
Каждый день
-
+
Каждый день в 17:00 (мск)
+
Онлайн-школа это ежедневные видео-уроки на разные темы. Уроки хранятся 7 дней.
diff --git a/apps/school/templates/summer/schedule_purchased.html b/apps/school/templates/summer/schedule_purchased.html index 0994e675..03952d01 100644 --- a/apps/school/templates/summer/schedule_purchased.html +++ b/apps/school/templates/summer/schedule_purchased.html @@ -1,7 +1,7 @@ {% load static %} {% load thumbnail %}
- {% include 'templates/blocks/messages.html' %} +
Расписание
-{% include './last_courses.html' %} diff --git a/apps/school/views.py b/apps/school/views.py index 3fb18699..a915ea1f 100644 --- a/apps/school/views.py +++ b/apps/school/views.py @@ -14,6 +14,7 @@ from django.utils.timezone import now from django.views.generic import ListView, UpdateView, TemplateView, DetailView from django.conf import settings +from apps.content.models import Banner from apps.course.models import Course from apps.payment.models import SchoolPayment, DrawingCampPayment from .models import LiveLesson, SchoolSchedule @@ -233,7 +234,9 @@ class SchoolView(TemplateView): school_schedules_dict[0] = school_schedules_dict.get(7) for ll in prev_live_lessons: ll.school_schedule = school_schedules_dict.get(ll.date.isoweekday()) + context.update({ + 'banners': Banner.get_for_page(Banner.PAGE_SCHOOL), 'online': online, 'prev_live_lessons': prev_live_lessons, 'prev_live_lessons_exists': prev_live_lessons_exists, diff --git a/project/templates/blocks/about.html b/project/templates/blocks/about.html index 71a8b0b6..e2c8b3c4 100644 --- a/project/templates/blocks/about.html +++ b/project/templates/blocks/about.html @@ -1,7 +1,5 @@ -{% load static %} -{% load ruplural from plural %}
-
+

Вы житель мегаполиса и у вас нет времени дополнительно развивать своего ребенка? @@ -12,38 +10,3 @@

- -
-
-
- -
Lil School в цифрах
-
-
-
-
> {{ config.NUMBER_OF_STUDENTS }}
-
{{ config.NUMBER_OF_STUDENTS|ruplural:'ученик,ученика,учеников' }}
-
прошли обучение в Lil School
-
-
-
{{ works_count }}
-
{{ works_count|ruplural:'работа,работы,работ' }}
-
- создано учениками Lil School.
- Большую часть из них легко найти в инстаграм -
-
-
-
{{ config.NUMBER_OF_COUNTRIES }}
-
{{ config.NUMBER_OF_COUNTRIES|ruplural:'страна,страны,стран' }}
-
где живут талантливые ученики Lil School
-
-
-
{{ config.NUMBER_OF_CITIES }}
-
{{ config.NUMBER_OF_CITIES|ruplural:'город,города,городов' }}
-
со всего мира со счастливыми учениками Lil School
-
-
- -
-
diff --git a/project/templates/blocks/banners.html b/project/templates/blocks/banners.html index c0120447..05065e9f 100644 --- a/project/templates/blocks/banners.html +++ b/project/templates/blocks/banners.html @@ -1,4 +1,12 @@ - + {% for banner in banners %} +{% endif %} diff --git a/project/templates/blocks/counters.html b/project/templates/blocks/counters.html new file mode 100644 index 00000000..40198a07 --- /dev/null +++ b/project/templates/blocks/counters.html @@ -0,0 +1,37 @@ +{% load static %} +{% load ruplural from plural %} + +
+
+
+ +
Lil School в цифрах
+
+
+
+
> {{ config.NUMBER_OF_STUDENTS }}
+
{{ config.NUMBER_OF_STUDENTS|ruplural:'ученик,ученика,учеников' }}
+
прошли обучение в Lil School
+
+
+
{{ works_count }}
+
{{ works_count|ruplural:'работа,работы,работ' }}
+
+ создано учениками Lil School.
+ Большую часть из них легко найти в инстаграм +
+
+
+
{{ config.NUMBER_OF_COUNTRIES }}
+
{{ config.NUMBER_OF_COUNTRIES|ruplural:'страна,страны,стран' }}
+
где живут талантливые ученики Lil School
+
+
+
{{ config.NUMBER_OF_CITIES }}
+
{{ config.NUMBER_OF_CITIES|ruplural:'город,города,городов' }}
+
со всего мира со счастливыми учениками Lil School
+
+
+ +
+
diff --git a/project/templates/lilcity/home.html b/project/templates/lilcity/home.html index 2bd38646..e052e724 100644 --- a/project/templates/lilcity/home.html +++ b/project/templates/lilcity/home.html @@ -12,17 +12,13 @@ {% block title %}School LIL.CITY{% endblock title %} {% block content %} - {% include "templates/blocks/promo.html" %} {% include "templates/blocks/messages.html" %} - {% include "templates/blocks/arts.html" %} - {% include "templates/blocks/video.html" %} + {% include "templates/blocks/buy.html" %} {% include "templates/blocks/about.html" %} - {% include "templates/blocks/gallery.html" %} - {% include "templates/blocks/mobile_apps.html" %} - {% include "templates/blocks/online_school.html" %} + {% include "templates/blocks/video.html" %} + {% include "templates/blocks/counters.html" %} {% include "templates/blocks/reviews.html" %} + {% include "templates/blocks/online_school.html" %} {% include "templates/blocks/teachers.html" %} - {% include "templates/blocks/last_courses.html" %} {% include "templates/blocks/partners.html" %} - {% include "templates/blocks/game.html" %} {% endblock content %} diff --git a/project/templates/lilcity/index.html b/project/templates/lilcity/index.html index 1d32d684..222f57ca 100644 --- a/project/templates/lilcity/index.html +++ b/project/templates/lilcity/index.html @@ -35,6 +35,9 @@
{% include "templates/blocks/header.html" %}
+ {% if banners %} + {% include "templates/blocks/banners.html" %} + {% endif %} {% block content %}{% endblock content %}
{% include "templates/blocks/footer.html" %} diff --git a/project/views.py b/project/views.py index 13b1c756..4eac0b91 100644 --- a/project/views.py +++ b/project/views.py @@ -99,10 +99,8 @@ class IndexView(TemplateView): review_images = list(map(str, range(1, 107))) shuffle(review_images) - banners = Banner.objects.filter(use=True) - context.update({ - 'banners': banners, + 'banners': Banner.get_for_page(Banner.PAGE_INDEX), 'is_drawing_camp': True, 'review_images': review_images, 'gift_certificate': user_gift_certificate.gift_certificate if user_gift_certificate else None, diff --git a/web/src/js/modules/common.js b/web/src/js/modules/common.js index 1700b113..961fecce 100644 --- a/web/src/js/modules/common.js +++ b/web/src/js/modules/common.js @@ -23,13 +23,6 @@ $(document).ready(function () { } }); - // Инициируем начальное состояние шапки - /* updateHeader(); - - $(window).on('scroll', function () { - updateHeader(); - }); */ - //===========BANNERS=============== const $banner = $('[data-banner]'); const bannerId = $banner.data('banner') + ''; @@ -130,30 +123,3 @@ $(document).ready(function () { $popupAuth.find(authPopupActiveTab == 'login' ? '.js-auth-type_login' : '.js-auth-type_registration').addClass('active'); $popupAuth.find(authPopupActiveTab == 'login' ? '.js-auth-tab_login' : '.js-auth-tab_registration').show(); }); - -function updateHeader() { - const scrollOffset = $(window).scrollTop(); - const headerElement = $('header'); - if (scrollOffset >= 130) { - headerElement.css('background-color', '#fff'); - } else { - headerElement.css('background-color', `rgba(255, 255, 255, ${scrollOffset / 130})`); - } - if (scrollOffset >= 150) { - headerElement.addClass('header--shadow'); - } else { - headerElement.removeClass('header--shadow'); - } - - if($('.banner').is(':visible')) { - if(scrollOffset > 0) { - if(scrollOffset <= 140) { - headerElement.css('top', (140-scrollOffset)+'px'); - } else { - headerElement.css('top', '0px'); - } - } else { - headerElement.css('top', ''); - } - } -} diff --git a/web/src/sass/_common.sass b/web/src/sass/_common.sass index 1457d2f6..ab59929a 100755 --- a/web/src/sass/_common.sass +++ b/web/src/sass/_common.sass @@ -120,6 +120,9 @@ button &_xs max-width: 540px +.text-center + text-align: center + .btn position: relative padding: 13px 24px 12px @@ -980,11 +983,7 @@ a[name] &_confirm padding: 30px 0 50px &_school - padding: 85px 0 20px - +t - padding: 65px 0 55px - +m - padding: 45px 0 + padding-bottom: 0px &_benefits padding: 95px 0 100px background: $bg @@ -1204,26 +1203,17 @@ a[name] .online display: block position: relative - padding: 55px 0 50px + padding-top: 55px background-position: 50% 50% background-repeat: no-repeat background-size: cover - color: white + color: black text-align: center z-index: 4 +t - padding: 30px 0 + padding-top: 30px +m - padding: 20px 0 - &:before - content: '' - position: absolute - top: 0 - left: 0 - width: 100% - height: 100% - background-image: linear-gradient(-1deg, rgba(0,0,0,0.30) 0%, rgba(0,0,0,0.60) 100%) - z-index: -2 + padding-top: 20px &__type margin-bottom: 85px // +fb @@ -1236,20 +1226,19 @@ a[name] +m margin-bottom: 40px &__title - margin-bottom: 2px - // +fb - font-size: 50px + margin-bottom: 20px + font-size: 35px line-height: (6/5) +t - margin-bottom: 6px + margin-bottom: 15px font-size: 24px &__text max-width: 600px - +t - margin-bottom: 65px + font-size: 20px + font-family: 'ProximaNova-Regular', sans-serif + margin-bottom: 0 +m max-width: 80% - margin-bottom: 40px &__action +fb font-size: 10px From 43b71d7d8769250a08993e9e79a35aec7717af8a Mon Sep 17 00:00:00 2001 From: gzbender Date: Tue, 25 Jun 2019 21:36:25 +0300 Subject: [PATCH 3/6] =?UTF-8?q?=D1=81=D0=BB=D0=B0=D0=B9=D0=B4=D0=B5=D1=80?= =?UTF-8?q?=20=D0=B8=D0=B7=20=D0=B1=D0=B0=D0=BD=D0=BD=D0=B5=D1=80=D0=BE?= =?UTF-8?q?=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project/templates/blocks/banners.html | 14 +++++++------- web/src/sass/_common.sass | 21 ++++++++++++++++----- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/project/templates/blocks/banners.html b/project/templates/blocks/banners.html index 05065e9f..4c3df84d 100644 --- a/project/templates/blocks/banners.html +++ b/project/templates/blocks/banners.html @@ -13,13 +13,13 @@ data-banner="{{banner.id}}" style="display: none; background: {{ banner.color|default:'white' }}; {% if banner.color2 %} - background: -moz-linear-gradient(top, {{ banner.color }} 0%, {{ banner.color2 }} 100%); - background: -webkit-gradient(left top, left bottom, color-stop(0%, {{ banner.color }}), color-stop(100%, {{ banner.color2 }})); - background: -webkit-linear-gradient(top, {{ banner.color }} 0%, {{ banner.color2 }} 100%); - background: -o-linear-gradient(top, {{ banner.color }} 0%, {{ banner.color2 }} 100%); - background: -ms-linear-gradient(top, {{ banner.color }} 0%, {{ banner.color2 }} 100%); - background: linear-gradient(to bottom, {{ banner.color }} 0%, {{ banner.color2 }} 100%); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='{{ banner.color }}', endColorstr='{{ banner.color2 }}', GradientType=0 ); + background: -moz-linear-gradient(-45deg, {{ banner.color }} 0%, {{ banner.color2 }} 100%); + background: -webkit-gradient(left top, right bottom, color-stop(0%, {{ banner.color }}), color-stop(100%, {{ banner.color2 }})); + background: -webkit-linear-gradient(-45deg, {{ banner.color }} 0%, {{ banner.color2 }} 100%); + background: -o-linear-gradient(-45deg, {{ banner.color }} 0%, {{ banner.color2 }} 100%); + background: -ms-linear-gradient(-45deg, {{ banner.color }} 0%, {{ banner.color2 }} 100%); + background: linear-gradient(135deg, {{ banner.color }} 0%, {{ banner.color2 }} 100%); + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='{{ banner.color }}', endColorstr='{{ banner.color2 }}', GradientType=1 ); {% endif %}">