Cloned DMOJ
This commit is contained in:
parent
f623974b58
commit
49dc9ff10c
513 changed files with 132349 additions and 39 deletions
4
templates/registration/activate.html
Normal file
4
templates/registration/activate.html
Normal file
|
@ -0,0 +1,4 @@
|
|||
{% extends "base.html" %}
|
||||
{% block body %}
|
||||
<p>{{ _('%(key)s is an invalid activation key.', key=activation_key) }}</p>
|
||||
{% endblock %}
|
4
templates/registration/activation_complete.html
Normal file
4
templates/registration/activation_complete.html
Normal file
|
@ -0,0 +1,4 @@
|
|||
{% extends "base.html" %}
|
||||
{% block body %}
|
||||
<p>{{ _('Your account has been successfully activated.') }}</p>
|
||||
{% endblock %}
|
23
templates/registration/activation_email.html
Normal file
23
templates/registration/activation_email.html
Normal file
|
@ -0,0 +1,23 @@
|
|||
<b>Thanks for registering on the {{ site.name }}! We're glad to have you.</b>
|
||||
<br><br>
|
||||
The last step is activating your account. Please activate your {{ SITE_NAME }} account in the next {{ expiration_days }} days.
|
||||
<br><br>
|
||||
Please click on the following link to activate your account:
|
||||
<p style="margin-left:1em">
|
||||
<a href="http://{{ site.domain }}/accounts/activate/{{ activation_key }}/">http://{{ site.domain }}/accounts/activate/{{ activation_key }}</a>
|
||||
</p>
|
||||
|
||||
Alternatively, you can reply to this message to activate your account.
|
||||
Your reply must keep the following text intact for this to work:
|
||||
|
||||
<pre style="margin-left:1em">
|
||||
{{ activation_key }}
|
||||
</pre>
|
||||
|
||||
{% if SITE_ADMIN_EMAIL %}
|
||||
See you soon!
|
||||
<br>
|
||||
If you have problems activating your account, feel free to send us an email at <a href="mailto:{{ SITE_ADMIN_EMAIL }}">{{ SITE_ADMIN_EMAIL }}</a>.
|
||||
{% else %}
|
||||
See you soon!
|
||||
{% endif %}
|
9
templates/registration/activation_email.txt
Normal file
9
templates/registration/activation_email.txt
Normal file
|
@ -0,0 +1,9 @@
|
|||
Please activate your {{ site.name }} account in {{ expiration_days }} days.
|
||||
|
||||
Please click on the following link to activate your account:
|
||||
http://{{ site.domain }}/accounts/activate/{{ activation_key }}/
|
||||
|
||||
Alternatively, you can reply to this message to activate your account.
|
||||
Your reply must keep the following text intact for this to work:
|
||||
|
||||
{{ activation_key }}
|
1
templates/registration/activation_email_subject.txt
Normal file
1
templates/registration/activation_email_subject.txt
Normal file
|
@ -0,0 +1 @@
|
|||
Activate your {{ SITE_NAME }} account
|
85
templates/registration/login.html
Normal file
85
templates/registration/login.html
Normal file
|
@ -0,0 +1,85 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block media %}
|
||||
<style>
|
||||
#login-panel {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
margin: 5em auto auto -10em;
|
||||
top: 40%;
|
||||
left: 50%;
|
||||
}
|
||||
|
||||
h4 {
|
||||
padding-top: 1em;
|
||||
}
|
||||
|
||||
.social {
|
||||
display: inline;
|
||||
font-size: 2.3em;
|
||||
float: none;
|
||||
}
|
||||
|
||||
.google-icon i {
|
||||
color: #DD4B38;
|
||||
}
|
||||
|
||||
.facebook-icon i {
|
||||
color: #133783;
|
||||
}
|
||||
|
||||
.github-icon i {
|
||||
color: black;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<div id="login-panel">
|
||||
<form action="" method="post" class="form-area">
|
||||
{% csrf_token %}
|
||||
{% if form.errors %}
|
||||
<div id="form-errors">
|
||||
<p class="error">{{ _('Invalid username or password.') }}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
<table border="0" style="text-align:left">
|
||||
<tr>
|
||||
<th><i class="fa fa-user fa-fw"></i>
|
||||
</th>
|
||||
<td>{{ form.username }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><i class="fa fa-key fa-fw"></i>
|
||||
</th>
|
||||
<td>{{ form.password }}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<hr>
|
||||
<button style="float:right;" type="submit">{{ _('Login!') }}</button>
|
||||
<input type="hidden" name="next" value="{{ next }}">
|
||||
</form>
|
||||
<br><a href="{{ url('password_reset') }}">{{ _('Forgot your password?') }}</a>
|
||||
|
||||
{% if form.has_google_auth or form.has_facebook_auth or form.has_github_auth %}
|
||||
<h4>{{ _('Or log in with...') }}</h4>
|
||||
{% if form.has_google_auth %}
|
||||
<a href="{{ url('social:begin', "google-oauth2") }}?next={{ next }}" class="social google-icon">
|
||||
<i class="fa fa-google-plus-square"></i>
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if form.has_facebook_auth %}
|
||||
<a href="{{ url('social:begin', "facebook") }}?next={{ next }}" class="social facebook-icon">
|
||||
<i class="fa fa-facebook-square"></i>
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if form.has_github_auth %}
|
||||
<a href="{{ url('social:begin', "github-secure") }}?next={{ next }}" class="social github-icon">
|
||||
<i class="fa fa-github-square"></i>
|
||||
</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
4
templates/registration/logout.html
Normal file
4
templates/registration/logout.html
Normal file
|
@ -0,0 +1,4 @@
|
|||
{% extends "base.html" %}
|
||||
{% block body %}
|
||||
<h3>{{ _('See you later!') }}</h3>
|
||||
{% endblock %}
|
4
templates/registration/password_change_done.html
Normal file
4
templates/registration/password_change_done.html
Normal file
|
@ -0,0 +1,4 @@
|
|||
{% extends "base.html" %}
|
||||
{% block body %}
|
||||
<p>{{ _('Your password was sucessfully changed.') }}</p>
|
||||
{% endblock %}
|
10
templates/registration/password_change_form.html
Normal file
10
templates/registration/password_change_form.html
Normal file
|
@ -0,0 +1,10 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block body %}
|
||||
<form action="" method="post" class="form-area">
|
||||
{% csrf_token %}
|
||||
<table border="0" class="django-as-table">{{ form.as_table() }}</table>
|
||||
<hr>
|
||||
<button style="float:right;" type="submit">{{ _('Change Password') }}</button>
|
||||
</form>
|
||||
{% endblock %}
|
9
templates/registration/password_reset.html
Normal file
9
templates/registration/password_reset.html
Normal file
|
@ -0,0 +1,9 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block body %}
|
||||
<form action="" method="post" class="form-area">{% csrf_token %}
|
||||
<table border="0">{{ form.as_table() }}</table>
|
||||
<hr>
|
||||
<button style="float:right;" type="submit">{{ _('Send Reset Email') }}</button>
|
||||
</form>
|
||||
{% endblock %}
|
5
templates/registration/password_reset_complete.html
Normal file
5
templates/registration/password_reset_complete.html
Normal file
|
@ -0,0 +1,5 @@
|
|||
{% extends "base.html" %}
|
||||
{% block body %}
|
||||
<p>{{ _('Your password has been set. You may go ahead and log in now') }}</p>
|
||||
<a href="{{ url('auth_login') }}">{{ _('Log in') }}</a>
|
||||
{% endblock %}
|
14
templates/registration/password_reset_confirm.html
Normal file
14
templates/registration/password_reset_confirm.html
Normal file
|
@ -0,0 +1,14 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block body %}
|
||||
{% if validlink %}
|
||||
<form action="" method="post" class="form-area">
|
||||
{% csrf_token %}
|
||||
<table border="0" class="django-as-table">{{ form.as_table() }}</table>
|
||||
<hr>
|
||||
<button style="float:right;" type="submit">{{ _('Reset Password') }}</button>
|
||||
</form>
|
||||
{% else %}
|
||||
<p>Invalid password reset link.</p>
|
||||
{% endif %}
|
||||
{% endblock %}
|
6
templates/registration/password_reset_done.html
Normal file
6
templates/registration/password_reset_done.html
Normal file
|
@ -0,0 +1,6 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block body %}
|
||||
<p>{{ _("We've emailed you instructions for setting your password. You should be receiving them shortly.") }}</p>
|
||||
<p>{{ _("If you don't receive an email, please make sure you've entered the address you registered with, and check your spam folder.") }}</p>
|
||||
{% endblock %}
|
19
templates/registration/password_reset_email.html
Normal file
19
templates/registration/password_reset_email.html
Normal file
|
@ -0,0 +1,19 @@
|
|||
<span style="display:block;margin: 0 2px;padding: 1em;border: 3px solid #FFDE05;background-color: #000;border-radius: 6px;font-size: .95em;color: #444;margin-bottom:0.75em">
|
||||
<div style="display:table;margin-left:2em"><img src="https://avatars1.githubusercontent.com/u/6934864?v=3&s=101" style="display:inline;vertical-align: middle">
|
||||
<h1 style="font-size:4em;display:inline;vertical-align: middle"><a href="//{{ domain }}" style="text-decoration:none;color:gray"><span style="color: #FFDE05">DM::</span>OJ</a>
|
||||
</h1>
|
||||
</div>
|
||||
</span>
|
||||
<div style="display:block;margin: 0 2px;padding: 1em;border: 3px solid #2980B9;background-color: #f8f8f8;border-radius: 6px;font-size: .95em;color: #444;">
|
||||
|
||||
<b>Forgot your password on the {{ site_name }}? Don't worry!</b><br><br>
|
||||
To reset the password for your account "{{ user.get_username() }}", click the below button.
|
||||
<p align="center">
|
||||
<a href="{{ protocol }}://{{ domain }}{{ url('password_reset_confirm', uidb64=uid, token=token) }}" style="cursor: pointer;display:block;text-align: center;padding: 4px 2px 5px;color: white;border: 1px solid #666;border-radius: 1px;background: #2980b9;background: linear-gradient(180deg, #00aee0, #2980b9);text-decoration: none;line-height:2em;font-size:1emm;width:12em;">Reset password</a>
|
||||
</p>
|
||||
{% if SITE_ADMIN_EMAIL %}
|
||||
See you soon! If you have problems resetting your email, feel free to shoot us an email at <a href="mailto:{{ SITE_ADMIN_EMAIL }}">{{ SITE_ADMIN_EMAIL }}</a>
|
||||
{% else %}
|
||||
See you soon!
|
||||
{% endif %}
|
||||
</div>
|
11
templates/registration/password_reset_email.txt
Normal file
11
templates/registration/password_reset_email.txt
Normal file
|
@ -0,0 +1,11 @@
|
|||
{% trans %}You're receiving this email because you requested a password reset for your user account at {{ site_name }}.{% endtrans %}
|
||||
|
||||
{{ _('Please go to the following page and choose a new password:') }}
|
||||
{% block reset_link %}
|
||||
{{ protocol }}://{{ domain }}{{ url('password_reset_confirm', uidb64=uid, token=token) }}
|
||||
{% endblock %}
|
||||
{{ _("Your username, in case you've forgotten:") }} {{ user.get_username() }}
|
||||
|
||||
{{ _('Thanks for using our site!') }}
|
||||
|
||||
{% trans %}The {{ site_name }} team{% endtrans %}
|
1
templates/registration/password_reset_subject.txt
Normal file
1
templates/registration/password_reset_subject.txt
Normal file
|
@ -0,0 +1 @@
|
|||
{% trans %}Password reset on {{ site_name }}{% endtrans %}
|
58
templates/registration/profile_creation.html
Normal file
58
templates/registration/profile_creation.html
Normal file
|
@ -0,0 +1,58 @@
|
|||
{% extends "base.html" %}
|
||||
{% block media %}
|
||||
<link rel="stylesheet" href="{{ static('libs/timezone-map/timezone-map.css') }}">
|
||||
{{ form.media.css }}
|
||||
<style>
|
||||
.map-inset {
|
||||
background: url('{{TIMEZONE_MAP}}') 50% 50%
|
||||
}
|
||||
|
||||
.map-wrap {
|
||||
display: none
|
||||
}
|
||||
|
||||
.featherlight {
|
||||
z-index: 1000
|
||||
}
|
||||
|
||||
.featherlight .featherlight-content {
|
||||
min-width: 80%
|
||||
}
|
||||
|
||||
{% if TIMEZONE_BG %}
|
||||
.map-wrap {
|
||||
background: {{TIMEZONE_BG}}
|
||||
}
|
||||
{% endif %}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block js_media %}{{ form.media.js }}{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<form action="" method="post" class="form-area">
|
||||
{% csrf_token %}
|
||||
<table border="0" style="text-align:left">{{ form.as_table() }}</table>
|
||||
<input type="submit" style="float:right;" value="{{ _('Continue >') }}">
|
||||
</form>
|
||||
|
||||
<div class="map-wrap">
|
||||
<div class="map-inset">
|
||||
<div class="map-axis-x"></div>
|
||||
<div class="map-axis-y"></div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block bodyend %}
|
||||
<script type="text/javascript" src="{{ static('libs/timezone-map/timezone-picker.js') }}"></script>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$('#open-map').featherlight({
|
||||
afterOpen: function () {
|
||||
timezone_picker($('.featherlight-inner .map-inset'), $('#id_timezone'), '{{ static('libs/timezone-map/timezone-picker.json') }}');
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
4
templates/registration/registration_closed.html
Normal file
4
templates/registration/registration_closed.html
Normal file
|
@ -0,0 +1,4 @@
|
|||
{% extends "base.html" %}
|
||||
{% block body %}
|
||||
<p>{{ _('Registration is currently closed. Please contact an administrator.') }}</p>
|
||||
{% endblock %}
|
4
templates/registration/registration_complete.html
Normal file
4
templates/registration/registration_complete.html
Normal file
|
@ -0,0 +1,4 @@
|
|||
{% extends "base.html" %}
|
||||
{% block body %}
|
||||
<p>{{ _('You have successfully been registered. An email has been sent to the email address you provided to confirm your registration.') }}</p>
|
||||
{% endblock %}
|
220
templates/registration/registration_form.html
Normal file
220
templates/registration/registration_form.html
Normal file
|
@ -0,0 +1,220 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block media %}
|
||||
{% include "timezone/media-css.html" %}
|
||||
{{ form.media.css }}
|
||||
<style>
|
||||
.sortedm2m-container, .sortedm2m-container p.selector-filter {
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
.sortedm2m-container p.selector-filter input {
|
||||
width: 262px;
|
||||
}
|
||||
|
||||
ul.sortedm2m {
|
||||
width: 284px;
|
||||
min-height: 100px;
|
||||
max-height: 200px;
|
||||
}
|
||||
|
||||
.sortedm2m-container, .sortedm2m-container p.selector-filter {
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
.sortedm2m-container p.selector-filter input {
|
||||
width: 262px;
|
||||
}
|
||||
|
||||
ul.sortedm2m {
|
||||
width: 284px;
|
||||
min-height: 70px;
|
||||
max-height: 200px;
|
||||
height: 70px
|
||||
}
|
||||
|
||||
.grayed {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.inline-header {
|
||||
float: left;
|
||||
font-size: 1.1em;
|
||||
padding: 4px 8px;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
.block-header {
|
||||
color: #555;
|
||||
font-size: 1.1em;
|
||||
font-weight: 600;
|
||||
padding-bottom: 0.2em;
|
||||
padding-left: 2px;
|
||||
margin-top: 0.75em
|
||||
}
|
||||
|
||||
.fullwidth {
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.fullwidth input {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.fullwidth-error input {
|
||||
width: 100%;
|
||||
border-color: red;
|
||||
}
|
||||
|
||||
.form-field-error {
|
||||
color: red;
|
||||
}
|
||||
|
||||
small {
|
||||
font-size: 0.7em;
|
||||
padding-left: 0.6em;
|
||||
}
|
||||
|
||||
#edit-form {
|
||||
border: unset;
|
||||
background: unset;
|
||||
max-width: 450px;
|
||||
width: 450px;
|
||||
}
|
||||
|
||||
#content-body {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#center-float {
|
||||
display: inline-block;
|
||||
text-align: initial;
|
||||
max-width: 450px;
|
||||
width: 450px;
|
||||
}
|
||||
|
||||
ul.errorlist {
|
||||
margin: 0px;
|
||||
text-align: right;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.full-textfield {
|
||||
padding-top: 0.5em;
|
||||
}
|
||||
|
||||
.tos-section {
|
||||
display: inline-block;
|
||||
padding-right: 1em;
|
||||
}
|
||||
|
||||
.pass-req {
|
||||
padding: 0;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block js_media %}
|
||||
{% include "timezone/media-js.html" %}
|
||||
{{ form.media.js }}
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$('.pass-req-link').click(function () {
|
||||
$('.pass-req').toggle('fast');
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% if form.captcha %}
|
||||
{{ recaptcha_init(LANGUAGE_CODE) }}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<div id="center-float">
|
||||
<form id="edit-form" action="" method="post" class="form-area">
|
||||
{% csrf_token %}
|
||||
|
||||
<div class="block-header">{{ _('Username') }}</div>
|
||||
<span class="fullwidth{% if form.username.errors %}-error{% endif %}">{{ form.username }}</span>
|
||||
{% if form.username.errors %}
|
||||
<div class="form-field-error">{{ form.username.errors }}</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="block-header">{{ _('Email') }}</div>
|
||||
<span class="fullwidth{% if form.email.errors %}-error{% endif %}">{{ form.email }}</span>
|
||||
{% if form.email.errors %}
|
||||
<div class="form-field-error">{{ form.email.errors }}</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="block-header">{{ _('Password') -}}
|
||||
<small>(<a href="#" class="pass-req-link">?</a>)</small>
|
||||
</div>
|
||||
<div style="display: none" class="pass-req alert alert-info">
|
||||
<ul>
|
||||
{% for validator in password_validators %}
|
||||
<li>{{ validator.get_help_text() }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
<span class="fullwidth{% if form.password1.errors %}-error{% endif %}">{{ form.password1 }}</span>
|
||||
{% if form.password1.errors %}
|
||||
<div class="form-field-error">{{ form.password1.errors }}</div>
|
||||
{% endif %}
|
||||
<div class="block-header">{{ _('Password') }}<sup style="font-size: 0.7em;padding-left: 0.2em;">2</sup>{# -#}
|
||||
<small>{{ _('(again, for confirmation)') }}</small>
|
||||
</div>
|
||||
<span class="fullwidth{% if form.password2.errors %}-error{% endif %}">{{ form.password2 }}</span>
|
||||
{% if form.password2.errors %}
|
||||
<div class="form-field-error">{{ form.password2.errors }}</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="block-header">{{ _('Timezone') }}<small>{{ _('(select your closest major city)') }}</small></div>
|
||||
<div class="fullwidth">
|
||||
<div>{{ form.timezone }}
|
||||
<div style="float: right">
|
||||
{{ _('or') }}
|
||||
<a id="open-map" href="#" data-featherlight=".map-wrap">{{ _('pick from map') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="block-header">{{ _('Default language') }}</div>
|
||||
<span class="fullwidth">{{ form.language }}</span>
|
||||
|
||||
<div class="block-header">{{ _('Affiliated organizations') }}</div>
|
||||
{{ form.organizations }}
|
||||
|
||||
{% if form.newsletter %}
|
||||
<div style="padding-top: 0.5em;">{{ form.newsletter }}
|
||||
<label for="id_newsletter" style="float: unset;"
|
||||
class="inline-header grayed">{{ _('Notify me about upcoming contests') }}</label>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if form.captcha %}
|
||||
<div style="margin-top: 0.5em">{{ form.captcha }}</div>
|
||||
{% if form.captcha.errors %}
|
||||
<div class="form-field-error">{{ form.captcha.errors }}</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
<hr>
|
||||
{% if tos_url %}
|
||||
<span class="tos-section">
|
||||
{{ _('By registering, you agree to our') }}
|
||||
<a href="{{ tos_url }}">{{ _('Terms & Conditions') }}</a>.
|
||||
</span>
|
||||
{% endif %}
|
||||
<button style="float:right;" type="submit">{{ _('Register!') }}</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="map-wrap">
|
||||
<div class="map-inset">
|
||||
<div class="map-axis-x"></div>
|
||||
<div class="map-axis-y"></div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
43
templates/registration/totp_auth.html
Normal file
43
templates/registration/totp_auth.html
Normal file
|
@ -0,0 +1,43 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block media %}
|
||||
<style>
|
||||
#login-panel-2fa {
|
||||
position: relative;
|
||||
margin: 5em auto auto -10em;
|
||||
top: 40%;
|
||||
left: 50%;
|
||||
}
|
||||
|
||||
#totp-token-container {
|
||||
margin: 0.5em 0;
|
||||
}
|
||||
|
||||
#id_totp_token {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.totp-panel-message {
|
||||
width: 300px;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<div id="login-panel-2fa">
|
||||
<form action="" method="post" class="form-area">
|
||||
{% csrf_token %}
|
||||
{% if form.errors %}
|
||||
<div id="form-errors">
|
||||
<p class="error">{{ _('Invalid Two Factor Authentication token.') }}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div><label class="inline-header grayed">{{ _('Enter the 6-digit code generated by your app:') }}</label></div>
|
||||
<div id="totp-token-container"><span class="fullwidth">{{ form.totp_token }}</span></div>
|
||||
<hr>
|
||||
<button style="float:right;" type="submit">{{ _('Login!') }}</button>
|
||||
</form>
|
||||
<p class="totp-panel-message">{{ _('If you lost your authentication device, please contact us at %(email)s.', email=SITE_ADMIN_EMAIL)|urlize }}</p>
|
||||
</div>
|
||||
{% endblock %}
|
51
templates/registration/totp_disable.html
Normal file
51
templates/registration/totp_disable.html
Normal file
|
@ -0,0 +1,51 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block media %}
|
||||
<style>
|
||||
.inline-header {
|
||||
font-size: 1.1em;
|
||||
padding: 4px 8px;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
.block-header {
|
||||
font-size: 1.1em;
|
||||
}
|
||||
|
||||
.block-header:first-of-type {
|
||||
padding-top: 0.5em;
|
||||
}
|
||||
|
||||
#center-float {
|
||||
position: relative;
|
||||
margin: 0 auto auto -28.5em;
|
||||
left: 50%;
|
||||
width: 700px;
|
||||
}
|
||||
|
||||
#totp-disable-form {
|
||||
border: unset;
|
||||
background: unset;
|
||||
max-width: 700px;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<div id="center-float">
|
||||
<form id="totp-disable-form" action="" method="post" class="form-area">
|
||||
{% csrf_token %}
|
||||
<div class="block-header">{{ _('To protect your account, you must first authenticate before you can disable Two Factor Authentication.') }}</div>
|
||||
{% if form.totp_token.errors %}
|
||||
<div class="form-errors">
|
||||
{{ form.totp_token.errors }}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div>
|
||||
<label class="inline-header grayed">{{ _('Enter the 6-digit code generated by your app:') }}</label>
|
||||
<span class="fullwidth">{{ form.totp_token }}</span>
|
||||
</div>
|
||||
<button style="margin-top: 0.5em" class="button" type="submit">{{ _('Disable Two Factor Authentication') }}</button>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
89
templates/registration/totp_enable.html
Normal file
89
templates/registration/totp_enable.html
Normal file
|
@ -0,0 +1,89 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block media %}
|
||||
<style>
|
||||
.inline-header {
|
||||
font-size: 1.1em;
|
||||
padding: 4px 8px;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
.block-header {
|
||||
font-size: 1.1em;
|
||||
}
|
||||
|
||||
.block-header:first-of-type {
|
||||
padding-top: 0.5em;
|
||||
}
|
||||
|
||||
#center-float {
|
||||
position: relative;
|
||||
margin: 0 auto auto -28.5em;
|
||||
left: 50%;
|
||||
width: 700px;
|
||||
}
|
||||
|
||||
#totp-enable-form {
|
||||
border: none;
|
||||
background: none;
|
||||
max-width: 700px;
|
||||
}
|
||||
|
||||
.totp-qr-code img, .totp-qr-code canvas {
|
||||
width: 400px;
|
||||
max-width: 100%;
|
||||
margin: 0 auto;
|
||||
display: block;
|
||||
-ms-interpolation-mode: nearest-neighbor;
|
||||
image-rendering: -webkit-optimize-contrast;
|
||||
image-rendering: -webkit-crisp-edges;
|
||||
image-rendering: -o-crisp-edges;
|
||||
image-rendering: pixelated;
|
||||
image-rendering: -moz-crisp-edges;
|
||||
image-rendering: crisp-edges;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block js_media %}
|
||||
<script>
|
||||
$(function () {
|
||||
if (window.navigator.userAgent.indexOf('Edge') >= 0) {
|
||||
var $qr = $('.totp-qr-code');
|
||||
var $canvas = $('<canvas width="400" height="400">').appendTo($qr);
|
||||
var ctx = $canvas[0].getContext('2d');
|
||||
$qr.find('img').on('load', function () {
|
||||
ctx.msImageSmoothingEnabled = false;
|
||||
ctx.imageSmoothingEnabled = false;
|
||||
ctx.drawImage(this, 0, 0, 400, 400);
|
||||
$(this).hide();
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<div id="center-float">
|
||||
<form id="totp-enable-form" action="" method="post" class="form-area">
|
||||
{% csrf_token %}
|
||||
|
||||
<div class="block-header">{{ _('Scan this code with your authenticator app:') }}</div>
|
||||
<div class="totp-qr-code"><img src="{{ qr_code }}" alt="{{ _('QR code') }}"></div>
|
||||
<div class="inline-header">{{ _('Or enter this code manually:') }}
|
||||
<code class="totp-code">{{ totp_key }}</code>
|
||||
</div>
|
||||
<hr>
|
||||
{% if form.totp_token.errors %}
|
||||
<div class="form-errors">
|
||||
{{ form.totp_token.errors }}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div>
|
||||
<label class="inline-header grayed">{{ _('Enter the 6-digit code generated by your app:') }}</label>
|
||||
<span class="fullwidth">{{ form.totp_token }}</span>
|
||||
</div>
|
||||
<button style="margin-top: 0.5em" class="button" type="submit">{{ _('Enable Two Factor Authentication') }}</button>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
9
templates/registration/username_select.html
Normal file
9
templates/registration/username_select.html
Normal file
|
@ -0,0 +1,9 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block body %}
|
||||
<form action="" method="post" class="form-area">
|
||||
{% csrf_token %}
|
||||
<table border="0" style="text-align:left">{{ form.as_table() }}</table>
|
||||
<input type="submit" style="float:right;" value="{{ _('Continue >') }}">
|
||||
</form>
|
||||
{% endblock %}
|
Loading…
Add table
Add a link
Reference in a new issue