{% extends "carrot/base_site.html" %}

{% block content %}
    {% el "h2" object %}
    {% ot "div" class="task-info" %}
        {% el "h3" "Basic information" %}
        {% info_table object %}
        {% el "h3" "Task inputs" %}
        {{ object|jsonblock }}
        {% if object.status == 'FAILED' %}
            {% el "h3" "Failure information" %}
            {% ot "div" class="strapline" %}
                This task failed due to the following exception: {{ object.exception }} {% el "br" %}
                Click {% el "a" "here" href=object.retry_url %} to retry the task or
                {% el "a" "here" href=object.delete_url %} to delete it
            {% ct "div" %}
            {{ object.traceback|formatted_traceback }}
        {% elif object.status == 'COMPLETED' %}
            {% el "h3" "Log" %}
            {% ot "ul" class="levelselect" %}
                {% ot "li" %}{% if loglevel == "DEBUG" %}Debug{% else %}{% el "a" "Debug" href="level=DEBUG" %}{% endif %}{% ct "li" %}
                {% ot "li" %}{% if loglevel == "INFO" %}Info{% else %}{% el "a" "Info" href="level=INFO" %}{% endif %}{% ct "li" %}
                {% ot "li" %}{% if loglevel == "WARNING" %}Warning{% else %}{% el "a" "Warning" href="level=WARNING" %}{% endif %}{% ct "li" %}
                {% ot "li" %}{% if loglevel == "ERROR" %}Error{% else %}{% el "a" "Error" href="level=ERROR" %}{% endif %}{% ct "li" %}
                {% ot "li" %}{% if loglevel == "CRITICAL" %}Critical{% else %}{% el "a" "Critical" href="level=CRITICAL" %}{% endif %}{% ct "li" %}
            {% ct "ul" %}
            {{ object.log|formatted_traceback:loglevel }}
            {% el "h3" "Task output" %}
            {{ object.output|outputblock }}
        {% endif %}
    {% ct "div" %}
{% endblock %}