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

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

<xf:form action="{{ link('pages/save', $node) }}" ajax="true" class="block">
	<div class="block-container">
		<div class="block-body">
			<xf:macro id="node_edit_macros::node_name" arg-node="{$node}" arg-optional="{{ false }}" />

			<xf:macro id="node_edit_macros::title" arg-node="{$node}" />
			<xf:macro id="node_edit_macros::description" 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:codeeditorrow name="template" value="{{ $page.isUpdate() ? $page.MasterTemplate.template : '' }}"
				mode="html"
				hint="{{ $page.isUpdate() ? $page.getTemplateName() : '' }}"
				class="codeEditor--short"
				label="{{ phrase('template_html') }}"
				explain="{{ phrase('you_may_use_xenforo_template_syntax_here') }}" />

			<xf:checkboxrow rowclass="surplusLabel"
				label="{{ phrase('optional_components') }}">

				<xf:option name="log_visits" selected="$page.log_visits"
					label="{{ phrase('log_and_count_visits_to_this_page') }}" />

				<xf:option name="list_siblings" selected="$page.list_siblings"
					label="{{ phrase('list_sibling_nodes') }}" />

				<xf:option name="list_children" selected="$page.list_children"
					label="{{ phrase('list_child_nodes') }}" />
			</xf:checkboxrow>

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

				<xf:macro id="helper_callback_fields::callback_fields" arg-data="{$page}" />
			</xf:formrow>

			<xf:checkboxrow>
				<xf:option name="advanced_mode" value="1" selected="{$page.advanced_mode}"
					label="{{ phrase('advanced_mode') }}"
					hint="{{ phrase('if_enabled_html_for_your_page_will_not_be_contained_within_block') }}" />
			</xf:checkboxrow>

			<xf:macro id="node_edit_macros::style" arg-node="{$node}" arg-styleTree="{$styleTree}" />
		</div>

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

</xf:form>