{% extends "core/base.html" %}

{% load i18n %}

{% block browser_title %}{% blocktrans %}OAuth2 Application{% endblocktrans %}{% endblock %}
{% block page_title %}
  <a href="{% url "oauth2_applications" %}"
     class="btn-flat primary-color-text waves-light waves-effect">
    <i class="material-icons iconify left" data-icon="mdi:chevron-left"></i> {% trans "Back" %}
  </a>
  {{ application.name }}
{% endblock %}

{% block content %}
  <a class="btn orange waves-effect waves-light btn-margin" href="{% url "edit_oauth2_application" application.id %}">
    <i class="material-icons iconify left" data-icon="mdi:pencil-outline"></i>
    {% trans "Edit" %}
  </a>
  <a class="btn red waves-effect waves-light btn-margin" href="{% url "delete_oauth2_application" application.id %}">
    <i class="material-icons iconify left" data-icon="mdi:delete-outline"></i>
    {% trans "Delete" %}
  </a>
  <table class="responsive-table">
    <tbody>
    <tr>
      <th>{% trans "Icon" %}</th>
      <td>
        {% if application.icon %}
          <div class="application-circle materialboxed z-depth-2">
            <img src="{{ application.icon.url }}" alt="{{ oauth_application.name }}" class="hundred-percent">
          </div>
        {% else %}
          –
        {% endif %}
      </td>
    </tr>
    <tr>
      <th>
        {% trans "Client id" %}
      </th>
      <td>
        <code class="break-word">{{ application.client_id }}</code>
      </td>
    </tr>
    <tr>
      <th>
        {% trans "Client secret" %}
      </th>
      <td>
        <code class="break-word">{{ application.client_secret }}</code>
      </td>
    </tr>
    <tr>
      <th>
        {% trans "Client type" %}
      </th>
      <td>
        {{ application.client_type }}
      </td>
    </tr>
    <tr>
      <th>
        {% trans "Allowed scopes" %}
      </th>
      <td>
        {{ application.allowed_scopes|join:", " }}
      </td>
    </tr>
    <tr>
      <th>
        {% trans "Redirect URIs" %}
      </th>
      <td>
        {{ application.redirect_uris }}
      </td>
    </tr>
    <tr>
      <th>
        {% trans "Skip Authorisation" %}
      </th>
      <td>
        <i class="material-icons iconify" data-icon="mdi:{{ application.skip_authorization|yesno:"check,close" }}"></i>
      </td>
    </tr>
    </tbody>
  </table>
{% endblock %}
