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

<xf:pageaction>
	<xf:button href="{{ link('help-pages/add') }}" icon="add">{{ phrase('add_help_page') }}</xf:button>
</xf:pageaction>

<xf:if is="$pages is not empty">
	<xf:form action="{{ link('help-pages/toggle') }}" class="block" ajax="true">
		<div class="block-outer">
			<xf:macro id="filter_macros::quick_filter" arg-key="help-pages" arg-class="block-outer-opposite" />
		</div>
		<div class="block-container">
			<div class="block-body">
				<xf:datalist>
					<xf:foreach loop="$pages" value="$page">
						<xf:datarow
							label="{$page.title}"
							hint="{$page.page_name}"
							href="{{ link('help-pages/edit', $page) }}"
							explain="{$page.description}"
							delete="{{ link('help-pages/delete', $page) }}"
							hash="{$page.page_id}">
							<xf:toggle name="active[{$page.page_id}]" selected="$page.active"
								class="dataList-cell--separated" submit="true"
								tooltip="{{ phrase('enable_disable_x', {'title': $page.title}) }}" />
						</xf:datarow>
					</xf:foreach>
				</xf:datalist>
			</div>
			<div class="block-footer">
				<span class="block-footer-counter">{{ display_totals($pages) }}</span>
			</div>
		</div>
	</xf:form>
<xf:else />
	<div class="blockMessage">{{ phrase('no_items_have_been_created_yet') }}</div>
</xf:if>