{% if id === false %}
<p class="selector">
<form method="GET" action="/admin/versions">
<input type="hidden" name="id" value="{{ id }}" />
{"Type"}: <select name="type" onchange="this.form.submit ()">
{% foreach classes %}
	<option value="{{ loop_value }}" {% if type == $data->loop_value %}selected{% end %}>{{ loop_value }}</option>
{% end %}
</select>
</form>
</p>
{% end %}

{% if offset > 0 %}
<p class="previous"><a href="/admin/versions?type={{ type }}&id={{ id }}&offset={{ prev }}">&laquo; {"Newer items"}</a></p>
{% end %}

{% if id === false %}
	<p>
	<table width="100%">
		<tr>
			<th width="30%">{"ID"}</th>
			<th width="30%">{"Last changed"}</th>
			<th width="25%">{"Author"}</th>
			<th width="15%">&nbsp;</th>
		</tr>
	{% foreach history %}
		<tr>
			<td>{{ loop_value->pkey }}</td>
			<td>{{ loop_value->ts|gmdate ('F j, Y - g:ia', strtotime (%s)) }}</td>
			<td>{{ loop_value->user|admin_filter_user_name }}</td>
			<td><a href="/admin/versions?type={{ type }}&id={{ loop_value->pkey }}">{"Show versions"}</a></td>
		</tr>
	{% end %}
	</table>
	</p>
{% else %}
	<p>
	<table>
		<tr>
			<th>{"Changed on"}</th>
			<th>{"Author"}</th>
			<th>&nbsp;</th>
		</tr>
	{% foreach history %}
		<tr>
			<td>{{ loop_value->ts|gmdate ('F j, Y - g:ia', strtotime (%s)) }}</td>
			<td>{{ loop_value->user|admin_filter_user_name }}</td>
		{% if loop_index == 0 %}
			{% if deleted %}
				<td><a href="/admin/compare?id={{ loop_value->id }}">{"View current"}</a></td>
			{% else %}
				<td><strong>{"Current version"}</strong></td>
			{% end %}
		{% else %}
			<td><a href="/admin/compare?id={{ loop_value->id }}">{"Compare to current"}</a></td>
		{% end %}
		</tr>
	{% end %}
	</table>
	</p>
{% end %}

{% if more %}
<p class="next"><a href="/admin/versions?type={{ type }}&id={{ id }}&offset={{ next }}">{"Older items"} &raquo;</a></p>
{% end %}
