summary.html 3.17 KB
Newer Older
1
{% extends "box/base/summary.html" %}
2
{% load staticfiles %}
3 4 5 6 7 8 9 10 11 12 13
{% load i18n %}
{% get_current_language as LANGUAGE_CODE %}

{% block content %}
<div class="summary {% if id == vm.id %}selected-summary{% endif %} {% if vm.template.state == "NEW" %}unfinished{% endif %}">
    {{ block.super }}
</div>
{% endblock content %}

{% block name %}
<div class="name {% if vm.state == 'ACTIVE' %}vm-on{% else %}vm-off{% endif %}">
14
    <span id="vm-{{vm.id}}-name">{{vm.name}}</span>
15
    <small id="vm-{{vm.id}}-name-details" class="details">
16
        (<a href="{{ vm.get_absolute_url }}" title="{{vm.name}}">{% trans "More details" %}</a>)
17 18 19 20 21
    </small>
</div>
{% endblock %}

{% block status %}
22
    {% if vm.template.state != "READY" %} {{vm.template.state}} {% else %} {{vm.state}} {% endif %}
23 24 25
{% endblock status %}

{% block actions %}
Bence Dányi committed
26
        <a href="#" class="rename-vm" data-name="{{ vm.name }}" data-id="{{ vm.id }}" title="{% trans "Edit name" %}" data-url="{% url one.views.vm_ajax_rename iid=vm.id %}">
27
            <img src="{% static "icons/pencil.png" %}" alt="{% trans "Edit name" %}" />
28 29 30
        </a>
    {% if vm.waiting %}
        <a href="#">
31
            <img src="{% static "image/load.gif" %}" />
32 33 34
        </a>
    {% elif vm.state == 'ACTIVE' %}
        <a href="{{vm.get_connect_uri}}" data-id="{{ vm.id  }}" class="connect-vm" title="{% trans "Connect" %}">
35
            <img src="{% static "icons/plug.png" %}" alt="{% trans "Connect" %}" />
36 37
        </a>
        <a href="#" class="stop-vm" data-name="{{ vm.name }}" data-id="{{ vm.id }}" title="{% trans "Pause" %}">
38
            <img src="{% static "icons/control-pause.png" %}" alt="{% trans "Pause" %}" />
39 40
        </a>
        <a href="#" class="delete-vm" data-name="{{ vm.name }}" data-id="{{ vm.id }}" title="{% trans "Delete" %}">
41
            <img src="{% static "icons/minus-circle.png" %}" alt="{% trans "Delete" %}" />
42 43
        </a>
        <a href="#"  class="restart-vm" data-name="{{ vm.name }}" data-id="{{ vm.id }}" title="{% trans "Restart" %}">
44
            <img src="{% static "icons/arrow-circle-double.png" %}" alt="↺" />
45 46 47
        </a>
    {% elif vm.state == 'PENDING' %}
        <a href="#">
48
            <img src="{% static "image/load.gif" %}" />
49 50
        </a>
        <a style="float: right" href="#" class="delete-vm" data-name="{{ vm.name }}" data-id="{{ vm.id }}" title="{% trans "Delete" %}">
51
            <img src="{% static "icons/minus-circle.png" %}" alt="{% trans "Delete" %}" />
52 53 54
        </a>
    {% elif vm.state == 'STOPPED' %}
        <a href="#" class="resume-vm" data-name="{{ vm.name }}" data-id="{{ vm.id }}" title="{% trans "Resume" %}">
55
            <img src="{% static "icons/control.png" %}" alt="{% trans "Resume" %}" />
56 57
        </a>
        <a href="#" class="delete-vm" data-name="{{ vm.name }}" data-id="{{ vm.id }}" title="{% trans "Delete" %}">
58
            <img src="{% static "icons/minus-circle.png" %}" alt="{% trans "Delete" %}" />
59 60 61
        </a>
    {% elif vm.state == 'FAILED' %}
        <a href="#" class="delete-vm" data-name="{{ vm.name }}" data-id="{{ vm.id }}" title="{% trans "Delete" %}">
62
            <img src="{% static "icons/minus-circle.png" %}" alt="{% trans "Delete" %}" />
63 64 65
        </a>
    {% endif %}
{% endblock actions %}