{% extends "admin/change_form.html" %}

{% load i18n admin_modify adminmedia %}

{% block extrahead %}
	{{ block.super }}
	{{ error_headers }}
	<style type="text/css">
	#reporter_body { 
		padding: 8px;
		background: none repeat scroll 0 0 #FFFFCC
	}
	#reporter_body #traceback li { list-style-type: inherit; }
	#reporter_body #traceback { padding: 8px; margin-top: 10px; }
	#reporter_body td, #reporter_body th { border-bottom: 0; font:small sans-serif; line-height: auto; }
	#content { margin: 0; }
	#meta th, #meta td { border: 0; padding: 8px; }
	#meta th { text-align: left; }
	.submit-row { display: none; }
	.error-list h3 { padding: 0 8px; }
	.error-list table { width: 100%; border: 1px solid #ddd; }
	</style>
	{% include "admin/djangodblog/partials/change_list_styles.html" %}
{% endblock %}

{% block content_title %}{% endblock %}

{% block content %}
	<table id="meta">
		<colgroup>
			<col style="width:15%"/>
			<col style="width:35%"/>
			<col style="width:15%"/>
			<col style="width:35%"/>
		</colgroup>
		<tfoot>
			<tr>
				<td colspan="4">
					<em>Interactive tracebacks are not available when viewing summaries</em>
				</td>
			</tr>
		</tfoot>
		<tbody>
			<tr>
				<th>URL:</th>
				<td>{% if instance.url %}<a href="{{ instance.full_url }}">{{ instance.full_url }}</a>{% else %}<em>Not available</em>{% endif %}</td>
				<th>Level:</th>
				<td><a href="../?level={{ instance.level }}">{{ instance.get_level_display }}</a> (<a href="../?logger={{ instance.logger }}">{{ instance.logger }}</a>, <a href="../?logger={{ instance.logger }}&amp;level={{ instance.level }}">{{ instance.logger }}:{{ instance.get_level_display }}</a>)</td>
			</tr>
			<tr>
				<th>Server:</th>
				<td><a href="../?server_name={{ instance.server_name }}">{{ instance.server_name }}</a></td>
				<th>Last Seen:</th>
				<td>{{ instance.last_seen }}</td>
			</tr>
		</tbody>
	</table>
	{{ block.super }}
	{% if recent_errors %}
		<div id="meta" class="error-list">
			<h3>Recent Errors</h3>
			<table>
				<thead>
					<th>URL</th>
					<th>Server name</th>
					<th>Datetime</th>
				</thead>
				<tfoot>
					<tr>
						<td colspan="4">
							<a href="../../error/?checksum={{ instance.checksum }}">&rsaquo; View all errors within this batch</a>
						</td>
					</tr>
				</tfoot>
				<tbody>
					{% for error in recent_errors %}
						<tr class="{% cycle 'row1' 'row2' %}">
							<th><a href="{% url admin:djangodblog_error_change error.pk %}">{{ error.url }}</a></th>
							<td>{{ error.server_name }}</td>
							<td>{{ error.datetime }}</td>
						</tr>
					{% endfor %}
				</tbody>
			</table>
		</div>
	{% endif %}
{% endblock %}
