подарочный сертификат
diff --git a/project/templates/blocks/promo.html b/project/templates/blocks/promo.html
index 18ad35d2..1dcb87d2 100644
--- a/project/templates/blocks/promo.html
+++ b/project/templates/blocks/promo.html
@@ -26,6 +26,10 @@
{% endif %}
class="main__btn btn"
>{% if not school_schedule.weekday in school_schedules_purchased %}Получить доступ{% else %}Смотреть урок{% endif %}
+
+ {% if not is_purchased and not is_purchased_future %}
+
Подарить другу
+ {% endif %}
{% elif user.is_authenticated and online_coming_soon and school_schedule and school_schedule.start_at_humanize %}
@@ -45,6 +49,10 @@
{% endif %}
class="main__btn btn"
>{% if not school_schedule.weekday in school_schedules_purchased %}Получить доступ{% else %}Смотреть урок{% endif %}
+
+ {% if not is_purchased and not is_purchased_future %}
+
Подарить другу
+ {% endif %}
@@ -59,6 +67,7 @@
>
купить доступ от {{ min_school_price }} руб./месяц
+
Подарить другу
{% else %}
Подробнее
{% endif %}
diff --git a/project/views.py b/project/views.py
index ac4ffb46..d563f0c6 100644
--- a/project/views.py
+++ b/project/views.py
@@ -81,7 +81,7 @@ class IndexView(TemplateView):
if user_gift_certificate:
try:
user_gift_certificate = short_url.decode_url(user_gift_certificate)
- user_gift_certificate = UserGiftCertificate.objects,get(pk=user_gift_certificate)
+ user_gift_certificate = UserGiftCertificate.objects.get(pk=user_gift_certificate, bonuses_sent__isnull=True)
except:
user_gift_certificate = None
diff --git a/web/src/js/modules/popup.js b/web/src/js/modules/popup.js
index 061e2747..35c608aa 100644
--- a/web/src/js/modules/popup.js
+++ b/web/src/js/modules/popup.js
@@ -137,6 +137,21 @@ $(document).ready(function () {
}
popup.data('next-url', nextUrl);
}
+
+ if( data === '.js-popup-enter-gift-code') {
+ const $giftCode = popup.find('.enter-gift-code__code');
+ const $giftError = popup.find('.enter-gift-code__error');
+ $giftCode.val('');
+ $giftError.text('');
+ popup.find('.enter-gift-code__btn').one('click', () => {
+ const code = $giftCode.val();
+ if(! code){
+ $giftError.text('Укажите код');
+ return;
+ }
+ // TODO
+ });
+ }
});
$('.js-popup-close').on('click', function(e){
diff --git a/web/src/sass/_common.sass b/web/src/sass/_common.sass
index 7928b4bc..a708728b 100755
--- a/web/src/sass/_common.sass
+++ b/web/src/sass/_common.sass
@@ -209,6 +209,10 @@ button
&_pink
background: #ff9393
color: white
+ &_stroke-black
+ background: none
+ border: 1px solid $cl
+ color: $cl
&_md
padding: 18px 24px 17px
+m
@@ -4453,6 +4457,16 @@ a
color: $cl
&__title
text-transform: uppercase
+ &__status
+ font-family: 'ProximaNova-Bold', serif
+ font-size: 12px
+ letter-spacing: 2px
+ text-transform: uppercase
+ & .icon
+ width: 16px
+ display: inline-block
+ height: 16px
+ margin-bottom: -4px
&__buy-btn
width: 100%
&__preview.theme_pink2