2019-07-05 13:21:48 +00:00
|
|
|
{% extends "login/base.html" %}
|
|
|
|
|
2020-05-15 08:54:31 +00:00
|
|
|
{% load passbook_utils %}
|
2019-07-05 13:21:48 +00:00
|
|
|
{% load i18n %}
|
|
|
|
|
2020-02-24 12:13:28 +00:00
|
|
|
{% block card_title %}
|
|
|
|
{% trans 'Authorize Application' %}
|
2019-07-05 13:21:48 +00:00
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block card %}
|
2020-02-24 12:13:28 +00:00
|
|
|
<form method="POST" class="pf-c-form">
|
2019-07-05 13:21:48 +00:00
|
|
|
{% csrf_token %}
|
|
|
|
{% if not error %}
|
|
|
|
{% csrf_token %}
|
|
|
|
{% for field in form %}
|
|
|
|
{% if field.is_hidden %}
|
|
|
|
{{ field }}
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
2020-02-24 12:13:28 +00:00
|
|
|
<div class="pf-c-form__group">
|
2019-07-05 13:21:48 +00:00
|
|
|
<p class="subtitle">
|
|
|
|
{% blocktrans with remote=client.name %}
|
2020-02-24 12:13:28 +00:00
|
|
|
You're about to sign into {{ remote }}.
|
2019-07-05 13:21:48 +00:00
|
|
|
{% endblocktrans %}
|
|
|
|
</p>
|
|
|
|
<p>{% trans "Application requires following permissions" %}</p>
|
2020-02-24 12:13:28 +00:00
|
|
|
<ul class="pf-c-list">
|
2019-07-05 13:21:48 +00:00
|
|
|
{% for scope in scopes %}
|
|
|
|
<li>{{ scope.name }}</li>
|
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
|
|
|
{{ hidden_inputs }}
|
|
|
|
{{ form.errors }}
|
|
|
|
{{ form.non_field_errors }}
|
2020-02-24 12:13:28 +00:00
|
|
|
</div>
|
|
|
|
<div class="pf-c-form__group">
|
2019-07-05 13:21:48 +00:00
|
|
|
<p>
|
|
|
|
{% blocktrans with user=user %}
|
|
|
|
You are logged in as {{ user }}. Not you?
|
|
|
|
{% endblocktrans %}
|
2020-06-29 22:11:01 +00:00
|
|
|
<a href="{% url 'passbook_flows:cancel' %}">{% trans 'Logout' %}</a>
|
2019-07-05 13:21:48 +00:00
|
|
|
</p>
|
2020-02-24 12:13:28 +00:00
|
|
|
</div>
|
|
|
|
<div class="pf-c-form__group pf-m-action">
|
|
|
|
<input type="submit" class="pf-c-button pf-m-primary" name="allow" value="{% trans 'Continue' %}">
|
|
|
|
<a href="{% back %}" class="pf-c-button pf-m-secondary">{% trans "Cancel" %}</a>
|
|
|
|
</div>
|
|
|
|
<div class="pf-c-form__group" style="display: none;" id="loading">
|
|
|
|
<div class="pf-c-form__horizontal-group">
|
|
|
|
<span class="pf-c-spinner" role="progressbar" aria-valuetext="Loading...">
|
|
|
|
<span class="pf-c-spinner__clipper"></span>
|
|
|
|
<span class="pf-c-spinner__lead-ball"></span>
|
|
|
|
<span class="pf-c-spinner__tail-ball"></span>
|
|
|
|
</span>
|
2019-07-05 13:21:48 +00:00
|
|
|
</div>
|
|
|
|
</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 %}
|
|
|
|
|
|
|
|
{% block scripts %}
|
|
|
|
<script>
|
2020-02-24 12:13:28 +00:00
|
|
|
document.querySelector("form").addEventListener("submit", (e) => {
|
|
|
|
document.getElementById("loading").removeAttribute("style");
|
|
|
|
});
|
2019-07-05 13:21:48 +00:00
|
|
|
</script>
|
|
|
|
{% endblock %}
|