{% load i18n %}
{% load sizefieldtags %}

<i class="fa fa-file"></i>
{% if d.ci_disk %} <i class="fa fa-cloud-upload"></i>
{% endif %}

{{ d.name }} (<i class="fa fa-database"></i> {{ d.datastore.name }}   #{{ d.id }}) - {{ d.size|filesize }}

<span class="operation-wrapper pull-right">
  {% if d.is_exportable %}
    {% if op.export_disk %}
      <a href="{{ op.export_disk.get_url }}?disk={{ d.pk }}"
         class="btn btn-xs btn-{{ op.export_disk.effect }} operation disk-export-btn
      {% if op.export_disk.disabled %}disabled{% endif %}">
      <i class="fa fa-{{ op.export_disk.icon }} fa-fw-12"></i> {% trans "Export" %}
    </a>
      <a href="/image-dl/{{ d.filename }}.vmdk"
         class="btn btn-xs btn-{{ op.export_disk.effect }} operation disk-export-btn">
      <i class="fa fa-{{ op.export_disk.icon }} fa-fw-12"></i> {% trans "VMDK" %}
    </a>
      <a href="/image-dl/{{ d.filename }}.vdi"
         class="btn btn-xs btn-{{ op.export_disk.effect }} operation disk-export-btn">
      <i class="fa fa-{{ op.export_disk.icon }} fa-fw-12"></i> {% trans "VDI" %}
    </a>
  <a href="/image-dl/{{ d.filename }}.vdi"
         class="btn btn-xs btn-{{ op.export_disk.effect }} operation disk-export-btn">
      <i class="fa fa-{{ op.export_disk.icon }} fa-fw-12"></i> {% trans "VPC" %}
    </a>
    {% endif %}
  {% else %}
    <small class="btn-xs">
      {% trans "Not exportable" %}
    </small>
  {% endif %}
  {% if d.is_resizable %}
    {% if op.resize_disk %}
      <a href="{{ op.resize_disk.get_url }}?disk={{ d.pk }}"
         class="btn btn-xs btn-{{ op.resize_disk.effect }} operation disk-resize-btn
        {% if op.resize_disk.disabled %}disabled{% endif %}">
        <i class="fa fa-{{ op.resize_disk.icon }} fa-fw-12"></i> {% trans "Resize" %}
      </a>
    {% else %}
      <a href="{% url "request.views.request-resize" vm_pk=instance.pk disk_pk=d.pk %}"
         class="btn btn-xs btn-primary operation">
        <i class="fa fa-arrows-alt fa-fw-12"></i> {% trans "Request resize" %}
      </a>
    {% endif %}
  {% else %}
    <small class="btn-xs">
      {% trans "Not resizable" %}
    </small>
  {% endif %}
  {% if op.remove_disk %}
    <a href="{{ op.remove_disk.get_url }}?disk={{ d.pk }}"
       class="btn btn-xs btn-{{ op.remove_disk.effect }} operation disk-remove-btn
      {% if op.remove_disk.disabled %}disabled{% endif %}">
      <i class="fa fa-{{ op.remove_disk.icon }} fa-fw-12"></i> {% trans "Remove" %}
    </a>
  {% endif %}
</span>
<div style="clear: both;"></div>

{% if request.user.is_superuser %}
  <small>{% trans "File name" %}: {{ d.filename }}</small><br/>
  <small>{% trans "Bus" %}: {{ d.device_bus }}</small>
{% endif %}
