authorize.html 1.92 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
{% extends "main_django.html" %}

{% load scope i18n %}

{% block bodyclass %}oauth2{% endblock %}

{% block body %}
<div class="authorization-confirmation">
  {% if not error %}
  <p>
  {% blocktrans with application_name=client.name %}
    <strong>{{ application_name }}</strong> would like to access your data with the following permissions:
  {% endblocktrans %}
  </p>
  <ul>
    {% for permission in oauth_data.scope|scopes %}
    <li>
      {% if permission == "openid" %}
        {% trans "Read your user ID" %}
      {% elif permission == "profile" %}
        {% trans "Read your user profile" %}
      {% elif permission == "email" %}
        {% trans "Read your email address" %}
      {% elif permission == "course_staff" %}
        {% trans "Read the list of courses in which you are a staff member." %}
      {% elif permission == "course_instructor" %}
        {% trans "Read the list of courses in which you are an instructor." %}
      {% elif permission == "permissions" %}
        {% trans "To see if you are a global staff user" %}
      {% else %}
        {% blocktrans %}Manage your data: {{ permission }}{% endblocktrans %}
      {% endif %}
    </li>
    {% endfor %}
  </ul>
  <form method="post" action="{% url "oauth2:authorize" %}">
    {% csrf_token %}
    {{ form.errors }}
    {{ form.non_field_errors }}
    <fieldset>
      <div style="display: none;">
        <select type="select" name="scope" multiple="multiple">
          {% for scope in oauth_data.scope|scopes %}
          <option value="{{ scope }}" selected="selected">{{ scope }}</option>
          {% endfor %}
        </select>
      </div>
      <input type="submit" class="btn login large danger" name="cancel" value="Cancel" />
      <input type="submit" class="btn login large primary" name="authorize" value="Authorize" />
    </fieldset>
  </form>
  {% else %}
  <p class="error">
    {{ error }}
    {{ error_description }}
  </p>
  {% endif %}
</div>
{% endblock %}