{% extends "box/base/summary.html" %}
{% load i18n %}
{% load l10n %}
{% get_current_language as LANGUAGE_CODE %}

{% block content %}
<div class="summary {% if t.state == 'NEW' or t.state == 'SAVING'%}unfinished{% endif %}">
    {{ block.super }}
    {% if t.myshares %}
    <ul class="shares">
        {% for i in t.myshares %}
        <li>
            <div class="quota">
                <div class="used" style="width: {{ i.get_instance_pc|unlocalize }}%"></div>
            </div>
            <form action="/vm/unshare/{{i.id}}/" method="post">
                <span title="{{i.name}}">{{i.name|truncatechars:20}}</span>
                    ({{i.get_running}}/{{i.instance_limit}})
                    {% csrf_token %}
                <input class="template-unshare" type="submit" value="{% trans "Delete" %}" style="float: right"/>
            </form>
            <div class="clear"></div>
        </li>
        {% endfor %}
    </ul>
    {% endif %}
</div>
{% endblock content %}

{% block name %}
<div class="name">{{t.name}}</div>
{% endblock %}

{% block status %}
    {{vm.state}}
{% endblock status %}

{% block actions %}
    {% if t.state == 'READY' %}
    <a href="#" class="try-template" data-id="{{t.id}}" title="{% trans "Try"  %}">
        <img src="/static/icons/control.png" alt="{% trans "Start" %}"/>
    </a>
    <a href="#" title="{% trans "Edit" %}">
        <img src="/static/icons/pencil.png" alt="{% trans "Edit" %}" />
    </a>
    <a href="#" class="template-share" data-id="{{t.id}}" data-gid="{{group.id}}" title="{% trans "Share" %}">
        <img src="/static/icons/user-share.png" alt="{% trans "Share" %}" />
    </a>
    {% endif %}
    <a href="#" class="delete-template" data-id="{{ t.id }}" data-name="{{ t.name }}" title="{% trans "Remove" %}">
        <img src="/static/icons/minus-circle.png" alt="{% trans "Remove" %}" />
    </a>
    <a href="#" class="edit-template" data-id="{{ t.id }}" title="{% trans "Edit" %}">
        <img src="/static/icons/pencil.png" alt="{% trans "Edit" %}" />
    </a>
{% endblock actions %}