diff --git a/apps/payment/templates/payment/pay.html b/apps/payment/templates/payment/pay.html
new file mode 100644
index 00000000..ec26e9ca
--- /dev/null
+++ b/apps/payment/templates/payment/pay.html
@@ -0,0 +1,29 @@
+{% extends "templates/lilcity/index.html" %}
+{% load static %}
+{% load rupluralize from plural %}
+
+{% block content %}
+
{{ school_schedule }}
- {% if not is_purchased and request.user_agent.is_mobile and school_schedule.trial_lesson %}
-
Пробный урок
- {% endif %}
{% if is_purchased and live_lesson %}
{% if request.user_agent.is_mobile %}{{ live_lesson.date|date:"j b" }}{% else %}{{ live_lesson.date|date:"j E" }}{% endif %}
@@ -20,11 +17,13 @@
{% include './open_lesson.html' %}
{% endif %}
{% else %}
+ {% comment %}
{% if not is_purchased_future and is_drawing_camp %}
{% include './day_pay_btn.html' %}
{% endif %}
+ {% endcomment %}
{% endif %}
- {% if not is_purchased and not request.user_agent.is_mobile and school_schedule.trial_lesson %}
+ {% if not is_purchased and school_schedule.trial_lesson %}
Пробный урок
{% endif %}
diff --git a/apps/school/templates/summer/buy.html b/apps/school/templates/summer/buy.html
index a7a7cf71..8419f130 100644
--- a/apps/school/templates/summer/buy.html
+++ b/apps/school/templates/summer/buy.html
@@ -2,12 +2,13 @@
- {% if not is_purchased and not is_purchased_future %}Купить доступ от {{ min_school_price }} руб./месяц{% endif %}
+ {% if not is_purchased and not is_purchased_future %}Узнать стоимость{% endif %}
{% if is_purchased_future and not is_purchased %}ваша подписка начинается {{school_purchased_future.date_start}}{% endif %}
{% if is_purchased %}ваша подписка истекает {{ subscription_ends_humanize }}
перейти к оплате{% endif %}
diff --git a/apps/user/models.py b/apps/user/models.py
index d24edf15..7a774998 100644
--- a/apps/user/models.py
+++ b/apps/user/models.py
@@ -114,8 +114,9 @@ class User(AbstractUser):
@property
def ref_url(self):
- return 'https://%s%s?referrer=%s' % (
- settings.MAIN_HOST, reverse('index'), short_url.encode_url(self.id)
+ code = short_url.encode_url(self.id)
+ return 'https://%s%s?referrer=%s&utm_source=referral&utm_medium=referral&utm_content=%s&utm_campaign=ref_campaign' % (
+ settings.MAIN_HOST, reverse('index'), code, code
) if self.id else ''
def serialized(self):
@@ -155,7 +156,7 @@ class User(AbstractUser):
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
+ return bool(last_bonus) and last_bonus.amount > 0 and not last_bonus.notified_at
@property
def paid_one_more(self):
diff --git a/docker/Dockerfile b/docker/Dockerfile
index acaa74c8..d8ad9cf1 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -9,7 +9,7 @@ RUN yarn build
FROM python:3.6
ENV PYTHONUNBUFFERED 1
-RUN apt-get update && apt-get install -y nginx supervisor
+RUN apt-get update && apt-get install -y nginx supervisor sudo
RUN pip3 install --no-cache-dir --upgrade pip uwsgi==2.0.17
WORKDIR /app/
ADD requirements.txt /app/
diff --git a/docker/entrypoint_app.sh b/docker/entrypoint_app.sh
index a346f89c..1b6da756 100755
--- a/docker/entrypoint_app.sh
+++ b/docker/entrypoint_app.sh
@@ -1,6 +1,6 @@
#!/bin/sh
cd /app
chown www-data:www-data /app/media
-python manage.py migrate
+sudo -E -u www-data python manage.py migrate
#python manage.py loaddata /app/apps/*/fixtures/*.json
python2.7 /usr/bin/supervisord -n
diff --git a/project/templates/blocks/footer.html b/project/templates/blocks/footer.html
index 07edfa55..1ef452b3 100644
--- a/project/templates/blocks/footer.html
+++ b/project/templates/blocks/footer.html
@@ -21,8 +21,8 @@
@@ -45,11 +45,11 @@
-
+
+
+
+
+