| 1 | {% extends "base.html" %} |
| 2 | {% comment %} |
| 3 | # SPDX-License-Identifier: AGPL-3.0-or-later |
| 4 | {% endcomment %} |
| 5 | |
| 6 | {% load i18n %} |
| 7 | {% load static %} |
| 8 | {% load bootstrap %} |
| 9 | |
| 10 | {% block wrapper %} |
| 11 | <div class="container narrow-container authorize-container"> |
| 12 | <div class="d-flex flex-row align-items-center authorize-diagram"> |
| 13 | <img src="{% static 'theme/img/application.svg' %}" |
| 14 | class="col-image network-entity" alt="{% trans "Application" %}"> |
| 15 | <img src="{% static 'theme/img/network-connection.svg' %}" |
| 16 | class="col-image network-connection" |
| 17 | alt="{% trans "Connection" %}"> |
| 18 | <img src="{% static 'theme/img/network-freedombox.svg' %}" |
| 19 | class="col-image network-entity" alt="{{ box_name }}"> |
| 20 | </div> |
| 21 | |
| 22 | <h3>{% trans "Authorize App" %}</h3> |
| 23 | |
| 24 | {% if not error %} |
| 25 | <form id="authorizationForm" class="form form-authorize" method="post"> |
| 26 | {% csrf_token %} |
| 27 | |
| 28 | {% for field in form %} |
| 29 | {% if field.is_hidden %} |
| 30 | {{ field }} |
| 31 | {% endif %} |
| 32 | {% endfor %} |
| 33 | |
| 34 | <ul class="list-group"> |
| 35 | <li class="list-group-item"> |
| 36 | {% trans application.name as app %} |
| 37 | {% blocktrans trimmed with username=request.user.username %} |
| 38 | <strong>{{ app }}</strong> wants to access your account <strong> |
| 39 | {{ username }}</strong> |
| 40 | {% endblocktrans %} |
| 41 | </li> |
| 42 | {% for scope in scopes_descriptions %} |
| 43 | <li class="list-group-item">{% trans scope %}</li> |
| 44 | {% endfor %} |
| 45 | </ul> |
| 46 | |
| 47 | {{ form.errors }} |
| 48 | {{ form.non_field_errors }} |
| 49 | |
| 50 | <div class="submit-container"> |
| 51 | <input type="submit" class="btn btn-large btn-primary" name="allow" |
| 52 | value="{% blocktrans trimmed with app=application.name %} |
| 53 | Authorize {{ app }} |
| 54 | {% endblocktrans %}"/> |
| 55 | </div> |
| 56 | </form> |
| 57 | |
| 58 | <p class="text-secondary"> |
| 59 | {% blocktrans trimmed with url=form.redirect_uri.value %} |
| 60 | Authorizing will redirect to {{ url }} |
| 61 | {% endblocktrans %} |
| 62 | </p> |
| 63 | {% else %} |
| 64 | <h3>{% trans "Error:" %} {{ error.error }}</h3> |
| 65 | <p>{{ error.description }}</p> |
| 66 | {% endif %} |
| 67 | |
| 68 | </div> |
| 69 | {% endblock %} |