2018-11-24 21:26:53 +00:00
|
|
|
{% extends "login/base.html" %}
|
|
|
|
|
|
|
|
{% load utils %}
|
|
|
|
{% load i18n %}
|
|
|
|
|
|
|
|
{% block title %}
|
2018-12-14 14:18:02 +00:00
|
|
|
{% title 'Authorize Application' %}
|
2018-11-24 21:26:53 +00:00
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block card %}
|
|
|
|
<header class="login-pf-header">
|
2018-12-14 14:18:02 +00:00
|
|
|
<h1>{% trans 'Authorize Application' %}</h1>
|
2018-11-24 21:26:53 +00:00
|
|
|
</header>
|
|
|
|
<form method="POST">
|
|
|
|
{% csrf_token %}
|
|
|
|
{% if not error %}
|
|
|
|
{% csrf_token %}
|
|
|
|
{% for field in form %}
|
2018-11-25 11:31:55 +00:00
|
|
|
{% if field.is_hidden %}
|
|
|
|
{{ field }}
|
|
|
|
{% endif %}
|
2018-11-24 21:26:53 +00:00
|
|
|
{% endfor %}
|
|
|
|
<div class="form-group">
|
|
|
|
<p class="subtitle">
|
|
|
|
{% blocktrans with remote=application.name %}
|
|
|
|
You're about to sign into {{ remote }}
|
|
|
|
{% endblocktrans %}
|
|
|
|
</p>
|
|
|
|
<p>{% trans "Application requires following permissions" %}</p>
|
|
|
|
<ul>
|
|
|
|
{% for scope in scopes_descriptions %}
|
|
|
|
<li>{{ scope }}</li>
|
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
|
|
|
{{ form.errors }}
|
|
|
|
{{ form.non_field_errors }}
|
|
|
|
<p>
|
|
|
|
{% blocktrans with user=user %}
|
|
|
|
You are logged in as {{ user }}. Not you?
|
|
|
|
{% endblocktrans %}
|
|
|
|
<a href="{% url 'passbook_core:auth-logout' %}">{% trans 'Logout' %}</a>
|
|
|
|
</p>
|
|
|
|
<div class="form-group">
|
2018-12-09 20:07:18 +00:00
|
|
|
<input type="submit" class="btn btn-success btn-disabled btn-lg click-spinner" name="allow" value="{% trans 'Continue' %}">
|
2018-11-24 21:26:53 +00:00
|
|
|
<a href="{% back %}" class="btn btn-default btn-lg">{% trans "Cancel" %}</a>
|
|
|
|
</div>
|
2018-12-09 20:07:18 +00:00
|
|
|
<div class="form-group spinner-hidden hidden">
|
|
|
|
<div class="spinner"></div>
|
|
|
|
</div>
|
2018-11-24 21:26:53 +00:00
|
|
|
</div>
|
|
|
|
{% else %}
|
|
|
|
<div class="login-group">
|
|
|
|
<p class="subtitle">
|
|
|
|
{% blocktrans with err=error.error %}Error: {{ err }}{% endblocktrans %}
|
|
|
|
</p>
|
|
|
|
<p>{{ error.description }}</p>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
</form>
|
|
|
|
{% endblock %}
|
2018-12-09 20:07:18 +00:00
|
|
|
|
|
|
|
{% block scripts %}
|
|
|
|
<script>
|
|
|
|
$('.click-spinner').on('click', function (e) {
|
|
|
|
$('.spinner-hidden').removeClass('hidden');
|
|
|
|
$(e.target).addClass('disabled');
|
|
|
|
})
|
|
|
|
</script>
|
|
|
|
{% endblock %}
|