{% extends "django_datawatch/base.html" %}
{% load i18n %}

{% block django_datawatch %}
    <div class="row">
        <div class="col-md-12">
            <div class="panel {% if result.status == result.STATUS.critical %}panel-danger{% elif result.status == result.STATUS.warning %}panel-warning{% elif result.status == result.STATUS.ok %}panel-success{% else %}panel-default{% endif %}">
                <div class="panel-heading">
                    <div class="panel-title">
                        <h3>{{ result.get_status_display }} - {{ result.get_check_instance.get_title }}</h3>
                    </div>
                </div>
                <div class="panel-body">
                    <div class="row">
                        <div class="col-md-8">
                            <h3>{{ result.payload_description }}</h3>
                        </div>
                        <div class="col-md-4 text-right">
                            <a href="{% url "django_datawatch_result_acknowledge" pk=result.pk %}">{% trans "Acknowledge" %}</a><br>
                            <a href="{% url "django_datawatch_result_config" pk=result.pk %}">{% trans "Change config" %}</a><br>
                            <a href="{% url "django_datawatch_result_refresh" pk=result.pk %}">{% trans "Refresh" %}</a>
                        </div>
                    </div>
                    {% if result.is_acknowledged %}
                        <div class="row">
                            <div class="col-md-12">
                                <hr>
                                {% blocktrans with date=result.acknowledged_until|date %}Acknowledged until {{ date }}{% endblocktrans %}
                                <br>
                                <strong>{% trans "Reason" %}</strong>: {{ result.acknowledged_reason }}
                            </div>
                        </div>
                    {% endif %}
                    <div class="row">
                        <div class="col-md-12">
                            <hr>
                            {% block django_datawatch_check %}{% endblock %}
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
{% endblock %}
