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

{% block title %}{{ object.manufacturer }} {{ object.model }}{% endblock %}

{% block breadcrumbs %}
  {{ block.super }}
  <li class="breadcrumb-item"><a href="{% url 'dcim:devicetype_list' %}?manufacturer_id={{ object.manufacturer.pk }}">{{ object.manufacturer }}</a></li>
{% endblock %}

{% block extra_controls %}
  {% if perms.dcim.change_devicetype %}
    <div class="dropdown">
      <button 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 Components" %}
      </button>
      <ul class="dropdown-menu">
        {% if perms.dcim.add_consoleporttemplate %}
          <li><a class="dropdown-item" href="{% url 'dcim:consoleporttemplate_add' %}?device_type={{ object.pk }}&return_url={% url 'dcim:devicetype_consoleports' pk=object.pk %}">{% trans "Console Ports" %}</a></li>
        {% endif %}
        {% if perms.dcim.add_consoleserverporttemplate %}
          <li><a class="dropdown-item" href="{% url 'dcim:consoleserverporttemplate_add' %}?device_type={{ object.pk }}&return_url={% url 'dcim:devicetype_consoleserverports' pk=object.pk %}">{% trans "Console Server Ports" %}</a></li>
        {% endif %}
        {% if perms.dcim.add_powerporttemplate %}
          <li><a class="dropdown-item" href="{% url 'dcim:powerporttemplate_add' %}?device_type={{ object.pk }}&return_url={% url 'dcim:devicetype_powerports' pk=object.pk %}">{% trans "Power Ports" %}</a></li>
        {% endif %}
        {% if perms.dcim.add_poweroutlettemplate %}
          <li><a class="dropdown-item" href="{% url 'dcim:poweroutlettemplate_add' %}?device_type={{ object.pk }}&return_url={% url 'dcim:devicetype_poweroutlets' pk=object.pk %}">{% trans "Power Outlets" %}</a></li>
        {% endif %}
        {% if perms.dcim.add_interfacetemplate %}
          <li><a class="dropdown-item" href="{% url 'dcim:interfacetemplate_add' %}?device_type={{ object.pk }}&return_url={% url 'dcim:devicetype_interfaces' pk=object.pk %}">{% trans "Interfaces" %}</a></li>
        {% endif %}
        {% if perms.dcim.add_frontporttemplate %}
          <li><a class="dropdown-item" href="{% url 'dcim:frontporttemplate_add' %}?device_type={{ object.pk }}&return_url={% url 'dcim:devicetype_frontports' pk=object.pk %}">{% trans "Front Ports" %}</a></li>
        {% endif %}
        {% if perms.dcim.add_rearporttemplate %}
          <li><a class="dropdown-item" href="{% url 'dcim:rearporttemplate_add' %}?device_type={{ object.pk }}&return_url={% url 'dcim:devicetype_rearports' pk=object.pk %}">{% trans "Rear Ports" %}</a></li>
        {% endif %}
        {% if perms.dcim.add_modulebaytemplate %}
          <li><a class="dropdown-item" href="{% url 'dcim:modulebaytemplate_add' %}?device_type={{ object.pk }}&return_url={% url 'dcim:devicetype_modulebays' pk=object.pk %}">{% trans "Module Bays" %}</a></li>
        {% endif %}
        {% if perms.dcim.add_devicebaytemplate %}
          <li><a class="dropdown-item" href="{% url 'dcim:devicebaytemplate_add' %}?device_type={{ object.pk }}&return_url={% url 'dcim:devicetype_devicebays' pk=object.pk %}">{% trans "Device Bays" %}</a></li>
        {% endif %}
        {% if perms.dcim.add_inventoryitemtemplate %}
          <li><a class="dropdown-item" href="{% url 'dcim:inventoryitemtemplate_add' %}?device_type={{ object.pk }}&return_url={% url 'dcim:devicetype_inventoryitems' pk=object.pk %}">{% trans "Inventory Items" %}</a></li>
        {% endif %}
      </ul>
    </div>
  {% endif %}
{% endblock %}
