{% extends 'admin/master.html' %}

{% block body %}

<div class="container">
    <div class="page-header">
        <h1>Task {{ task.id }}</h1>
    </div>

    <p><strong>Date :</strong> {{ task.created_at.strftime('%a, %d %b %Y %H:%M:%S') }}</p>

    {% for change in changes %}
    <div>
        <u>{{ change.cve.cve_id }} has changed</u>
        [<a href="{{url_for('main.cve_change', cve_id=change.cve.cve_id, change_id=change.id)}}">{{ change.events|length }} {{ 'events' if change.events|length > 1
        else 'event' }}</a>]
        <ul>
            {% for event in change.events %}
            {% if event.type.code != 'new_cve' %}
            <li>{{ event }}</li>
            {% else %}
            <li>[NEW CVE] {{ event }}</li>
            {% endif %}
            {% endfor %}
        </ul>
    </div>
    {% endfor %}

    </div>
    {% endblock %}