Still building initial conversions
This commit is contained in:
parent
cea56d2868
commit
3cfd9840e8
23 changed files with 2925 additions and 21 deletions
85
sqrl/templates/admin/auth/user/sqrl_manage.html
Normal file
85
sqrl/templates/admin/auth/user/sqrl_manage.html
Normal file
|
@ -0,0 +1,85 @@
|
|||
{% extends "admin/base_site.html" %}
|
||||
{% load i18n admin_static %}
|
||||
{% load sqrl %}
|
||||
|
||||
{% block title %}Manage SQRL{% endblock %}
|
||||
{% block content_title %}<h1>Manage SQRL</h1>{% endblock %}
|
||||
|
||||
{% block extrahead %}{{ block.super }}
|
||||
<script src="{% static 'sqrl/sqrl.js' %}"></script>
|
||||
{% endblock %}
|
||||
|
||||
{% block extrastyle %}
|
||||
{{ block.super }}
|
||||
<link rel="stylesheet" type="text/css" href="{% static 'admin/css/forms.css' %}"/>
|
||||
<link rel="stylesheet" type="text/css" href="{% static 'admin/sqrl.css' %}"/>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block userlinks %}
|
||||
{% url 'django-admindocs-docroot' as docsroot %}
|
||||
{% if docsroot %}
|
||||
<a href="{{ docsroot }}">{% trans 'Documentation' %}</a> /
|
||||
{% endif %}
|
||||
{% trans 'Manage SQRL' %} /
|
||||
<a href="{% url 'admin:logout' %}">{% trans 'Log out' %}</a>
|
||||
{% endblock %}
|
||||
|
||||
{% block breadcrumbs %}
|
||||
<div class="breadcrumbs">
|
||||
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
|
||||
› {% trans 'Manage SQRL' %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div id="content-main">
|
||||
|
||||
{% if not user.sqrl_identity %}
|
||||
<p>
|
||||
You dont have SQRL identity associated with your account yet.
|
||||
Please use SQRL link/QR code below to associate SQRL identity with your account.
|
||||
</p>
|
||||
{% else %}
|
||||
<p>
|
||||
Congratulations! You already have SQRL identity associated with your account.
|
||||
If you would like to either change or delete existing SQRL identity
|
||||
associated with your account, you can do that by selecting appropriate
|
||||
option in your SQRL client and then using the SQRL link/QR code below.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Note:</strong> For both changing or deleting your SQRL identity,
|
||||
you will need to load your SQRL rescue code.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Caution:</strong> Normally it is not advised to change or delete
|
||||
your SQRL identity. Usually these operations are only required when
|
||||
SQRL identity is compromised.
|
||||
</p>
|
||||
{% endif %}
|
||||
|
||||
{% sqrl as session_sqrl %}
|
||||
|
||||
<fieldset class="module aligned">
|
||||
<div class="sqrl-wrap">
|
||||
SQRL Login
|
||||
<a href="{{ session_sqrl.sqrl_url }}">
|
||||
<div id="sqrl-qr" data-sqrl="{{ session_sqrl.sqrl_url }}"></div>
|
||||
</a>
|
||||
<a href="https://www.grc.com/sqrl/sqrl.htm">What is SQRL?</a>
|
||||
{# redirect to manage page after successful SQRL transaction #}
|
||||
<input type="hidden" name="next" value="{% url 'admin-sqrl_manage' %}">
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<form method="get" action="{{ session_sqrl.sqrl_url }}" class="sqrl">
|
||||
<div class="submit-row">
|
||||
<input type="hidden" name="nut" value="{{ session_sqrl.nut.nonce }}">
|
||||
<input type="submit" value="Manage SQRL" class="default" style="float: left;">
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
19
sqrl/templates/admin/base.html
Normal file
19
sqrl/templates/admin/base.html
Normal file
|
@ -0,0 +1,19 @@
|
|||
{% extends 'contrib/admin/templates/admin/base.html' %}
|
||||
{% load i18n admin_static %}
|
||||
|
||||
{% block userlinks %}
|
||||
{% if site_url %}
|
||||
<a href="{{ site_url }}">{% trans 'View site' %}</a> /
|
||||
{% endif %}
|
||||
{% if user.is_active and user.is_staff %}
|
||||
{% url 'django-admindocs-docroot' as docsroot %}
|
||||
{% if docsroot %}
|
||||
<a href="{{ docsroot }}">{% trans 'Documentation' %}</a> /
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if user.has_usable_password %}
|
||||
<a href="{% url 'admin:password_change' %}">{% trans 'Change password' %}</a> /
|
||||
{% endif %}
|
||||
<a href="{% url 'admin-sqrl_manage' %}">{% trans 'Manage SQRL' %}</a> /
|
||||
<a href="{% url 'admin:logout' %}">{% trans 'Log out' %}</a>
|
||||
{% endblock %}
|
91
sqrl/templates/admin/login.html
Normal file
91
sqrl/templates/admin/login.html
Normal file
|
@ -0,0 +1,91 @@
|
|||
{% extends "admin/base_site.html" %}
|
||||
{% load i18n admin_static %}
|
||||
{% load sqrl %}
|
||||
|
||||
{% block extrastyle %}
|
||||
{{ block.super }}
|
||||
<link rel="stylesheet" type="text/css" href="{% static 'admin/css/login.css' %}"/>
|
||||
<link rel="stylesheet" type="text/css" href="{% static 'admin/sqrl.css' %}"/>
|
||||
{% endblock %}
|
||||
|
||||
{% block bodyclass %}{{ block.super }} login{% endblock %}
|
||||
|
||||
{% block nav-global %}{% endblock %}
|
||||
|
||||
{% block content_title %}{% endblock %}
|
||||
|
||||
{% block breadcrumbs %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% if form.errors and not form.non_field_errors %}
|
||||
<p class="errornote">
|
||||
{% if form.errors.items|length == 1 %}
|
||||
{% trans "Please correct the error below." %}{% else %}
|
||||
{% trans "Please correct the errors below." %}{% endif %}
|
||||
</p>
|
||||
{% endif %}
|
||||
|
||||
{% if form.non_field_errors %}
|
||||
{% for error in form.non_field_errors %}
|
||||
<p class="errornote">
|
||||
{{ error }}
|
||||
</p>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
<div id="content-main">
|
||||
<form action="{{ app_path }}" method="post" id="login-form">{% csrf_token %}
|
||||
<div class="form-row">
|
||||
{{ form.username.errors }}
|
||||
<label for="id_username"
|
||||
class="required">{{ form.username.label }}:</label> {{ form.username }}
|
||||
</div>
|
||||
<div class="form-row">
|
||||
{{ form.password.errors }}
|
||||
<label for="id_password"
|
||||
class="required">{% trans 'Password:' %}</label> {{ form.password }}
|
||||
<input type="hidden" name="next" value="{{ next }}"/>
|
||||
</div>
|
||||
{% url 'admin_password_reset' as password_reset_url %}
|
||||
{% if password_reset_url %}
|
||||
<div class="password-reset-link">
|
||||
<a href="{{ password_reset_url }}">{% trans 'Forgotten your password or username?' %}</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="submit-row">
|
||||
<label> </label><input type="submit" value="{% trans 'Log in' %}"/>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
{% sqrl as session_sqrl %}
|
||||
|
||||
<form method="get" action="{{ session_sqrl.sqrl_url }}" class="sqrl">
|
||||
<p class="align-center or">
|
||||
<span class="line-center">or</span>
|
||||
</p>
|
||||
|
||||
<div>
|
||||
<h3>Login using SQRL</h3>
|
||||
|
||||
<div class="sqrl-wrap">
|
||||
SQRL Login
|
||||
<a href="{{ session_sqrl.sqrl_url }}">
|
||||
<div id="sqrl-qr" data-sqrl="{{ session_sqrl.sqrl_url }}"></div>
|
||||
</a>
|
||||
<a href="https://www.grc.com/sqrl/sqrl.htm">What is SQRL?</a>
|
||||
</div>
|
||||
|
||||
<div class="submit-row">
|
||||
<input type="hidden" name="nut" value="{{ session_sqrl.nut.nonce }}">
|
||||
<input type="submit" value="{% trans 'Log in using SQRL' %}"/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
{% sqrl_status_url_script_tag session_sqrl %}
|
||||
<script type="text/javascript">
|
||||
document.getElementById('id_username').focus()
|
||||
</script>
|
||||
<script src="{% static 'sqrl/sqrl.js' %}"></script>
|
||||
</div>
|
||||
{% endblock %}
|
Loading…
Add table
Add a link
Reference in a new issue