parent
9b41841c67
commit
8fdde04bfe
24 changed files with 505 additions and 18 deletions
@ -0,0 +1,82 @@ |
||||
{% extends "notification/email/_base.html" %} |
||||
|
||||
{% block content %} |
||||
<p style="text-align: center;font-size: 32px;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="{% url 'index' %}?gift-certificate={{ user_gift_certificate.code }}" style=" |
||||
color: #FF9393; |
||||
font-weight: bold; |
||||
">{% url 'gift-certificate-get' 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: 24px; |
||||
font-weight: bold; |
||||
margin-bottom: 10px; |
||||
">Ваш код |
||||
</div> |
||||
<div style=" |
||||
text-align: center; |
||||
font-size: 22px; |
||||
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> |
||||
{% 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)), |
||||
('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,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,25 @@ |
||||
{% load thumbnail %} |
||||
{% load static %} |
||||
{% load data_liked from data_liked %} |
||||
|
||||
<div class="gift-certificates__item"> |
||||
<div class="gift-certificates__preview {{ theme_color }}"></div> |
||||
<div class="gift-certificates__details"> |
||||
<span class="gift-certificates__title theme {{ theme_color }}">подарочный сертификат</span> |
||||
<div class="gift-certificates__price">{{ gift_certificate.price|floatformat:"-2" }}₽</div> |
||||
</div> |
||||
{% if user_gift_certificate %} |
||||
{% if user_gift_certificate.bonuses_sent %} |
||||
<div>Получено</div> |
||||
{% else %} |
||||
<div>Ожидает получения</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,31 @@ |
||||
{% 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">Если вам не совсем удобно заниматься с нами каждый день в нашей онлайн-школе, специально для вас мы |
||||
делаем отдельные уроки в записи, которые вы можете проходить, когда вам будет удобно.<br><br> |
||||
Учите и развивайте креативное мышление когда и где угодно |
||||
</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,27 @@ |
||||
{% 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"> |
||||
<div class="subtitle">{{ user_gift_certificate.user.get_full_name }} |
||||
подарил{% if user_gift_certificate.user.gender = 'f' %}а{% endif %} вам Сертификат!</div> |
||||
<div class="gift-certificates__item"> |
||||
<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> |
||||
Loading…
Reference in new issue