{% extends 'basic.html' %}
{% block content %}
<h1>User: {{ uid }}</h1>

<div style="margin-bottom: 10px">
  <a class="btn btn-default" href="/admin/users" role="button">Back</a>

  <a class="btn btn-default" href="https://kasownik.hackerspace.pl/admin/member/{{ uid }}" role="button" target="_blank">View user in Kasownik</a>
</div>

<p>
  <strong>Belongs to groups:</strong>
  {% for group_name in groups %}
    <a href="/admin/groups/{{ group_name }}">{{ group_name }}</a>,
  {% endfor %}
</p>

<p>Full LDAP record:</p>

<table class="table profile-table">
  <tr>
    <th scope="col">Attribute</th>
    <th scope="col">Attribute</th>
    <th scope="col" class="profile-table-value">Value</th>
  </tr>
  {% for attr, attr_readable, value in profile %}
    <tr>
      <td>{{ attr }}</td>
      <td>{{ attr_readable if attr_readable else '' }}</td>
      <td class="profile-table-value">{{ value }}</td>
    </tr>
  {% endfor %}
</table>

{% endblock %}

{% block head %}
<style type="text/css">
.profile-table td, .profile-table th {
  overflow: hidden;
  overflow-wrap: anywhere;
  width: 200px;
}
.profile-table td.profile-table-value,
.profile-table th.profile-table-value {
  width: max-content;
}
</style>
{% endblock %}
