_disk-list-element.html 1.86 KB
Newer Older
1 2 3
{% load i18n %}
{% load sizefieldtags %}

4
<i class="fa fa-file"></i>
5
{{ d.name }} (#{{ d.id }}) - {{ d.size|filesize }}
6

7 8

<span class="operation-wrapper pull-right">
9 10 11 12 13 14 15 16 17 18 19 20 21
  {% 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>
    {% endif %}
  {% else %}
    <small class="btn-xs">
      {% trans "Not exportable" %}
    </small>
  {% endif %}
22 23
  {% if d.is_resizable %}
    {% if op.resize_disk %}
24 25
      <a href="{{ op.resize_disk.get_url }}?disk={{ d.pk }}"
         class="btn btn-xs btn-{{ op.resize_disk.effect }} operation disk-resize-btn
26 27 28 29
        {% if op.resize_disk.disabled %}disabled{% endif %}">
        <i class="fa fa-{{ op.resize_disk.icon }} fa-fw-12"></i> {% trans "Resize" %}
      </a>
    {% else %}
30 31
      <a href="{% url "request.views.request-resize" vm_pk=instance.pk disk_pk=d.pk %}"
         class="btn btn-xs btn-primary operation">
32 33 34
        <i class="fa fa-arrows-alt fa-fw-12"></i> {% trans "Request resize" %}
      </a>
    {% endif %}
35 36 37 38
  {% else %}
    <small class="btn-xs">
      {% trans "Not resizable" %}
    </small>
39 40
  {% endif %}
  {% if op.remove_disk %}
41 42
    <a href="{{ op.remove_disk.get_url }}?disk={{ d.pk }}"
       class="btn btn-xs btn-{{ op.remove_disk.effect }} operation disk-remove-btn
43 44 45 46 47
      {% if op.remove_disk.disabled %}disabled{% endif %}">
      <i class="fa fa-{{ op.remove_disk.icon }} fa-fw-12"></i> {% trans "Remove" %}
    </a>
  {% endif %}
</span>
48
<div style="clear: both;"></div>
49 50

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