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

<xf:pageaction>
	<xf:button href="{{ link('code-events/add') }}" icon="add">{{ phrase('add_code_event') }}</xf:button>
</xf:pageaction>

<xf:if is="$events is not empty">
	<xf:form action="code-events/toggle" class="block" ajax="true">
		<div class="block-outer">
			<xf:macro template="filter_macros" name="quick_filter" arg-key="code-events" arg-class="block-outer-opposite" />
		</div>
		<div class="block-container">
			<div class="block-body">
				<xf:datalist>
					<xf:foreach loop="$events" value="$event">
						<xf:datarow
							hash="{$event.event_id}"
							href="{{ link('code-events/edit', $event) }}"
							label="{$event.event_id}"
							delete="{{ link('code-events/delete', $event) }}"
							dir="auto" />
					</xf:foreach>
				</xf:datalist>
			</div>
			<div class="block-footer">
				<span class="block-footer-counter">{{ display_totals($events) }}</span>
			</div>
		</div>
	</xf:form>
<xf:else />
	<div class="blockMessage">{{ phrase('no_items_have_been_created_yet') }}</div>
</xf:if>