Browse Source

make trial implicit & effective on registration

master
alice 1 week ago
parent
commit
70e0fd7123
3 changed files with 3 additions and 22 deletions
  1. +1
    -1
      lambdainst/models.py
  2. +1
    -0
      lambdainst/views.py
  3. +1
    -21
      templates/lambdainst/account.html

+ 1
- 1
lambdainst/models.py View File

@@ -99,7 +99,7 @@ setup_sync_hooks(User, VPNUser)

@receiver(post_save, sender=User)
def create_vpnuser(sender, instance, created, **kwargs):
if created:
if created and not instance.vpnuser:
VPNUser.objects.create(user=instance)




+ 1
- 0
lambdainst/views.py View File

@@ -94,6 +94,7 @@ def signup(request):
pass

user.vpnuser.campaign = request.session.get('campaign')
user.vpnuser.add_paid_time(timedelta(days=7))

if site_config.TRIAL_ON_SIGNUP:
trial_time = timedelta(hours=site_config.TRIAL_ON_SIGNUP)


+ 1
- 21
templates/lambdainst/account.html View File

@@ -166,30 +166,10 @@
</div>
{% endif %}

{% if user.vpnuser.can_have_trial %}
<div class="content-box account-trial">
<p>
{% blocktrans trimmed with left=user.vpnuser. %}
For up to one week, you can activate your free trial for two hours by clicking on this button:
{% endblocktrans %}
</p>
<form action="/account/trial" method="post" class="pure-form" name="trial_form">
{% csrf_token %}
<div class="h-captcha" data-sitekey="{{ hcaptcha_site_key }}" data-callback="onCaptcha"></div>
<script src="https://hcaptcha.com/1/api.js" async defer></script>
<script>
function onCaptcha(v) {
document.forms.trial_form.submit();
}
</script>
</form>
</div>
{% endif %}

<div class="account-aff-box">
<p>
{% blocktrans trimmed %}
Get two weeks for free for every referral that takes at least one month!
Get two weeks for free for every referral that subscribes for any amount of time!
{% endblocktrans %}
{% trans 'Share this link' %}:
<form class="pure-form">


Loading…
Cancel
Save