{% extends "authentic2/manager/api_client_common.html" %}
{% load i18n gadjo %}

{% block breadcrumb %}
  {{ block.super }}
  <a href="#"></a>
{% endblock %}

{% block appbar %}
  {{ block.super }}
  <span class="actions">
    <a href="{% url 'a2-manager-api-client-delete' pk=api_client.pk %}" rel="popup">{% trans "Delete" %}</a>
    <a href="{% url 'a2-manager-api-client-edit' pk=api_client.pk %}">{% trans "Edit" %}</a>
  </span>
{% endblock %}

{% block main %}
  {% if api_client.description %}
    <div class="bo-block">{{api_client.description}}</div>
  {% endif %}
  <div class="bo-block">
    <h3>{% trans "Parameters" %}</h3>
    <ul>
      <li>{% blocktrans with identifier=api_client.identifier %}Identifier: {{ identifier }}{% endblocktrans %}</li>
      <li>{% blocktrans with password=api_client.password %}Password: {{ password }}{% endblocktrans %}</li>
      <li>{% blocktrans with ou=api_client.ou.name %}Organizational unit: {{ ou }}{% endblocktrans %}</li>
      {% if api_client.apiclient_roles.count %}
        <li>{% trans "Roles:" %}
          <ul>
            {% for role in  api_client.apiclient_roles.all %}<li><a href="{% url 'a2-manager-role-members' pk=role.pk %}">{{ role.name }}</a></li>{% endfor %}
          </ul>
        </li>
      {% else %}
        <li>{% trans "No role assigned to this client yet." %}</li>
      {% endif %}
      {% if api_client.restrict_to_anonymised_data %}
        <li>{% trans "Restricted to anonymised data" %}</li>
      {% else %}
        <li>{% trans "No restriction to anonymised-only data." %}</li>
      {% endif %}
      {% if api_client.allowed_user_attributes.count %}
        <li>{% trans "Allowed user attributes:" %}
          <ul>
            {% for attr in  api_client.allowed_user_attributes.all %}<li>{{ attr.name }}</li>{% endfor %}
          </ul>
        </li>
      {% else %}
        <li>{% trans "Unrestricted access to user profile attributes." %}
      {% endif %}
    </ul>
  </div>
{% endblock %}
