diff --git a/apps/payment/migrations/0033_userbonus_notified_at.py b/apps/payment/migrations/0033_userbonus_notified_at.py
new file mode 100644
index 00000000..9804bcb0
--- /dev/null
+++ b/apps/payment/migrations/0033_userbonus_notified_at.py
@@ -0,0 +1,18 @@
+# Generated by Django 2.0.7 on 2019-03-27 20:54
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('payment', '0032_auto_20190207_1233'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='userbonus',
+ name='notified_at',
+ field=models.DateTimeField(blank=True, null=True),
+ ),
+ ]
diff --git a/apps/payment/migrations/0034_auto_20190327_2055.py b/apps/payment/migrations/0034_auto_20190327_2055.py
new file mode 100644
index 00000000..00ec22f5
--- /dev/null
+++ b/apps/payment/migrations/0034_auto_20190327_2055.py
@@ -0,0 +1,22 @@
+# Generated by Django 2.0.7 on 2019-03-27 20:55
+
+from django.utils import timezone
+from django.db import migrations
+
+
+def fill_bonuses_notified_at(apps, schema_editor):
+ UserBonus = apps.get_model('payment', 'UserBonus')
+ for ub in UserBonus.objects.filter(notified_at__isnull=True):
+ ub.notified_at = timezone.now()
+ ub.save()
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('payment', '0033_userbonus_notified_at'),
+ ]
+
+ operations = [
+ migrations.RunPython(fill_bonuses_notified_at),
+ ]
diff --git a/apps/payment/models.py b/apps/payment/models.py
index 4e157d4a..b8d45a46 100644
--- a/apps/payment/models.py
+++ b/apps/payment/models.py
@@ -306,6 +306,7 @@ class UserBonus(models.Model):
created_at = models.DateTimeField(auto_now_add=True)
is_service = models.BooleanField(default=False)
action_name = models.CharField(max_length=10, blank=True, default='')
+ notified_at = models.DateTimeField(blank=True, null=True)
class Meta:
ordering = ('created_at',)
diff --git a/apps/user/models.py b/apps/user/models.py
index 87d43490..97dc1990 100644
--- a/apps/user/models.py
+++ b/apps/user/models.py
@@ -138,6 +138,14 @@ class User(AbstractUser):
Q(payment__isnull=False, payment__status__in=Payment.PW_PAID_STATUSES) | Q(is_service=True),
).aggregate(models.Sum('amount')).get('amount__sum') or 0)
+ @property
+ def has_new_bonuses(self):
+ from apps.payment.models import Payment
+ last_bonus = self.bonuses.filter(
+ Q(payment__isnull=False, payment__status__in=Payment.PW_PAID_STATUSES) | Q(is_service=True),
+ ).order_by('-created_at').first()
+ return bool(last_bonus) and not last_bonus.notified_at
+
@receiver(post_save, sender=User)
def create_auth_token(sender, instance=None, created=False, **kwargs):
diff --git a/apps/user/templates/user/bonus-history.html b/apps/user/templates/user/bonus-history.html
index ef3bf9d8..1971815a 100644
--- a/apps/user/templates/user/bonus-history.html
+++ b/apps/user/templates/user/bonus-history.html
@@ -3,7 +3,6 @@
{% load rupluralize from plural %}
{% block content %}
-
@@ -12,24 +11,72 @@
1 LIL = 1 ₽
-
- Приглашайте друзей в Lil School и получайте {{ config.REFERRER_BONUS }}%
- от суммы их первой покупки. Накапливайте монеты и тратьте их на оплату школы и курсов.
-
- Просто отправьте эту ссылку, по которой ваши друзья могут присоединиться к нам:
+
+
+
Приглашайте друзей в Lil School
+
+ Получайте {{ config.REFERRER_BONUS }}% от суммы их первой покупки.
+
+ Просто отправьте эту ссылку, по которой ваши друзья могут присоединиться к нам:
+
+
+
+
+ Копировать ссылку
+
-
-
{% include 'templates/blocks/lil_store_js.html' %}
{% block pre_app_js %}{% endblock pre_app_js %}
diff --git a/web/src/fonts/ProximaNova-Bold.otf b/web/src/fonts/ProximaNova-Bold.otf
new file mode 100644
index 00000000..4df9e171
Binary files /dev/null and b/web/src/fonts/ProximaNova-Bold.otf differ
diff --git a/web/src/img/lilcoin48x54.png b/web/src/img/lilcoin48x54.png
new file mode 100644
index 00000000..961dbcde
Binary files /dev/null and b/web/src/img/lilcoin48x54.png differ
diff --git a/web/src/img/lilcoin_spin.gif b/web/src/img/lilcoin_spin.gif
new file mode 100644
index 00000000..83157af9
Binary files /dev/null and b/web/src/img/lilcoin_spin.gif differ
diff --git a/web/src/js/modules/popup.js b/web/src/js/modules/popup.js
index 8d3079ba..cbf94677 100644
--- a/web/src/js/modules/popup.js
+++ b/web/src/js/modules/popup.js
@@ -303,6 +303,11 @@ $(document).ready(function () {
showPopup();
}
+ if(window.LIL_STORE.user.id && window.LIL_STORE.user.hasNewBonuses){
+ popup = $('.js-popup-bonuses-came');
+ showPopup();
+ }
+
function showPopup(){
if(! popup && popupName){
popup = $(popupName);
diff --git a/web/src/sass/_common.sass b/web/src/sass/_common.sass
index 70e754e6..3cecec42 100755
--- a/web/src/sass/_common.sass
+++ b/web/src/sass/_common.sass
@@ -4457,18 +4457,35 @@ a
.referrer-url
display: flex
+
+ +m
+ flex-direction: column
+
+ &__text-column
+ flex: 50%
+ padding-right: 16%
+ padding-top: 8px
+
+ +m
+ padding-right: 0
+
+ &__title
+ font-size: 20px
+ margin-bottom: 5px
+
+ &__url-column
+ display: flex
+ flex-direction: column
+ flex: 30%
+ align-items: center
+
&__input
- width: auto
height: 40px
- border: 1px solid #D1FF7F
- padding: 8px
- border-radius: 3px 0 0 3px
- border-right: none
+ width: 100%
+ margin-bottom: 5px
- &:focus
- border: 1px solid #D1FF7F
&__btn
- border-radius: 0 3px 3px 0
+ width: 100%
.bonuses
@@ -4557,3 +4574,60 @@ a
margin-top: -20px
color: #333333
font-size: 12px
+
+
+.bonuses-table
+ margin-left: -110px
+ margin-top: 50px
+
+ &__row
+ display: flex
+ width: 100%
+ margin-bottom: 20px
+
+ & > div
+ font-size: 14px
+
+ & > div:nth-child(1)
+ flex: 115px
+ font-size: 40px
+ margin-top: -7px
+ text-align: center
+ & > div:nth-child(2)
+ flex: 320px
+ & > div:nth-child(3)
+ flex: 165px
+ font-size: 20px
+ font-weight: bold
+ text-align: center
+ & > div:nth-child(4)
+ flex: 220px
+
+ & .btn
+ width: 100%
+
+ & > div:nth-child(5)
+ flex: 40px
+ text-align: center
+
+ &__title
+ margin-bottom: 5px
+ font-size: 20px
+
+
+.bonuses-came
+ &__body
+ padding: 30px 30px 50px
+ text-align: center
+
+ &__title
+ margin-bottom: 5px
+ margin-top: 5px
+ font-size: 25px
+
+ &__bonuses
+ font-size: 50px
+ margin-bottom: -8px
+
+ &__text
+ margin: 40px 0