{% extends 'base.html' %}
{% load i18n %}
{% block title %}{% trans "Execution Details" %}{% endblock %}

{% block page_header %}
    <h1>
        {% trans "Execution Details" %}
    </h1>
{% endblock page_header %}

{% block main %}
    {% load i18n sizeformat %}

    <div class="detail">
        <h4>{% trans "Overview" %}</h4>
        <hr class="header_rule">
        <dl class="dl-horizontal">
            <dt>{% trans "ID" %}</dt>
            <dd>{{ execution.id|default:_("None") }}</dd>
            {% if execution.description %}
                <dt>{% trans "Description" %}</dt>
                <dd>{{ execution.description }}</dd>
            {% endif %}
            <dt>{% trans "State" %}</dt>
            <dd>{{ execution.state }}</dd>
            {% if execution.state_info %}
                <dt>{% trans "State Info" %}</dt>
                <dd>{{ execution.state_info }}</dd>
            {% endif %}
            <dt>{% trans "Worflow Name" %}</dt>
            <dd>
                <a href="{{ execution.workflow_url }}"
                   title="{{execution.workflow_name}} {% trans "overview" %}">
                    {{ execution.workflow_name }}
                </a>
            </dd>
            <dt>{% trans "Tasks" %}</dt>
            <dd>
                <a href="{{ task.url }}"
                   title="{% trans "View tasks" %}">
                    {% trans "view corresponding tasks" %}
                </a>
            </dd>
            <br/>
            <dt>{% trans "Creation Date" %}</dt>
            <dd>{{ execution.created_at|parse_isotime}}</dd>
            <dt>{% trans "Time Since Created" %}</dt>
            <dd>{{ execution.created_at|parse_isotime|timesince }}</dd>
            <br/>
            <dt>{% trans "Update Date" %}</dt>
            <dd>{{ execution.updated_at|parse_isotime}}</dd>
            <dt>{% trans "Time Since Updated" %}</dt>
            <dd>{{ execution.updated_at|parse_isotime|timesince }}</dd>
        </dl>
    </div>

    <div class="detail">
        <hr class="header_rule">
        <dl class="dl-horizontal">
            <dt>{% trans "Params" %}</dt>
            <dd>{{ execution.params }}</dd>
            <dt>{% trans "Input" %}</dt>
            <dd>{{ execution.input }}</dd>
            <dt>{% trans "Output" %}</dt>
            <dd>{{ execution.output }}</dd>
        </dl>
    </div>

{% endblock %}