Still building initial conversions

This commit is contained in:
= 2019-09-02 02:03:23 -05:00
parent cea56d2868
commit 3cfd9840e8
Signed by: kiichan
GPG key ID: 619DFD67F0976616
23 changed files with 2925 additions and 21 deletions

View 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>
&rsaquo; {% 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 %}

View 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 %}

View 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>&nbsp;</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 %}

View file

@ -0,0 +1,27 @@
{% extends "sqrl/sqrl_base.html" %}
{% load sqrl %}
{% load static %}
{% block title %}Log in via SQRL{% endblock %}
{% block content %}
<h1>Log in</h1>
<p>
Please use via SQRL using the information below.
</p>
{% sqrl as session_sqrl %}
{% sqrl_login_dropin session_sqrl %}
{% endblock %}
{% comment %}
**sqrl/login.html**
This is SQRL-only login page.
No special variables are passed in the context for the login to work.
All necessary data should already be in the context.
Please note again that this template is for SQRL-exclusive logins.
If you would like to add SQRL login to an existing login page,
you should rather adjust that template as it is probably way more involved.
{% endcomment %}

View file

@ -0,0 +1,54 @@
{% extends "sqrl/sqrl_base.html" %}
{% load sqrl %}
{% load static %}
{% block title %}Manage SQRL Identity{% endblock %}
{% block content %}
<h1>Manage SQRL Identity with your account</h1>
{% 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 %}
{% sqrl_login_dropin session_sqrl method="manage" %}
{% endblock %}
{% block scripts %}
<script src="{% static 'sqrl/sqrl.js' %}"></script>
{% endblock %}
{% comment %}
**sqrl/manage.html**
Used to manage SQRL identity in relation to existing logged in account.
When no SQRL identity is already associated with the account,
it can be used to associate a new identity.
When existing SQRL is already associated, this page can be used
to either change or delete existing identity.
No special variables are passed in the context for the association
to work. All necessary data should already be in the context.
{% endcomment %}

View file

@ -0,0 +1,30 @@
{% extends "sqrl/sqrl_base.html" %}
{% block title %}Complete User Tegistration{% endblock %}
{% block content %}
<h1>Complete User Registration</h1>
<p>
Already have account?
Login <a href="{% url 'login' %}">here</a> to associate
SQRL identity with existing account.
</p>
<form method="post">
{{ form.as_p }}
<input type="submit">
</form>
{% endblock %}
{% comment %}
**sqrl/register.html**
Used to complete user registration. This template is used when user is trying to login
with SQRL however does not already have that SQRL identity associated with any
existing account. Since SQRL does not provide any additional information other then
SQRL identity itslef, we need to collect some additinal information from the user
such as username. All the relevant information is collected via form.
No special variables are passed in the context.
All necessary data should already be in the context.
{% endcomment %}

View file

@ -0,0 +1,41 @@
{% load static %}
{% load sqrl %}
<style>
.sqrl-wrap {
padding: 15px;
background-color: #fff;
text-align: center;
max-width: 300px;
border-radius: 5%;
}
#sqrl-id img {
margin: auto;
width: 100%;
padding-top: 3px;
}
.sqrl-wrap a {
font-size: 50%;
}
</style>
<div>
<form method="get" action="{{ session_sqrl.sqrl_url }}">
<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>
<input type="hidden" name="nut" value="{{ session_sqrl.nut.nonce }}">
{% if session_sqrl.method == "manage" %}
{# redirect to manage page after successful SQRL transaction #}
<input type="hidden" name="next" value="{% url 'sqrl:manage' %}">
<input type="submit" value="Manage SQRL">
{% else %}
<input type="submit" value="Log in using SQRL">
{% endif %}
</form>
</div>
{% sqrl_status_url_script_tag session_sqrl %}
<script src="{% static sqrl/sqrl.js %}"></script>

View file

@ -0,0 +1 @@
{% extends "base.html" %}