{% extends "base.html" %}
{% load staticfiles %}
{% load filters_deploys %}

{% block extra_css %}
<link rel="stylesheet" href="{% static "css/abyss.widget.css" %}">
<link rel="stylesheet" href="{% static "css/detail.css" %}">
<link rel="stylesheet" href="{% static "css/deploy-diff.css" %}">
{% endblock %}

{% block sidebar %}
{% include "sidebar.html" with active="deploys" %}
{% endblock %}

{% block header %}
<h1>Admin/Deploys</h1>
{% endblock %}

{% block content %}
<div class="container-fluid">
    <div class="row">
        <div class="col-md-12">
            <h3>Info</h3>
            <div class="content">
                <p><strong>App:</strong> <a href="{% url 'detail-app' deploy.App %}"> {{ deploy.App }} </a></p>
                <p><strong>User:</strong> {{ deploy.User }}</p>
                <p><strong>Duration:</strong> {{ deploy.Duration|time_to_string }}</p>
                <p><strong>Timestamp:</strong> {{ deploy.Timestamp|string_to_date|date:" d-m-Y H:i:s " }}</p>
                {% if deploy.Commit %}<p><strong>Last Commit:</strong> {{ deploy.Commit }}</p>{% endif %}
                {% if deploy.Error %}<p><strong>Error:</strong> {{ deploy.Error }}</p>{% endif %}
                {% if deploy.Diff %}
                <p><strong>Diff:</strong></p>{{ deploy.Diff|safe }}
                {% endif %}
                <p><strong>Log:</strong></p>
                <div><pre>{{ deploy.Log|escape }}</pre></div>
            </div>
        </div>
    </div>
</div>
{% endblock content %}
