{% extends "base.html" %}
{% load apis_entities %}
{% load core %}
{% load i18n %}

{% block main-menu %}
  {{ block.super }}
  <li class="nav-item dropdown">
    <a href="#"
       class="nav-link dropdown-toggle"
       data-bs-toggle="dropdown"
       role="button"
       aria-haspopup="true"
       aria-expanded="false">
      {% translate "Entities" %}
      <span class="caret" />
    </a>
    <div class="dropdown-menu" aria-labelledby="navbarDropdown">
      {% entities_content_types as content_types %}
      {% for content_type in content_types|dictsort:"name" %}
        {% with content_type.model_class|opts as meta %}
          <a class="dropdown-item"
             href="{{ content_type.model_class.get_listview_url }}">{{ meta.verbose_name_plural|capfirst }}</a>
        {% endwith %}
      {% endfor %}
    </div>
  </li>
{% endblock main-menu %}
