{% load i18n %}
<div class="btn-group">
  <button type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
    <i class="mdi mdi-plus-thick" aria-hidden="true"></i> {{ label }}
  </button>
  <ul class="dropdown-menu">
    {% if perms.dcim.add_consoleport %}
      <li>
        <button type="submit" {% formaction %}="{% url 'dcim:device_bulk_add_consoleport' %}{% if url_params %}?{{ url_params.urlencode }}{% endif %}" class="dropdown-item">
         {% trans "Console Ports" %}
        </button>
      </li>
    {% endif %}
    {% if perms.dcim.add_consoleserverport %}
      <li>
        <button type="submit" {% formaction %}="{% url 'dcim:device_bulk_add_consoleserverport' %}{% if url_params %}?{{ url_params.urlencode }}{% endif %}" class="dropdown-item ">
          {% trans "Console Server Ports" %}
        </button>
      </li>
    {% endif %}
    {% if perms.dcim.add_powerport %}
      <li>
        <button type="submit" {% formaction %}="{% url 'dcim:device_bulk_add_powerport' %}{% if url_params %}?{{ url_params.urlencode }}{% endif %}" class="dropdown-item">
          {% trans "Power Ports" %}
        </button>
      </li>
    {% endif %}
    {% if perms.dcim.add_poweroutlet %}
      <li>
        <button type="submit" {% formaction %}="{% url 'dcim:device_bulk_add_poweroutlet' %}{% if url_params %}?{{ url_params.urlencode }}{% endif %}" class="dropdown-item">
          {% trans "Power Outlets" %}
        </button>
      </li>
    {% endif %}
    {% if perms.dcim.add_interface %}
      <li>
          <button type="submit" {% formaction %}="{% url 'dcim:device_bulk_add_interface' %}{% if url_params %}?{{ url_params.urlencode }}{% endif %}" class="dropdown-item">
            {% trans "Interfaces" %}
          </button>
      </li>
    {% endif %}
    {% if perms.dcim.add_rearport %}
      <li>
        <button type="submit" {% formaction %}="{% url 'dcim:device_bulk_add_rearport' %}{% if url_params %}?{{ url_params.urlencode }}{% endif %}" class="dropdown-item">
          {% trans "Rear Ports" %}
        </button>
      </li>
    {% endif %}
    {% if perms.dcim.add_devicebay %}
      <li>
        <button type="submit" {% formaction %}="{% url 'dcim:device_bulk_add_devicebay' %}{% if url_params %}?{{ url_params.urlencode }}{% endif %}" class="dropdown-item">
          {% trans "Device Bays" %}
        </button>
      </li>
    {% endif %}
    {% if perms.dcim.add_modulebay %}
      <li>
        <button type="submit" {% formaction %}="{% url 'dcim:device_bulk_add_modulebay' %}{% if url_params %}?{{ url_params.urlencode }}{% endif %}" class="dropdown-item">
          {% trans "Module Bays" %}
        </button>
      </li>
    {% endif %}
    {% if perms.dcim.add_inventoryitem %}
      <li>
        <button type="submit" {% formaction %}="{% url 'dcim:device_bulk_add_inventoryitem' %}{% if url_params %}?{{ url_params.urlencode }}{% endif %}" class="dropdown-item">
          {% trans "Inventory Items" %}
        </button>
      </li>
    {% endif %}
  </ul>
</div>
