{% extends 'virtualization/virtualmachine/base.html' %}
{% load render_table from django_tables2 %}
{% load helpers %}
{% load static %}

{% block content %}
  <form method="post">
    {% csrf_token %}
    {% include 'inc/table_controls.html' with table_modal="VirtualMachineVMInterfaceTable_config" %}
    {% render_table interface_table 'inc/table.html' %}
    <div class="noprint">
        {% if perms.virtualization.change_vminterface %}
            <button type="submit" name="_rename" formaction="{% url 'virtualization:vminterface_bulk_rename' %}?return_url={% url 'virtualization:virtualmachine_interfaces' pk=object.pk %}" class="btn btn-warning btn-sm">
                <span class="mdi mdi-pencil" aria-hidden="true"></span> Rename
            </button>
            <button type="submit" name="_edit" formaction="{% url 'virtualization:vminterface_bulk_edit' %}?virtualmachine={{ object.pk }}&return_url={% url 'virtualization:virtualmachine_interfaces' pk=object.pk %}" class="btn btn-warning btn-sm">
                <span class="mdi mdi-pencil" aria-hidden="true"></span> Edit
            </button>
        {% endif %}
        {% if perms.virtualization.delete_vminterface %}
            <button type="submit" name="_delete" formaction="{% url 'virtualization:vminterface_bulk_delete' %}?return_url={% url 'virtualization:virtualmachine_interfaces' pk=object.pk %}" class="btn btn-danger btn-sm">
                <span class="mdi mdi-trash-can-outline" aria-hidden="true"></span> Delete
            </button>
        {% endif %}
        {% if perms.virtualization.add_vminterface %}
            <div class="float-end">
                <a href="{% url 'virtualization:vminterface_add' %}?virtual_machine={{ object.pk }}&return_url={% url 'virtualization:virtualmachine_interfaces' pk=object.pk %}" class="btn btn-primary btn-sm">
                    <span class="mdi mdi-plus-thick" aria-hidden="true"></span> Add interfaces
                </a>
            </div>
        {% endif %}
        <div class="clearfix"></div>
     </div>
  </form>
  {% table_config_form interface_table %}
{% endblock %}
