diff --git a/api/v1/serializers/content.py b/api/v1/serializers/content.py
index 4225bcde..f3553867 100644
--- a/api/v1/serializers/content.py
+++ b/api/v1/serializers/content.py
@@ -3,7 +3,7 @@ from rest_framework import serializers
from django.conf import settings
from apps.content.models import (
- Baner, Content, Image, Text, ImageText, Video,
+ Banner, Content, Image, Text, ImageText, Video,
Gallery, GalleryImage, ImageObject, FAQ)
from . import Base64ImageField
@@ -24,11 +24,11 @@ BASE_CONTENT_FIELDS = (
)
-class BanerSerializer(serializers.ModelSerializer):
+class BannerSerializer(serializers.ModelSerializer):
image = serializers.SerializerMethodField()
class Meta:
- model = Baner
+ model = Banner
fields = (
'id',
'text',
@@ -36,6 +36,9 @@ class BanerSerializer(serializers.ModelSerializer):
'url',
'image',
'use',
+ 'color',
+ 'stretch_image',
+ 'future_date',
'created_at',
'update_at',
)
@@ -46,9 +49,9 @@ class BanerSerializer(serializers.ModelSerializer):
'update_at',
)
- def get_image(self, baner):
- if baner.image:
- return 'http://' + settings.MAIN_HOST + '/' + baner.image.url
+ def get_image(self, banner):
+ if banner.image:
+ return 'http://' + settings.MAIN_HOST + '/' + banner.image.url
else:
return None
diff --git a/api/v1/urls.py b/api/v1/urls.py
index 2ed7195b..08434dfc 100644
--- a/api/v1/urls.py
+++ b/api/v1/urls.py
@@ -9,7 +9,7 @@ from drf_yasg import openapi
from .auth import ObtainToken, ObtainTempToken
from .views import (
AuthorBalanceViewSet, AuthorRequestViewSet,
- BanerViewSet, ConfigViewSet, CategoryViewSet,
+ BannerViewSet, ConfigViewSet, CategoryViewSet,
CourseViewSet, CommentViewSet,
MaterialViewSet, LikeViewSet,
ImageViewSet, TextViewSet,
@@ -24,7 +24,7 @@ from .views import (
router = DefaultRouter()
router.register(r'author-requests', AuthorRequestViewSet, base_name='author-requests')
router.register(r'author-balance', AuthorBalanceViewSet, base_name='author-balance')
-router.register(r'baners', BanerViewSet, base_name='baners')
+router.register(r'baners', BannerViewSet, base_name='banners')
router.register(r'categories', CategoryViewSet, base_name='categories')
router.register(r'courses', CourseViewSet, base_name='courses')
router.register(r'comments', CommentViewSet, base_name='comments')
diff --git a/api/v1/views.py b/api/v1/views.py
index 47a507ee..dc798324 100644
--- a/api/v1/views.py
+++ b/api/v1/views.py
@@ -23,7 +23,7 @@ from .serializers.course import (
LikeCreateSerializer, CourseCommentSerializer, LessonCommentSerializer,
LiveLessonCommentSerializer,)
from .serializers.content import (
- BanerSerializer,
+ BannerSerializer,
ImageSerializer, ImageCreateSerializer,
TextSerializer, TextCreateSerializer,
ImageTextSerializer, ImageTextCreateSerializer,
@@ -63,7 +63,7 @@ from apps.course.models import (
LiveLessonComment)
from apps.config.models import Config
from apps.content.models import (
- Baner, Image, Text, ImageText, Video,
+ Banner, Image, Text, ImageText, Video,
Gallery, GalleryImage, ImageObject,
Contest, ContestWork, FAQ)
from apps.payment.models import (
@@ -132,9 +132,9 @@ class AuthorBalanceUsersViewSet(views.APIView):
return Response(UserSerializer(users, many=True).data)
-class BanerViewSet(ExtendedModelViewSet):
- queryset = Baner.objects.all()
- serializer_class = BanerSerializer
+class BannerViewSet(ExtendedModelViewSet):
+ queryset = Banner.objects.all()
+ serializer_class = BannerSerializer
permission_classes = (IsAdmin,)
filter_fields = ('use',)
ordering_fields = ('created_at', 'update_at',)
diff --git a/apps/auth/templates/auth/success-verification.html b/apps/auth/templates/auth/success-verification.html
index f030b83c..5523ae9f 100644
--- a/apps/auth/templates/auth/success-verification.html
+++ b/apps/auth/templates/auth/success-verification.html
@@ -6,8 +6,9 @@
Email подтверждён!
-
Через несколько секунд Вас перенаправят на главную страницу.
-
Или нажмите кнопку ниже.
+
+ Получите 10 творческих заданий по ссылке
+
diff --git a/web/src/components/blocks/Countdown.vue b/web/src/components/blocks/Countdown.vue
new file mode 100644
index 00000000..6e614bb7
--- /dev/null
+++ b/web/src/components/blocks/Countdown.vue
@@ -0,0 +1,106 @@
+
+
+
+
+
{{ days[0] }}
+
{{ days[1] }}
+
+
+ {{ rupluralize(+days, ['День', 'Дня', 'Дней'], false) }}
+
+
+
+
+
+
+
{{ hours[0] }}
+
{{ hours[1] }}
+
+
+ {{ rupluralize(+hours, ['Час', 'Часа', 'Часов'], false) }}
+
+
+
:
+
+
+
+
{{ minutes[0] }}
+
{{ minutes[1] }}
+
+
+ {{ rupluralize(+minutes, ['Минута', 'Минуты', 'Минут'], false) }}
+
+
+
:
+
+
+
+
{{ seconds[0] }}
+
{{ seconds[1] }}
+
+
+ {{ rupluralize(+seconds, ['Секунда', 'Секунды', 'Секунд'], false) }}
+
+
+
+
+
+
+
+
diff --git a/web/src/js/app.js b/web/src/js/app.js
index b05611ba..7193a6e8 100644
--- a/web/src/js/app.js
+++ b/web/src/js/app.js
@@ -27,6 +27,7 @@ import DatePicker from 'vuejs-datepicker'
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';
Vue.use(Vuelidate);
Vue.use(VueAutosize);
@@ -54,3 +55,13 @@ 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 00ac9414..5faffb0b 100644
--- a/web/src/js/modules/common.js
+++ b/web/src/js/modules/common.js
@@ -5,6 +5,7 @@ import SmoothScroll from 'smooth-scroll/dist/js/smooth-scroll';
import baguetteBox from 'baguettebox.js'
import createHistory from 'history/createBrowserHistory'
import Cookies from 'js-cookie'
+import moment from 'moment'
window.$ = window.jQuery = jQuery = $;
window.Inputmask = Inputmask;
@@ -32,6 +33,7 @@ $(document).ready(function () {
//===========BANNERS===============
const $banner = $('[data-banner]');
const bannerId = $banner.data('banner') + '';
+ const futureDate = $banner.data('future-date') + '';
if(Cookies.get('hide_banner') !== bannerId){
$banner.show();
}
@@ -43,6 +45,11 @@ $(document).ready(function () {
Cookies.set('hide_banner', bannerId);
});
+ if(futureDate){
+
+ }
+ $banner.find('.banner__countdown')
+
//===========REVIEWS===============
if(window.LIL_STORE.isIndexPage){
const $reviews = $('.reviews');
diff --git a/web/src/js/utils.js b/web/src/js/utils.js
index 0cc69907..9d822ef3 100644
--- a/web/src/js/utils.js
+++ b/web/src/js/utils.js
@@ -1,7 +1,10 @@
-export const rupluralize = (value, args) => {
+export const rupluralize = (value, args, addValue=true) => {
let digit = Math.trunc(value) + '';
digit = digit[digit.length - 1];
- return value + ' ' + args[digit == '1' ? 0 : ('234'.search(digit) > -1 ? 1 : 2)];
+ return (addValue ? value + ' ' : '') +
+ args[(+value > 10 && +value < 20)
+ ? 2
+ : (digit == '1' ? 0 : ('234'.search(digit) > -1 ? 1 : 2))];
}
export const loadScript = (url, onload) => {
diff --git a/web/src/sass/_common.sass b/web/src/sass/_common.sass
index 3e280cff..fba66e0c 100755
--- a/web/src/sass/_common.sass
+++ b/web/src/sass/_common.sass
@@ -4388,10 +4388,7 @@ a
height: 140px
text-align: center
color: #fff
- background-color: white
background-repeat: no-repeat
- background-position: center
- background-size: cover
+m
height: auto
&__image-wrap
@@ -4405,15 +4402,33 @@ a
+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: -110px
+ &_countdown &__content
+ margin-top: 15px
+ &__content-center
+ width: 1024px
+ margin: 0 auto
+ display: flex
+ padding: 0 40px
&__text
font-size: 30px
text-shadow: 0px 0px 3px rgba(0, 0, 0, 1)
+ &_countdown &__text
+ font-size: 22px
+ text-shadow: none
+ color: black
+ width: 300px
&__link
display: block
color: #fff
@@ -4422,6 +4437,20 @@ a
margin-top: 20px
+m
margin-top: 0px
+ &_countdown &__link
+ font-size: 15px
+ color: black
+ text-shadow: none
+ background: white
+ font-weight: bold
+ padding: 7px 20px
+ border-radius: 20px
+ border: 1px solid #ddd
+ text-align: center
+ margin-top: 10px
+ display: inline-block
+ &_countdown &__link:hover
+ background: #ddd
&__hide
position: absolute
right: 5px
@@ -4434,6 +4463,45 @@ a
opacity: 0.3
+m
//margin-top: 0px
+ &__text-column
+ flex: 1
+ &_countdown &__text-column
+ text-align: left
+ &__countdown-column
+ padding: 0 20px
+ +m
+ border-radius: 3px
+ background: rgba(255, 255, 255, 0.3)
+ &__countdown-title
+ color: black
+ font-size: 15px
+ margin-bottom: 5px
+ &__countdown
+ display: flex
+ color: black
+ transition: 0.5s opacity
+ > div
+ font-size: 27px
+ display: flex
+ flex-direction: column
+ &-nums
+ display: flex
+ & > div
+ margin: 1px
+ width: 27px
+ border-radius: 5px
+ background: #000000ba
+ text-align: center
+ padding-top: 2px
+ color: white
+ &-delim
+ width: 10px
+ color: black
+ &-descr
+ text-align: center
+ font-size: 11px
+ margin-top: 3px
+
.anchor
padding-top: 100px