<xf:title>{{ phrase('template_history') }}</xf:title>

<xf:form method="post" action="{{ link('templates/history', $template) }}" ajax="true" class="block">
	<div class="block-container">
		<div class="block-body">
			<xf:datalist data-xf-init="responsive-data-list">
				<xf:datarow rowtype="header">
					<xf:cell class="dataList-cell--min">{{ phrase('old') }}</xf:cell>
					<xf:cell class="dataList-cell--min">{{ phrase('new') }}</xf:cell>
					<xf:cell>{{ phrase('edit_date') }}</xf:cell>
					<xf:cell />
				</xf:datarow>
				<xf:datarow>
					<xf:cell />
					<xf:cell><input type="radio" name="new" value="0" {{ $newId == 0 ? 'checked="checked"' : '' }} /></xf:cell>
					<xf:cell>{{ phrase('current_version') }}</xf:cell>
					<xf:cell />
				</xf:datarow>
				<xf:foreach loop="$list" value="$history">
					<xf:datarow>
						<xf:cell><input type="radio" name="old" value="{$history.template_history_id}" {{ $oldId == $history.template_history_id ? 'checked="checked"' : '' }} /></xf:cell>
						<xf:cell><input type="radio" name="new" value="{$history.template_history_id}" {{ $newId == $history.template_history_id ? 'checked="checked"' : '' }} /></xf:cell>
						<xf:cell><xf:date time="{$history.edit_date}" /></xf:cell>
						<xf:action href="{{ link('templates/history', $template, {'view': $history.template_history_id}) }}" overlay="true">{{ phrase('view_pre_edit_version') }}</xf:action>
					</xf:datarow>
				</xf:foreach>
			</xf:datalist>
		</div>
		<div class="block-footer">
			<span class="block-footer-controls"><xf:button type="submit">{{ phrase('compare') }}</xf:button></span>
		</div>
	</div>
</xf:form>