summaryrefslogtreecommitdiff
path: root/django-openstack/django_openstack/templates/django_openstack/dash/volumes/_list.html
blob: 18910ff7609c0ec50739171f34e33c67e196ae97 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
{% load i18n %}
{% load parse_date %}
<table id="volumes" class="wide">
  <tr>
    <th>{% trans "ID" %}</th>
    <th>{% trans "Name" %}</th>
    <th>{% trans "Status" %}</th>
    <th>{% trans "Size" %}</th>
    <th>{% trans "Created" %}</th>
    <th>{% trans "Attached To" %}</th>
    <th>{% trans "Actions" %}</th>
  </tr>
  {% for volume in volumes %}
  <tr class="{% cycle 'odd' 'even' %}">
    <td>{{ volume.id }}</td>
    <td>
      <a href="{% url dash_volumes_detail request.user.tenant_name volume.id %}">
        {{ volume.displayName }}
      </a>
    </td>
    <td>{{ volume.status|capfirst }}</td>
    <td>{{ volume.size }} {% trans "GB" %}</td>
    <td>{{ volume.createdAt|parse_date }}</td>
    <td>
      {% for attachment in volume.attachments %}
        {% if attachment %}
          <a href="{% url dash_instances_detail request.user.tenant_name attachment.serverId %}">
          <!-- TODO (tres): Show instance name -->
          Instance {{ attachment.serverId }}
          <small>({{ attachment.device }})</small>
        </a>
        {% else %}
          {% trans "Not Attached" %}
        {% endif %}
      {% endfor %}
    </td>
    <td id="actions">
      <ul>
        {% if volume.status == "in-use" %}
          {% for attachment in volume.attachments %}
            <li class="form">
              {% include "django_openstack/dash/volumes/_detach_form.html" with form=detach_form %}
            </li>
          {% endfor %}
        {% endif %}
        {% if volume.status == "available" %}
        <li>
          <a href="{% url dash_volumes_attach request.user.tenant_id volume.id %}">{% trans "Attach" %}</a>
        </li>
        <li class="form">
          {% include "django_openstack/dash/volumes/_delete.html" with form=delete_form %}
        </li>
        {% endif %}
      </ul>
    </td>
  </tr>
  {% endfor %}
</table>