{% extends "idhub/base.html" %}
{% load i18n %}

{% block content %}
<div class="row">
  <div class="col">
    <h3>
      <i class="{{ icon }}"></i>
      {{ subtitle }}
    </h3>
  </div>
  <div class="col text-center">
    <a href="javascript:void()" type="button" class="btn btn-green-user me-3">{% trans 'ARCO Forms' %}</a>
    <a href="javascript:void()" type="button" class="btn btn-green-user">{% trans 'Notice of Privacy' %}</a>
  </div>
</div>
{% load django_bootstrap5 %}
<form role="form" method="post">
{% csrf_token %}
{% if form.errors %}
<div class="alert alert-danger alert-icon alert-icon-border alert-dismissible" role="alert">
  <div class="icon"><span class="mdi mdi-close-circle-o"></span></div>
  <div class="message">
    <button class="close" type="button" data-dismiss="alert" aria-label="Close">
    <span class="mdi mdi-close" aria-hidden="true"></span>
    </button>
    {% for field, error in form.errors.items %}
      {{ error }}
    {% endfor %}
  </div>
</div>
{% endif %}
{% bootstrap_form form %}
</form>
<hr />

<div class="row">
  <div class="col">
    <div class="table-responsive">
      <table class="table table-striped table-sm text-center">
        <thead>
          <tr>
            <th scope="col"><button type="button" class="btn btn-grey border border-dark">{% trans 'Membership' %}</button></th>
            <th scope="col"><button type="button" class="btn btn-grey border border-dark">{% trans 'From' %}</button></th>
            <th scope="col"><button type="button" class="btn btn-grey border border-dark">{% trans 'To' %}</button></th>
            <th scope="col"><button type="button" class="btn btn-grey border border-dark">{% trans 'Credentials' %}</button></th>
          </tr>
        </thead>
        <tbody>
          {% for membership in object.memberships.all %}
          <tr>
            <td>{{ membership.get_type }}</td>
            <td>{{ membership.start_date|default:'' }}</td>
            <td>{{ membership.end_date|default:'' }}</td>
            <td>
              <a href="javascript:void()" class="text-primary" title="{% trans 'View' %}"><i class="bi bi-eye"></i></a>
            </td>
          </tr>
          {% endfor %}
        </tbody>
      </table>
    </div>
  </div>
</div>
{% endblock %}
