{% if version is null and logfile.versionExists('') %}
    {% set version = '' %}
{% endif %}

<h4>
    {{ logfile.getTask().getName() }} (task id {{ logfile.getTask.getId() }})
    {% if version is not null %}
        version {{ version ? version : "(now)" }}
    {% endif %}
</h4>

{% for v in logfile.getVersions() | sort | reverse %}
    <a href="{{ path('admin_tasks_task_log', {'task':logfile.getTask.getId(), 'version' : v }) }}">{{ v ? v : "(now)" }}</a>
    &nbsp;
{% endfor %}

{% if version is not null %}
    <pre>{{ logfile.getContent(version) }}</pre>
    <a href="{{ path('admin_tasks_task_log', {'task':logfile.getTask.getId(), 'version' : version, 'clr':'1' }) }} ">
        {{ 'Clear' | trans }}
    </a>
{% endif %}
