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

{% block breadcrumbs %}
  {{ block.super }}
  <li class="breadcrumb-item"><a href="{% url 'virtualization:cluster_list' %}?type_id={{ object.type.pk }}">{{ object.type }}</a></li>
  {% if object.group %}
    <li class="breadcrumb-item"><a href="{% url 'virtualization:cluster_list' %}?group_id={{ object.group.pk }}">{{ object.group }}</a></li>
  {% endif %}
{% endblock %}

{% block extra_controls %}
  {% if perms.virtualization.change_cluster and perms.virtualization.add_virtualmachine %}
    <a href="{% url 'virtualization:virtualmachine_add' %}?cluster={{ object.pk }}&return_url={{ object.get_absolute_url }}" class="btn btn-primary">
      <span class="mdi mdi-plus-thick" aria-hidden="true"></span> {% trans "Add Virtual Machine" %}
    </a>
  {% endif %}

  {% if perms.virtualization.change_cluster %}
    <a href="{% url 'virtualization:cluster_add_devices' pk=object.pk %}?site={{ object.site.pk }}&return_url={{ object.get_absolute_url }}" class="btn btn-primary">
      <span class="mdi mdi-plus-thick" aria-hidden="true"></span> {% trans "Assign Device" %}
    </a>
  {% endif %}
{% endblock %}
