{% extends "authentic2/base-page.html" %}
{% load i18n %}

{% block page-title %}
{{ block.super }} - {{ view.title }}
{% endblock %}

{% block breadcrumb %}
{{ block.super }}
<a href="..">{% trans "Your account" %}</a>
<a href="">{{ view.title }}</a>
{% endblock %}

{% block content %}
{% block oidc-authorized-oauth-services-pre %}{% endblock %}
<div class="authorized-oauth-services">
  {% block oidc-authorized-oauth-services-top %}
  <p class="authorized-oauth-services--top">
    {% if authorized_oauth_services|length_is:0 %}
    {% trans "You have not given any authorization to access your account profile data." %}
    {% else %}
    {% trans "You have given authorizations to access your account profile data." %}
    {% endif %}
  </p>
  {% endblock %}
  <ul class="authorized-oauth-services--list">
    {% for auth in authorized_oauth_services %}
    <li class="authorized-oauth-services--item">
      <form method="post" class="authorized-oauth-services--form">
        {% csrf_token %}
        {% block oidc-authorized-oauth-service %}
        <div class="authorized-oauth-services--infos">
          {% block oidc-authorized-oauth-service-top %}{% endblock %}
          <span class="authorized-oauth-services--client">
            {{ auth.client }}
          </span>
          <span class="authorized-oauth-services--dates">
            <span class="authorized-oauth-services-dates--since">
              <span class="label">{% trans "Allowed since:" %}</span>
              <span class="time">{{ auth.created }}</span>
            </span>
            <span class="authorized-oauth-services--separator">/</span>
            <span class="authorized-oauth-services--expired">
              <span class="label">{% trans "Expire on:" %}</span>
              <span class="time">{{ auth.expired }}</span>
            </span>
          </span>
        </div>
        <div class="authorized-oauth-services--actions">
          <input type="hidden" id="auth-id" name="auth_id" value="{{ auth.id }}">
          <button class="authorized-oauth-services--revoke-button">{% trans 'Revoke' %}</button>
        </div>
        {% block oidc-authorized-oauth-service-bottom %}{% endblock %}
        {% endblock %}
      </form>
    </li>
    {% endfor %}
  </ul>
  {% block oidc-authorized-oauth-services-bottom %}{% endblock %}
</div>
{% block oidc-authorized-oauth-services-post %}{% endblock %}
{% endblock %}
