-
Notifications
You must be signed in to change notification settings - Fork 244
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: new invites via code * fix: lower emails
- Loading branch information
Showing
31 changed files
with
499 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{% extends "layout.html" %} | ||
|
||
{% block title %} | ||
Инвайт {{ invite.code }} — {{ block.super }} | ||
{% endblock %} | ||
|
||
{% block content %} | ||
<div class="content user-edit"> | ||
<div class="block"> | ||
<div class="block-header">💌<br>Инвайт {{ invite.code }}</div> | ||
|
||
<div class="block-description block-description-center"> | ||
<p> | ||
{% include "invites/widgets/status_badge.html" %} | ||
</p> | ||
|
||
{% if invite.is_used %} | ||
<p> | ||
Пользователь «{{ invite.invited_user.full_name }}» зарегистрировался или продлил свой аккаунт по этому инвайту {{ invite.used_at | date:"j E Y" }} 👇 | ||
</p> | ||
|
||
{% if invite.invited_user %} | ||
{% include "users/widgets/card.html" with user=invite.invited_user %} | ||
{% endif %} | ||
{% elif invite.is_expired %} | ||
<p> | ||
К сожалению, этот инвайт истёк и никто по нему никто так и не зарегистрировался. Больше его использовать не получится. | ||
</p> | ||
{% else %} | ||
<p> | ||
Создан <strong>{{ invite.created_at | date:"j E Y" }}</strong> | ||
</p> | ||
|
||
<p> | ||
Нужно активировать до <strong>{{ invite.expires_at | date:"j E Y" }}</strong> | ||
</p> | ||
|
||
<br> | ||
|
||
<p> | ||
Секретная ссылка, чтобы подарить её другу 👇 | ||
</p> | ||
|
||
<p> | ||
<input type="text" value="{{ settings.APP_HOST }}{% url "show_invite" invite.code %}" style="font-size: 140%; width: 100%;" readonly> | ||
</p> | ||
|
||
<p> | ||
По ней можно зарегистрироваться в Клубе, либо продлить уже существующий аккаунт. | ||
</p> | ||
{% endif %} | ||
</div> | ||
</div> | ||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{% extends "layout.html" %} | ||
{% load static %} | ||
{% load text_filters %} | ||
|
||
{% block title %} | ||
Инвайты в Клуб — {{ block.super }} | ||
{% endblock %} | ||
|
||
{% block content %} | ||
<div class="content user-edit"> | ||
<div class="form-title">💌<br>Инвайты</div> | ||
|
||
<div class="block-description block-description-center"> | ||
<p> | ||
Здесь можно купить инвайт-код и подарить его своему другу, чтобы он смог зарегистрироваться в Клубе или продлил имеющийся аккаунт. | ||
</p> | ||
|
||
<br> | ||
|
||
<form action="{% url "pay" %}" method="get"> | ||
{% csrf_token %} | ||
<input type="hidden" name="product_code" value="club1_invite"> | ||
<input type="hidden" name="is_invite" value="true"> | ||
<button type="submit" class="button">🎁 Купить инвайт-код</button> | ||
</form> | ||
|
||
<div class="invites-list"> | ||
{% for invite in invites %} | ||
<a href="{% url "show_invite" invite.code %}" class="block invites-list-item zoom-on-hover"> | ||
<strong> | ||
Инвайт {{ invite.code|slice:":3" }}...{{ invite.code|slice:"-3:" }} | ||
</strong> | ||
<span> | ||
{% include "invites/widgets/status_badge.html" %} | ||
</span> | ||
<span> | ||
{% if invite.used_at %} | ||
➡️ {{ invite.invited_user.full_name }} | ||
{% elif invite.is_expired %} | ||
истек {{ invite.expires_at | date:"j E Y" }} | ||
{% else %} | ||
истекает {{ invite.expires_at | date:"j E Y" }} | ||
{% endif %} | ||
</span> | ||
</a> | ||
{% endfor %} | ||
</div> | ||
</div> | ||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
{% extends "layout.html" %} | ||
|
||
{% block content %} | ||
<div class="content user-edit"> | ||
<div class="form-title">🎁<br>Вам подарили 1 год в Клубе</div> | ||
|
||
<div class="block"> | ||
<div class="block-description block-description-center"> | ||
<p> | ||
Ого! Пользователь <strong>{{ invite.user.full_name }}</strong> подарил вам 1 год в Вастрик Клубе. Должно быть, вы это заслужили! 🥳 | ||
</p> | ||
|
||
{% if request.me %} | ||
<p>Нажмите на кнопку ниже, чтобы мы начислили его на ваш аккаунт 👇</p> | ||
|
||
{% include "users/widgets/card.html" with user=request.me %} | ||
|
||
<br><br> | ||
|
||
<form action="{% url "activate_invite" invite.code %}" method="post"> | ||
{% csrf_token %} | ||
<input type="hidden" name="email" value="{{ request.me.email }}"> | ||
<div class="form-row"> | ||
<button type="submit" class="button">🔥 Активировать инвайт</button> | ||
</div> | ||
</form> | ||
{% else %} | ||
<p> | ||
Введите адрес своей электронной почты, чтобы мы накинули на него подарочных дней. Если у вас уже есть аккаунт в Клубе — укажите email, который к нему привязан, либо сначала <a href="{% url "login" %}"><strong>войдите</strong></a>. | ||
</p> | ||
|
||
<div class="block-description block-description-center"> | ||
<form action="{% url "activate_invite" invite.code %}" method="post"> | ||
{% csrf_token %} | ||
|
||
<div class="form-row"> | ||
<label for="invited-email" class="form-label"><strong>Ваша почта 👇</strong></label> | ||
<input type="email" name="email" id="invited-email" placeholder="[email protected]" {% if request.me %}value="{{ request.me.email }}"{% endif %} required> | ||
</div> | ||
|
||
<div class="form-row"> | ||
<button type="submit" class="button">🔥 Активировать инвайт</button> | ||
</div> | ||
</form> | ||
</div> | ||
{% endif %} | ||
</div> | ||
|
||
</div> | ||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{% if invite.is_used %} | ||
<span class="badge-invite badge-invite-used">☑️ Использован</span> | ||
{% elif invite.is_expired %} | ||
<span class="badge-invite badge-invite-expired">🕓 Истёк</span> | ||
{% else %} | ||
<span class="badge-invite badge-invite-new">🎁 Активен</span> | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -116,31 +116,7 @@ | |
<div class="block-header">💌<br>Пригласить друга</div> | ||
|
||
<div class="block-description block-description-center"> | ||
У вас есть хороший знакомый, который тоже хочет в Клуб, но не может заплатить долор? | ||
</div> | ||
|
||
<div class="block-description block-description-center"> | ||
Здесь вы можете ввести почту любого человека и подарить ему аккаунт на год! | ||
Не забудьте предупредить друга, что собираетесь выслать ему инвайт, ведь интро ему всё равно придётся написать самостоятельно. | ||
</div> | ||
|
||
<div class="block invite-friend"> | ||
<form action="{% url "pay" %}" method="get"> | ||
{% csrf_token %} | ||
<input type="hidden" name="product_code" value="club1_invite"> | ||
<input type="hidden" name="is_invite" value="true"> | ||
|
||
<label> | ||
<strong>Адрес почты</strong> | ||
<input type="email" name="email" placeholder="[email protected]" required> | ||
</label> | ||
|
||
<button type="submit" class="button">Позвать в Клуб</button> | ||
</form> | ||
</div> | ||
|
||
<div class="block-description block-description-center"> | ||
💡 <strong>Лайфхак:</strong> указав здесь почту существующего члена Клуба, вы продлите ему аккаунт. Только спросите его точный адрес. | ||
<a href="{% url "invites" %}" class="button">🎁 Инвайты переехали сюда</a> | ||
</div> | ||
</div> | ||
{% endblock %} |
Oops, something went wrong.