<xf:if is="$node.isInsert()">
	<xf:title>{{ phrase('add_search_forum') }}</xf:title>
<xf:else />
	<xf:title>{{ phrase('edit_search_forum:') }} {$node.title}</xf:title>
</xf:if>

<xf:pageaction if="$node.isUpdate()">
	<xf:button href="{{ link('search-forums/delete', $node) }}" icon="delete" overlay="true" />
</xf:pageaction>

<xf:form action="{{ link('search-forums/save', $node) }}" ajax="true" class="block">
	<div class="block-container">
		<div class="block-body">
			<xf:macro id="node_edit_macros::title" arg-node="{$node}" />
			<xf:macro id="node_edit_macros::description" arg-node="{$node}" />

			<hr class="formRowSep" />
			<xf:macro id="node_edit_macros::node_name" arg-node="{$node}" />
			<xf:macro id="node_edit_macros::position"
				arg-node="{$node}"
				arg-nodeTree="{$nodeTree}" />
			<xf:macro id="node_edit_macros::navigation"
				arg-node="{$node}"
				arg-navChoices="{$navChoices}" />
			<xf:macro id="node_edit_macros::style"
				arg-node="{$node}"
				arg-styleTree="{$styleTree}" />
			<hr class="formRowSep" />
		</div>

		<h2 class="block-formSectionHeader">
			<span class="block-formSectionHeader-aligner">{{ phrase('search_results') }}</span>
		</h2>
		<div class="block-body">
			<hr class="formRowSep" />

			<xf:formrow rowtype="input"
				label="{{ phrase('sort_order') }}">

				<div class="inputPair">
					<xf:select name="sort_order" value="{$searchForum.sort_order}" class="input--inline">
						<xf:option value="last_post_date" label="{{ phrase('last_message') }}" />
						<xf:option value="post_date" label="{{ phrase('start_date') }}" />
						<xf:option value="title" label="{{ phrase('title') }}" />
						<xf:option value="reply_count" label="{{ phrase('replies') }}" />
						<xf:option value="view_count" label="{{ phrase('views') }}" />
					</xf:select>

					<xf:select name="sort_direction" value="{$searchForum.sort_direction}"
						class="input--inline">
						<xf:option value="desc" label="{{ phrase('descending') }}" />
						<xf:option value="asc" label="{{ phrase('ascending') }}" />
					</xf:select>
				</div>
			</xf:formrow>

			<xf:numberboxrow name="max_results" value="{$searchForum}"
				label="{{ phrase('maximum_results') }}" />

			<xf:numberboxrow name="cache_ttl" value="{$searchForum}"
				label="{{ phrase('cache_length') }}"
				explain="{{ phrase('search_forum_cache_length_desc') }}"
				units="{{ phrase('units_minutes') }}" />
		</div>

		<h2 class="block-formSectionHeader">
			<span class="block-formSectionHeader-aligner">{{ phrase('thread_criteria') }}</span>
		</h2>
		<div class="block-body">
			<xf:include template="helper_thread_search_criteria" />
		</div>

		<xf:submitrow sticky="true" icon="save" />
	</div>
</xf:form>