{% extends "admin/base_site.html" %}
{% load adminmedia admin_list i18n %}

{% block title %}Objects pending moderation{% endblock %}

{% block stylesheet %}{% admin_media_prefix %}css/changelists.css{% endblock %}
{% block extrahead %}<link href="/media/css/forms.css" type="text/css" rel="stylesheet">{% endblock %}

{% block bodyclass %}change-list{% endblock %}

{% block breadcrumbs %}<div class="breadcrumbs"><a href="../../">{% trans "Home" %}</a> &rsaquo; <a href="../">Gatekeeper</a> {% if content_type %}&rsaquo; {{ content_type.model }} {% endif %}</div>{% endblock %}

{% block coltype %}flex{% endblock %}

{% block content %}
	<form action="{% url gatekeeper_moderate %}" method="post">
		<div id="content-main">
			{% block object-tools %}{% endblock %}
			<div class="module filtered" id="changelist">
				{% block filters %}
					<div id="changelist-filter">
						<h2>{% trans 'Filter' %}</h2>
						<h3>By model</h3>
						<ul>
							<li {% if not content_type %}class="selected"{% endif %}><a href="./">None</a></li>
							{% for ct in cts %}
								<li {% ifequal content_type.pk ct.pk %}class="selected"{% endifequal %}>
									<a href="?content_type={{ ct.pk }}">{{ ct.model }}</a>
								</li>
							{% endfor %}
						</ul>
					</div>
				{% endblock %}
				{% block result_list %}
					<table cellspacing="0">
						<thead>
							<tr>
								<th>Moderate</th>
								<th>Status</th>
								<th>Object Type</th>
								<th>Object Description</th>
							</tr>
						</thead>
						<tbody>
							{% for obj in pending %}
								<tr class="{% cycle 'row1' 'row2' %}">
									{% with obj.content_type as oct %}
										<td><input type="checkbox" name="objects" value="{{ obj.pk }}"></td>
										<td>{{ obj.get_status_display }}</td>
										<td><a href="/admin/{{ oct.app_label }}/{{ oct.model }}/">{{ oct.model }}</a></td>
										<td><a href="/admin/{{ oct.app_label }}/{{ oct.model }}/{{ obj.pk }}/">{{ obj.content_object }}</a></td>
									{% endwith %}
								</tr>
							{% endfor %}
						</tbody>
					</table>
				{% endblock %}
			</div>
		
			<div class="submit-row" >
				<input type="submit" value="Deny Selected" name="_deny" />
				<input type="submit" value="Approve Selected" name="_approve"  />
			</div>
		</div>
	</form>
{% endblock %}