{% extends 'generic/object.html' %}
{% load i18n %}

{% block extra_controls %}
  {% if perms.dcim.add_devicetype or perms.dcim.add_moduletype %}
    <div class="dropdown">
      <button id="add-components" type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
        <i class="mdi mdi-plus-thick" aria-hidden="true"></i> {% trans "Add" %}
      </button>
      <ul class="dropdown-menu" aria-labelledby="add-components">
        {% if perms.dcim.add_devicetype %}
          <li><a class="dropdown-item" href="{% url 'dcim:devicetype_add' %}?manufacturer={{ object.pk }}">
            {% trans "Add Device Type" %}
          </a></li>
        {% endif %}
        {% if perms.dcim.add_moduletype %}
          <li><a class="dropdown-item" href="{% url 'dcim:moduletype_add' %}?manufacturer={{ object.pk }}">
            {% trans "Add Module Type" %}
          </a></li>
        {% endif %}
      </ul>
    </div>
  {% endif %}
{% endblock extra_controls %}
