app-MAIL-temp/app/dashboard/templates/dashboard/referral.html

160 lines
5.3 KiB
HTML
Raw Normal View History

2020-04-09 22:39:39 +02:00
{% extends 'default.html' %}
{% block title %}
Referral
{% endblock %}
{% set active_page = "setting" %}
{% block default_content %}
<div class="col">
2020-11-13 16:18:09 +01:00
<h1 class="h3 mb-5"> Referrals
<a class="ml-3 text-info" style="font-size: 12px" data-toggle="collapse" href="#howtouse" role="button"
aria-expanded="false" aria-controls="collapseExample">
How to use <i class="fe fe-chevrons-down"></i>
</a>
</h1>
<div class="alert alert-primary collapse" id="howtouse" role="alert">
On this page, you can create a <b>referral code</b> that you can use when referring people to SimpleLogin.
For every user who <b>upgrades</b> and stays with us at least 3 months, you'll get $5 :). <br>
2020-11-13 16:18:09 +01:00
The payout can be initiated any time, just send us an email at
<a href="mailto:hi@simplelogin.io">hi@simplelogin.io</a> when you want to receive the payout.
</div>
2020-04-09 22:39:39 +02:00
{% if referrals|length == 0 %}
<div class="alert alert-info">
You don't have any referral code yet. Let's create the first one and start inviting your friends! <br>
</div>
{% endif %}
{% for referral in referrals %}
<div class="card p-4 shadow-sm {% if referral.id == highlight_id %} highlight-row {% endif %}">
2020-05-02 18:11:10 +02:00
<form method="post">
<input type="hidden" name="form-name" value="update">
<input type="hidden" name="referral-id" value="{{ referral.id }}">
<div class="d-flex mb-3">
2020-05-03 10:46:35 +02:00
<div class="mr-2">
2020-05-02 18:11:10 +02:00
<input name="name" class="form-control" value="{{ referral.name or '' }}">
</div>
<div>
<button class="btn btn-outline-success">Update</button>
</div>
</div>
</form>
2020-07-02 08:48:59 +02:00
{% set nb_user = referral.nb_user() %}
{% set nb_paid_user = referral.nb_paid_user() %}
{% if nb_user > 0 %}
2020-04-09 22:39:39 +02:00
<div class="mb-3">
2020-07-02 08:48:59 +02:00
<b class="h1">{{ nb_user }}</b>
{% if nb_user == 1 %} person {% else %} people {% endif %}
2020-11-13 16:18:09 +01:00
has their online privacy protected thanks to you! <br>
2020-07-02 08:48:59 +02:00
Among them, <b class="h1">{{ nb_paid_user }}</b>
{% if nb_paid_user == 1 %} person {% else %} people {% endif %}
has upgraded their accounts.
2020-04-09 22:39:39 +02:00
</div>
{% endif %}
2020-05-03 10:46:35 +02:00
<div class="mt-2">
2020-04-09 22:39:39 +02:00
Please use this referral link to invite your friends trying out SimpleLogin: <br>
2020-05-03 10:46:35 +02:00
<div class="d-flex mb-5 mt-2" style="max-width: 40em">
<div class="flex-grow-1 mr-2">
2020-04-09 22:39:39 +02:00
<input class="form-control" id="referral-{{ referral.id }}" readonly
value="{{ referral.link() }}">
</div>
<div>
2020-05-03 10:46:35 +02:00
<button class="clipboard btn btn-outline-primary" data-clipboard-action="copy"
2020-04-09 22:39:39 +02:00
data-clipboard-text="{{ referral.link() }}"
data-clipboard-target="#referral-{{ referral.id }}">
2020-05-03 10:46:35 +02:00
Copy <i class="fe fe-clipboard"></i>
2020-04-09 22:39:39 +02:00
</button>
</div>
</div>
</div>
2020-05-02 18:11:10 +02:00
<div class="mb-3">
You can also use the referral code <b>{{ referral.code }}</b> when sharing any link on SimpleLogin. <br>
2020-11-13 16:18:09 +01:00
Just append
<em data-toggle="tooltip"
title="Click to copy"
class="clipboard"
data-clipboard-text="{{ '?slref=' + referral.code }}" style="overflow-wrap: break-word">
?slref={{ referral.code }}
</em>
to any link on SimpleLogin website.
2020-05-02 18:11:10 +02:00
</div>
2020-05-02 18:14:09 +02:00
<div>
<form method="post">
<input type="hidden" name="form-name" value="delete">
<input type="hidden" name="referral-id" value="{{ referral.id }}">
<span class="delete-referral float-right btn btn-outline-danger">Delete</span>
</form>
</div>
2020-04-09 22:39:39 +02:00
</div>
{% endfor %}
{% if referrals|length > 0 %}
<hr>
{% endif %}
<form method="post" class="mt-6">
2020-05-02 18:11:10 +02:00
<input type="hidden" name="form-name" value="create">
2020-11-13 16:18:09 +01:00
<div class="form-group">
<input name="code" class="form-control"
pattern="[0-9a-z-_]{3,}"
placeholder="Referral Code"
title="At least 3 characters. Only lowercase letters, numbers, dashes (-) and underscores (_) are currently supported.">
<div class="small-text">
At least 3 characters. Only lowercase letters, numbers,
dashes (-) and underscores (_) are currently supported.
</div>
</div>
<div class="form-group">
<input name="name" class="form-control"
2020-05-02 18:11:10 +02:00
placeholder="Referral name, something to help you remember why you create it :)">
2020-11-13 16:18:09 +01:00
</div>
<button class="btn btn-success mb-5">Create</button>
2020-04-09 22:39:39 +02:00
</form>
</div>
2020-05-02 18:14:09 +02:00
{% endblock %}
{% block script %}
<script>
$(".delete-referral").on("click", function (e) {
let that = $(this);
bootbox.confirm({
message: "This operation is irreversible, please confirm.",
buttons: {
confirm: {
label: 'Yes, delete it',
className: 'btn-danger'
},
cancel: {
label: 'Cancel',
className: 'btn-outline-primary'
}
},
callback: function (result) {
if (result) {
that.closest("form").submit();
}
}
})
});
</script>
2020-04-09 22:39:39 +02:00
{% endblock %}