{% extends 'error_tracker/base.html' %}
{% load error_tracker i18n %}

{% block content_block %}
{% if error %}
    <h1 class="text-center alert alert-danger">{{ error }}</h1>
{% else %}

    <div class="row mb-4">
        <div class="col-md-2 bg-dark p-1 text-white text-center font-weight-bold">{%trans 'Method' %}</div>
        <div class="col-md-10 bg-dark p-1 text-white text-center font-weight-bold">{%trans 'Referrer' %}</div>
        <div class="col-md-2  p-1 text-center bg-light">
            {{ obj.method }} 
        </div>
        <div class="col-md-10  p-1 text-center bg-light">
            {{ obj.host }}{{ obj.path }}
        </div>
    </div>

    <div class="row mb-4 mt-2">
        <div class="col-md-4 p-0">
            <div class="col-md-12 text-center bg-dark text-white font-weight-bold p-0">{%trans 'First time seen' %}</div>
            <div class="col-md-12 text-center bg-light">{{ obj.created_on }}</div>
        </div>
        <div class="col-md-4 p-0">
            <div class="col-md-12 text-center bg-dark text-white font-weight-bold">{%trans 'Last seen' %}</div>
            <div class="col-md-12 text-center bg-light">{{ obj.last_seen }}</div>
        </div>
        <div class="col-md-4 p-0">
            <div class="col-md-12 text-center bg-dark text-white font-weight-bold" >{%trans 'Occurrences' %}</div>
            <div class="col-md-12 text-center bg-light">{{ obj.count }}</div>
        </div>
    </div>
    <div class="row">
        <div class="col-md-12 text-center bg-dark text-white font-weight-bold p-1">{%trans 'Request data' %}</div>
        <div class="col-md-12 col-lg-12 bg-light">{{obj.request_data|to_pretty}}</div>
    </div>
    <div class="row">
        <div class="col-md-12 text-center bg-dark text-white font-weight-bold p-1">{%trans 'Exception detail' %}</div>
        <div class="col-md-12 bg-light"><pre> {{obj.traceback|escape|replace_new_line_with_br|safe}}</pre>
        </div>
    </div>


{% endif %}
{% endblock %}