Feature/lil 680 See merge request lilcity/backend!210remotes/origin/feature/LIL-711
@ -0,0 +1,112 @@ |
||||
{% extends "notification/email/_base.html" %} |
||||
{% load settings %} |
||||
|
||||
{% block content %} |
||||
<p style="text-align: center;font-size: 2em;font-weight: bold;line-height: 1.09375;">Поздравляем с успешной |
||||
покупкой!</p> |
||||
<div style="margin-bottom:30px;text-align: center;"> |
||||
<p>Вы получаете <strong>{{ gift_certificate.price }}</strong> лиликов на счет! <strong>1 LIL = 1 руб.</strong><br> |
||||
Накапливайте монеты и тратьте их на оплату школы и курсов. |
||||
</p> |
||||
</div> |
||||
<div style="margin-bottom: 30px;width: 100%;"> |
||||
<div style=" |
||||
margin: 0 auto; |
||||
width: 300px; |
||||
"> |
||||
<div style=" |
||||
width: 300px; |
||||
height: 300px; |
||||
background-color: #FEB9B9; |
||||
"></div> |
||||
<table style=" |
||||
width: 100%; |
||||
font-size: 12px; |
||||
font-weight: bold; |
||||
"> |
||||
<tbody> |
||||
<tr> |
||||
<td style=" |
||||
letter-spacing: 2px; |
||||
text-transform: uppercase; |
||||
">Подарочный сертификат |
||||
</td> |
||||
<td style=" |
||||
text-align: right; |
||||
">{{ gift_certificate.price }} р. |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
</table> |
||||
</div> |
||||
</div> |
||||
<div style="margin-bottom:10px;text-align: center;">Чтобы воспользоваться сертификатом, перейдите по ссылке</div> |
||||
<div style="margin-bottom: 30px;text-align: center;"> |
||||
<a href="https://{% setting 'MAIN_HOST' %}{% url 'index' %}?gift-certificate={{ user_gift_certificate.code }}" style=" |
||||
color: #FF9393; |
||||
font-weight: bold; |
||||
"> |
||||
{% setting 'MAIN_HOST' %}{% url 'index' %}?gift-certificate={{ user_gift_certificate.code }}</a> |
||||
</div> |
||||
<div style="margin-bottom:10px;text-align: center;"> |
||||
Или воспользуйтесь сертификатом, введя уникальный код на в разделе |
||||
вашего профиля на сайте <a href="https://lil.school" style=" |
||||
color: #FF9393; |
||||
">lil.school</a> |
||||
</div> |
||||
<div style=" |
||||
text-align: center; |
||||
font-size: 1.4em; |
||||
font-weight: bold; |
||||
margin-bottom: 10px; |
||||
">Ваш код |
||||
</div> |
||||
<div style=" |
||||
text-align: center; |
||||
font-size: 1.4em; |
||||
font-weight: bold; |
||||
margin-bottom: 30px; |
||||
"> |
||||
<div style=" |
||||
display: inline-block; |
||||
border: 1px solid black; |
||||
padding: 5px 40px; |
||||
border-radius: 3px; |
||||
">{{ user_gift_certificate.code }} |
||||
</div> |
||||
</div> |
||||
<div style=" |
||||
margin-bottom: 10px; |
||||
text-align: center; |
||||
"> |
||||
Вы так же можете отправить это письмо, ссылку или код вашему другу, чтобы подарить ему этот сертификат. |
||||
</div> |
||||
<div style=" |
||||
margin-bottom: 10px; |
||||
text-align: center; |
||||
font-size: 1.4em; |
||||
font-weight: bold; |
||||
"> |
||||
Присоединяйтесь к нам! |
||||
</div> |
||||
<div style=" |
||||
margin-bottom: 10px; |
||||
text-align: center;"> |
||||
{% if config.SERVICE_TWITTER_URL %} |
||||
<a href="{{ config.SERVICE_TWITTER_URL }}"> |
||||
<img src="cid:{{ twitter_icon }}" /> |
||||
</a> |
||||
{% endif %} |
||||
{% if config.SERVICE_FB_URL %} |
||||
<a href="{{ config.SERVICE_FB_URL }}"> |
||||
<img src="cid:{{ fb_icon }}" /> |
||||
</a> |
||||
{% endif %} |
||||
{% if config.SERVICE_INSTAGRAM_URL %} |
||||
<a href="{{ config.SERVICE_INSTAGRAM_URL }}"> |
||||
<img src="cid:{{ instagram_icon }}" /> |
||||
</a> |
||||
{% endif %} |
||||
</div> |
||||
|
||||
{% endblock content %} |
||||
@ -0,0 +1,34 @@ |
||||
# Generated by Django 2.0.6 on 2018-10-29 14:36 |
||||
|
||||
from django.conf import settings |
||||
from django.db import migrations, models |
||||
import django.db.models.deletion |
||||
|
||||
|
||||
class Migration(migrations.Migration): |
||||
|
||||
dependencies = [ |
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), |
||||
('payment', '0024_auto_20181002_0338'), |
||||
] |
||||
|
||||
operations = [ |
||||
migrations.CreateModel( |
||||
name='GiftCertificate', |
||||
fields=[ |
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
||||
('price', models.DecimalField(decimal_places=2, default=0, editable=False, max_digits=8)), |
||||
], |
||||
), |
||||
migrations.CreateModel( |
||||
name='UserGiftCertificate', |
||||
fields=[ |
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
||||
('recipient', models.EmailField(max_length=254, blank=True, null=True,)), |
||||
('bonuses_sent', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='payment.UserBonus')), |
||||
('gift_certificate', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='payment.GiftCertificate')), |
||||
('payment', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='payment.Payment')), |
||||
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='gift_certificates', to=settings.AUTH_USER_MODEL)), |
||||
], |
||||
), |
||||
] |
||||
@ -0,0 +1,39 @@ |
||||
# Generated by Django 2.0.6 on 2018-11-01 15:46 |
||||
|
||||
from django.db import migrations, models |
||||
import django.db.models.deletion |
||||
|
||||
|
||||
class Migration(migrations.Migration): |
||||
|
||||
dependencies = [ |
||||
('payment', '0025_giftcertificate_usergiftcertificate'), |
||||
] |
||||
|
||||
operations = [ |
||||
migrations.CreateModel( |
||||
name='GiftCertificatePayment', |
||||
fields=[ |
||||
('payment_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='payment.Payment')), |
||||
], |
||||
options={ |
||||
'verbose_name': 'Платеж за подарочный сертификат', |
||||
'verbose_name_plural': 'Платежи за подарочные сертификаты', |
||||
}, |
||||
bases=('payment.payment',), |
||||
), |
||||
migrations.AlterModelOptions( |
||||
name='giftcertificate', |
||||
options={'ordering': ('price',)}, |
||||
), |
||||
migrations.AlterField( |
||||
model_name='giftcertificate', |
||||
name='price', |
||||
field=models.DecimalField(decimal_places=2, default=0, max_digits=8), |
||||
), |
||||
migrations.AddField( |
||||
model_name='giftcertificatepayment', |
||||
name='gift_certificate', |
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='payments', to='payment.GiftCertificate', verbose_name='Подарочный сертификат'), |
||||
), |
||||
] |
||||
@ -0,0 +1,22 @@ |
||||
# Generated by Django 2.0.6 on 2018-11-09 14:02 |
||||
|
||||
from django.db import migrations, models |
||||
|
||||
|
||||
class Migration(migrations.Migration): |
||||
|
||||
dependencies = [ |
||||
('payment', '0026_auto_20181101_1546'), |
||||
] |
||||
|
||||
operations = [ |
||||
migrations.RemoveField( |
||||
model_name='usergiftcertificate', |
||||
name='recipient', |
||||
), |
||||
migrations.AddField( |
||||
model_name='giftcertificate', |
||||
name='cover', |
||||
field=models.CharField(blank=True, default='', max_length=255), |
||||
), |
||||
] |
||||
@ -0,0 +1,21 @@ |
||||
# Generated by Django 2.0.6 on 2018-11-09 14:03 |
||||
|
||||
from django.db import migrations |
||||
from django.contrib.staticfiles.storage import staticfiles_storage |
||||
|
||||
|
||||
def add_gift_certificates(apps, schema_editor): |
||||
GiftCertificate = apps.get_model('payment', 'GiftCertificate') |
||||
for price in [1000, 2000, 3000, 5000, 10000]: |
||||
GiftCertificate.objects.create(price=price, |
||||
cover=staticfiles_storage.url('img/gift-certificates/%d.jpg' % price)) |
||||
|
||||
class Migration(migrations.Migration): |
||||
|
||||
dependencies = [ |
||||
('payment', '0027_auto_20181109_1402'), |
||||
] |
||||
|
||||
operations = [ |
||||
migrations.RunPython(add_gift_certificates), |
||||
] |
||||
@ -0,0 +1,17 @@ |
||||
{% extends "templates/lilcity/index.html" %} {% load static %} |
||||
|
||||
{% block content %} |
||||
<div class="section"> |
||||
<div class="section__center center"> |
||||
<div class="title title_center">Вам подарок!</div> |
||||
<div class="text"> |
||||
Пользователь ХХХ дарит вам сертификат на сумму ХХХ руб |
||||
</div> |
||||
<div class="center"> |
||||
<a href="{% url '' %}" class="btn"> |
||||
получить подарок |
||||
</a> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
{% endblock content %} |
||||
@ -0,0 +1,15 @@ |
||||
{% extends "templates/lilcity/index.html" %} {% load static %} {% block content %} |
||||
<div class="section"> |
||||
<div class="section__center center center_xs"> |
||||
<div class="done"> |
||||
<div class="done__title title">Бонусы зачислены на ваш счет!</div> |
||||
<div>Вы можете оплатить с их помощью курс или онлайн-школу</div> |
||||
<div class="done__foot"> |
||||
<a class="done__btn btn btn_md btn_stroke" href="{% url 'school:school' %}" |
||||
style="margin-bottom: 10px;">Записаться в школу</a> |
||||
<a class="done__btn btn btn_md btn_stroke" href="{% url 'courses' %}">Купить курсы</a> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
{% endblock content %} |
||||
@ -0,0 +1,36 @@ |
||||
{% load thumbnail %} |
||||
{% load static %} |
||||
{% load data_liked from data_liked %} |
||||
|
||||
<div class="gift-certificates__item"> |
||||
<div class="gift-certificates__preview {{ theme_color }}"> |
||||
<img class="gift-certificates__cover" src="{{ gift_certificate.cover }}" /> |
||||
</div> |
||||
<div class="gift-certificates__details"> |
||||
<span class="gift-certificates__title theme {{ theme_color }}"> |
||||
{% if user_gift_certificate and not user_gift_certificate.bonuses_sent %} |
||||
<a href="{% url 'gift-certificate-get' user_gift_certificate.code %}">подарочный сертификат</a> |
||||
{% else %}подарочный сертификат{% endif %}</span> |
||||
<div class="gift-certificates__price">{{ gift_certificate.price|floatformat:"-2" }}₽</div> |
||||
</div> |
||||
{% if user_gift_certificate %} |
||||
{% if user_gift_certificate.bonuses_sent %} |
||||
<div class="gift-certificates__status"> |
||||
<img class="icon" src="{% static 'img/done.png' %}" /> |
||||
Получено |
||||
</div> |
||||
{% else %} |
||||
<div class="gift-certificates__status"> |
||||
<img class="icon" style="margin-top: -1px; height: auto;" src="{% static 'img/clock.png' %}" /> |
||||
Ожидает получения |
||||
</div> |
||||
{% endif %} |
||||
{% else %} |
||||
<a class="gift-certificates__buy-btn btn" |
||||
{% if request.user.is_authenticated %} |
||||
href="{% url 'gift-certificate-checkout' gift_certificate.id %}" |
||||
{% else %} |
||||
href="#" data-popup=".js-popup-auth" |
||||
{% endif %}>Купить сертификат</a> |
||||
{% endif %} |
||||
</div> |
||||
@ -0,0 +1,4 @@ |
||||
{% for gift_certificate in gift_certificates %} |
||||
{% cycle 'theme_pink2' 'theme_cyan' 'theme_violet2' as theme_color silent %} |
||||
{% include "payment/gift_certificate_item.html" %} |
||||
{% endfor %} |
||||
@ -0,0 +1,13 @@ |
||||
{% extends "templates/lilcity/index.html" %} {% load static %} {% block content %} |
||||
<div class="section"> |
||||
<div class="section__center center center_xs"> |
||||
<div class="done"> |
||||
<div class="done__title title">Вы успешно приобрели подарочный сертификат!</div> |
||||
<div>Мы отправили письмо с сертификатом на вашу почту.</div> |
||||
<div class="done__foot"> |
||||
<a class="done__btn btn btn_md btn_stroke" href="{% url 'index' %}">СПАСИБО</a> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
{% endblock content %} |
||||
@ -0,0 +1,35 @@ |
||||
{% extends "templates/lilcity/index.html" %} {% load static %} |
||||
|
||||
{% block content %} |
||||
<div |
||||
class="main main_default" |
||||
{% if config.MAIN_PAGE_TOP_IMAGE %} |
||||
style="background-image: url({{ config.MAIN_PAGE_TOP_IMAGE.url }});" |
||||
{% else %} |
||||
style="background-image: url({% static 'img/bg-1.jpg' %});" |
||||
{% endif %} |
||||
> |
||||
<div class="main__center center" style="margin-top: 110px;"> |
||||
<div class="main__title"> |
||||
<span class="main__bold">Подарочные сертификаты</span> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="section section_courses"> |
||||
<div class="section__center center"> |
||||
<div class="text text_courses">Подарочный сертификат Lil City - отличный презент на любой праздник.<br> |
||||
А также сертификат можно подарить без повода - развитие <br>творческого потенциала всегда уместно и актуально. |
||||
При покупке подарочного сертификата мы высылаем письмо,<br> |
||||
где будет уникальный код и уникальная ссылка. Письмо или ссылку<br> |
||||
на него вы можете переслать другому. Сертификатом можно<br> |
||||
воспользоваться, перейдя по ссылке. |
||||
<img src="/static/img/curve-1.svg" class="text__curve text__curve_one"> |
||||
</div> |
||||
<div class="title title_center">Сертификаты</div> |
||||
<div class="gift-certificates"> |
||||
{% include "payment/gift_certificate_items.html" %} |
||||
</div> |
||||
</div> |
||||
</div> |
||||
{% endblock content %} |
||||
@ -0,0 +1,24 @@ |
||||
{% load static %} |
||||
<div class="popup js-popup-enter-gift-code"> |
||||
<div class="popup__wrap popup__wrap_sm js-popup-wrap"> |
||||
<button class="popup__close js-popup-close"> |
||||
<svg class="icon icon-close"> |
||||
<use xlink:href={% static "img/sprite.svg" %}#icon-close></use> |
||||
</svg> |
||||
</button> |
||||
<div class="popup__body"> |
||||
<div class="enter-gift-code" style="padding:20px 20px 25px;"> |
||||
<div class="subtitle2">Введите код из подарочного сертификата</div> |
||||
<div class="field"> |
||||
<div class="field__label">КОД</div> |
||||
<div class="field__wrap"><input class="field__input enter-gift-code__code" type="text" |
||||
placeholder="" tabindex="1"></div> |
||||
<div class="enter-gift-code__error field__error"></div> |
||||
</div> |
||||
<div style="text-align: center;"> |
||||
<a href="#" class="enter-gift-code__btn btn btn_light" tabindex="3">Подтвердить</a> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
@ -0,0 +1,31 @@ |
||||
{% load static %} |
||||
<div class="popup js-popup-gift-certificate"> |
||||
<div class="popup__wrap popup__wrap_sm js-popup-wrap"> |
||||
<button class="popup__close js-popup-close"> |
||||
<svg class="icon icon-close"> |
||||
<use xlink:href={% static "img/sprite.svg" %}#icon-close></use> |
||||
</svg> |
||||
</button> |
||||
<div class="popup__body" style="padding: 20px;"> |
||||
{% if user_gift_certificate.user.id != request.user.id %} |
||||
<div class="subtitle2">{{ user_gift_certificate.user.get_full_name }} |
||||
подарил{% if user_gift_certificate.user.gender == 'f' %}а{% endif %} вам Сертификат!</div> |
||||
{% else %} |
||||
<div class="subtitle2">Получите подарочный сертификат на сумму {{ gift_certificate.price|floatformat:"-2" }}₽!</div> |
||||
{% endif %} |
||||
<div class="gift-certificates__item" style="margin: 0;"> |
||||
<div class="gift-certificates__preview theme_pink2"></div> |
||||
<div class="gift-certificates__details"> |
||||
<span class="gift-certificates__title theme theme_pink2">подарочный сертификат</span> |
||||
<div class="gift-certificates__price">{{ gift_certificate.price|floatformat:"-2" }}₽</div> |
||||
</div> |
||||
<a class="gift-certificates__buy-btn btn" |
||||
{% if request.user.is_authenticated %} |
||||
href="{% url 'gift-certificate-get' user_gift_certificate.code %}" |
||||
{% else %} |
||||
href="#" data-popup=".js-popup-auth" data-auth-next-url="{% url 'gift-certificate-get' user_gift_certificate.code %}" |
||||
{% endif %}>Получить сертификат</a> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
After Width: | Height: | Size: 367 B |
|
After Width: | Height: | Size: 308 B |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 299 KiB |
|
After Width: | Height: | Size: 300 KiB |
|
After Width: | Height: | Size: 300 KiB |
|
After Width: | Height: | Size: 299 KiB |
|
After Width: | Height: | Size: 300 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 15 KiB |