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

{% block extra_controls %}
  {% include 'ipam/inc/toggle_available.html' %}
  {% include 'ipam/inc/max_depth.html' %}
  {% include 'ipam/inc/max_length.html' %}  
  {% if perms.ipam.add_prefix and first_available_prefix %}
    <a href="{% url 'ipam:prefix_add' %}?prefix={{ first_available_prefix }}{% if object.vrf %}&vrf={{ object.vrf.pk }}{% endif %}{% if object.scope %}&scope_content_type={{ object.scope_type.pk }}&scope_object_id={{ object.scope.pk }}{% endif %}{% if object.tenant %}&tenant_group={{ object.tenant.group.pk }}&tenant={{ object.tenant.pk }}{% endif %}" class="btn btn-primary">
      <i class="mdi mdi-plus-thick" aria-hidden="true"></i> {% trans "Add Prefix" %}
    </a>
  {% endif %}
{% endblock extra_controls %}
