{% load helpers %}

<div class="card">
  <h2 class="card-header d-flex justify-content-between align-items-center">
    Assigned Licenses
    <div class="card-actions">
      <a href="{% url 'plugins:netbox_license:licenseassignment_add' %}?virtual_machine={{ object.id }}" class="btn btn-ghost-primary btn-sm">
        <span class="mdi mdi-plus-thick" aria-hidden="true"></span> Add Assignment
      </a>
    </div>
  </h2>
  <table class="table table-hover table-headings mb-0">
    <tbody>
      <tr>
        <td>
          <a href="{% url 'plugins:netbox_license:licenseassignment_list' %}?virtual_machine_id={{ object.id }}">
            Licenses
          </a>
        </td>
        <td class="text-end">
          <span class="badge text-bg-primary rounded-pill">{{ licenses|length }}</span>
        </td>
      </tr>
    </tbody>
  </table>
</div>
