Merge branch 'feature/lilcoin-popup' into 'master'

начислять лилики с анимацией и попапом

See merge request lilschool/site!283
remotes/origin/hotfix/gift-cert-fix
Danil 7 years ago
commit 845bbbe408
  1. 10
      apps/notification/tasks.py
  2. 8
      apps/user/templates/user/bonus-history.html
  3. 7
      apps/user/templates/user/profile-settings.html
  4. 2
      apps/user/templates/user/profile.html
  5. 7
      apps/user/views.py
  6. 5
      project/settings.py
  7. 2
      web/src/js/app.js
  8. 16
      web/src/sass/_common.sass

@ -12,7 +12,7 @@ from django.conf import settings
from apps.notification.models import UserNotification
from apps.notification.utils import send_email
from apps.payment.models import SchoolPayment, CoursePayment, Payment, UserGiftCertificate
from apps.payment.models import SchoolPayment, CoursePayment, Payment, UserGiftCertificate, UserBonus
from project.celery import app
from project.utils.db import format_sql, execute_sql
from project.sengrid import get_sendgrid_client
@ -143,3 +143,11 @@ def send_gift_certificate(user_gift_certificate):
send_email('Подарочный сертификат от Lil School', user_gift_certificate.user.email, 'notification/email/gift_certificate.html',
inline_images=[('twitter_icon', 'img/twitter.png'), ('fb_icon', 'img/fb.png'), ('instagram_icon', 'img/instagram.png'),],
user_gift_certificate=user_gift_certificate, gift_certificate=user_gift_certificate.gift_certificate)
@app.task
def send_child_birthday_bonuses():
for u in User.objects.exclude(child_first_name='', child_last_name='',).filter(child_birthday=now().date()):
if not UserBonus.objects.filter(user=u, is_service=True, action_name=UserBonus.ACTION_CHILD_BIRTHDAY).count():
UserBonus.objects.create(user=u, amount=UserBonus.AMOUNT_CHILD_BIRTHDAY, is_service=True,
action_name=UserBonus.ACTION_CHILD_BIRTHDAY)

@ -50,7 +50,7 @@
<div class="bonuses-table__title">Заполнить профиль</div>
Заполните свой профиль, включая номер телефона.
</div>
<div>+50 LIL</div>
<div>+{{ amount_fill_profile }} LIL</div>
<div><a class="btn btn_stroke" href="{% url 'user-profile' %}">ЗАПОЛНИТЬ</a></div>
<div>{% if request.user.phone and request.user.first_name and request.user.last_name %}
<img src="{% static 'img/done2.png' %}" />{% endif %}</div>
@ -61,7 +61,7 @@
<div class="bonuses-table__title">Оплата второго месяца или курса</div>
Получайте бонусы при оплате последующий месяцев обучения или курсов. Чем большевы с нами, чем больше Лиликов вы получаете.
</div>
<div>+100 LIL</div>
<div>+{{ amount_paid_one_more }} LIL</div>
<div><a class="btn btn_stroke" href="{% url 'courses' %}">ВЫБРАТЬ КУРС</a></div>
<div>{% if request.user.paid_one_more %}<img src="{% static 'img/done2.png' %}" />{% endif %}</div>
</div>
@ -71,7 +71,7 @@
<div class="bonuses-table__title">Видео-отзыв о Lil School</div>
Выкладывайте свои видео-обзоры и видео-отзывы в Инстаграм с тегом @Lil.School #LilSchool и высылаете отчет на почту school@lil.city
</div>
<div>+100 LIL</div>
<div>+{{ amount_have_review }} LIL</div>
<div><a class="btn btn_stroke" target="_blank" href="https://youtu.be/QrlR5sL_eGI">ПОСМОТРЕТЬ ПРИМЕР</a></div>
<div>{% if request.user.review_url %}<img src="{% static 'img/done2.png' %}" />{% endif %}</div>
</div>
@ -81,7 +81,7 @@
<div class="bonuses-table__title">На День Рождения!</div>
Мы любим наших учеников, поэтому дарим лилики на день рождения.
</div>
<div>+200 LIL</div>
<div>+{{ amount_child_birthday }} LIL</div>
<div><a class="btn btn_stroke" href="{% url 'user-profile' %}">ЗАПОЛНИТЬ КАРТОЧКУ РЕБЕНКА</a></div>
<div>{% if request.user.child_first_name and request.user.child_last_name and request.user.child_birthday %}
<img src="{% static 'img/done2.png' %}" />{% endif %}</div>

@ -121,8 +121,8 @@
<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 %}">
<vue-datepicker input-class="field__input" name="child_birthday" language="ru" format="dd/MM/yyyy"
value="{% if user.child_birthday %}{{ user.child_birthday | date:'d/m/Y' }}{% endif %}" placeholder="dd/mm/yyyy"/>
</div>
{% for error in form.child_birthday.errors %}
<div class="field__error">{{ error }}</div>
@ -187,7 +187,8 @@
<div class="form__field field{% if form.birthday.errors %} error{% endif %}">
<div class="field__label">ДАТА РОЖДЕНИЯ</div>
<div class="field__wrap">
<input name='birthday' class="field__input" type="text" placeholder="dd.mm.yyyy" value="{% if user.birthday %}{{ user.birthday | date:'d.m.Y' }}{% endif %}">
<vue-datepicker input-class="field__input" name="birthday" language="ru" format="dd/MM/yyyy"
value="{% if user.birthday %}{{ user.birthday | date:'d/m/Y' }}{% endif %}" placeholder="dd/mm/yyyy"/>
</div>
{% for error in form.birthday.errors %}
<div class="field__error">{{ error }}</div>

@ -1,6 +1,6 @@
{% extends "templates/lilcity/index.html" %} {% load static %} {% load thumbnail %} {% block content %}
{% if not user.child_first_name and not user.child_last_name %}
{% if not user.child_first_name or not user.child_birthday %}
<div class="section">
<div class="section__center center">
<div class="fill-profile">

@ -319,6 +319,13 @@ class BonusHistoryView(TemplateView):
'Занимайтесь с ребёнком творчеством, не выходя из дома. ' \
'Перейдите по ссылке и получите скидку %d%% на первую покупку' \
% (request.user.get_full_name(), config.REFERRAL_BONUS)
context.update({
'amount_have_review': UserBonus.AMOUNT_HAVE_REVIEW,
'amount_fill_profile': UserBonus.AMOUNT_FILL_PROFILE,
'amount_paid_one_more': UserBonus.AMOUNT_PAID_ONE_MORE,
'amount_child_birthday': UserBonus.AMOUNT_CHILD_BIRTHDAY,
})
return self.render_to_response(context)

@ -262,6 +262,11 @@ CELERY_BEAT_SCHEDULE = {
'schedule': crontab(minute=0, hour=3),
'args': (),
},
'send_child_birthday_bonuses': {
'task': 'apps.notification.tasks.send_child_birthday_bonuses',
'schedule': crontab(minute=0, hour=0),
'args': (),
},
}
try:

@ -23,6 +23,7 @@ import $ from 'jquery';
import Vue from 'vue';
import Vuelidate from 'vuelidate';
import VueAutosize from '../components/directives/autosize'
import DatePicker from 'vuejs-datepicker'
import Comments from '../components/Comments';
import Likes from '../components/blocks/Likes.vue';
import FAQ from '../components/FAQ.vue';
@ -39,6 +40,7 @@ const components = {
'likes': Likes,
'comments': Comments,
'faq': FAQ,
'vue-datepicker': DatePicker,
};
Object.assign(components, window.LIL_STORE.components);

@ -3280,6 +3280,10 @@ a.grey-link
padding: 40px 35px
background: url(../img/fill-profile-gramota.png) center bottom no-repeat
+m
flex-direction: column
padding: 20px 15px
&:before
content: ''
position: absolute
@ -3295,6 +3299,11 @@ a.grey-link
flex: 0 0 300px
font-size: 18px
+m
flex: 1
font-size: 16px
margin-bottom: 40px
&__img
flex: 1
@ -3302,10 +3311,17 @@ a.grey-link
flex: 0 0 205px
text-align: right
+m
margin-bottom: 35px
flex: 1
&__arrow
flex: 0 0 50px
text-align: right
+m
display: none
.tabs
&__nav
display: flex

Loading…
Cancel
Save