{% load helpers %}
<div class="card">
  <h5 class="card-header">Unacceptable events</h5>
  <div class="card-body">
    <table class="table table-hover">
      <tr>
        <th>Name</th>
        <th>Relation</th>
        <th></th>
      </tr>
      {% for PTUEvent in PTUEvents %}
      <tr>
        <td>{{ PTUEvent.name | linkify}}</td>
        <td>{{ PTUEvent.rel | placeholder}}</td>
        <td class="text-end noprint">
          <a
            href="{% url 'plugins:ptuevents:ptueventassignment_edit' pk=PTUEvent.assignment_id %}?return_url={{ object.get_absolute_url }}"
            class="btn btn-warning btn-sm lh-1"
            title="Edit"
          >
            <i class="mdi mdi-pencil" aria-hidden="true"></i>
          </a>
          <a
            href="{% url 'plugins:ptuevents:ptueventassignment_delete' pk=PTUEvent.assignment_id %}?return_url={{ object.get_absolute_url }}"
            class="btn btn-danger btn-sm lh-1"
            title="Delete"
          >
            <i class="mdi mdi-trash-can-outline" aria-hidden="true"></i>
          </a>
        </td>
      </tr>
      {% endfor %}
    </table>
  </div>
  <div class="card-footer text-end noprint">
    <a
      href="{% url 'plugins:ptuevents:ptueventassignment_add' %}?content_type={{ object|content_type_id }}&object_id={{ object.pk }}&return_url={{ object.get_absolute_url }}"
      class="btn btn-primary btn-sm"
    >
      <i class="mdi mdi-plus-thick" aria-hidden="true"></i> Add a Event
    </a>
  </div>
</div>
