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

<xf:js src="xf/thread.js" min="1" />

<xf:breadcrumb source="$thread.getBreadcrumbs()" />

<xf:form action="{{ link('threads/edit', $thread) }}"
	class="block"
	ajax="true"
	data-xf-init="thread-edit-form"
	data-item-selector=".js-threadListItem-{$thread.thread_id}">

	<div class="block-container">
		<div class="block-body">
			<xf:prefixinputrow
				label="{{ phrase('title') }}"
				prefixes="{{ $thread.isPrefixEditable() ? $prefixes : [] }}"
				type="thread"
				prefix-value="{$thread.prefix_id}"
				textbox-value="{$thread.title}"
				placeholder="{{ phrase('title...') }}"
				autofocus="autofocus"
				maxlength="{{ max_length($thread, 'title') }}"
				help-href="{{ link('forums/prefix-help', $forum) }}"/>

			<xf:if contentcheck="true">
				<hr class="formRowSep" />
				<xf:contentcheck>
					{{ $thread.TypeHandler.renderExtraDataEdit(
						$thread,
						'edit',
						'thread'
					)|raw }}
				</xf:contentcheck>
			</xf:if>

			<xf:if contentcheck="true">
				<hr class="formRowSep" />
				<xf:contentcheck>
					<xf:macro template="custom_fields_macros" name="custom_fields_edit"
						arg-type="threads"
						arg-set="{$thread.custom_fields}"
						arg-editMode="{{ $thread.getFieldEditMode() }}"
						arg-onlyInclude="{$forum.field_cache}" />
				</xf:contentcheck>
				<hr class="formRowSep" />
			</xf:if>

			<xf:macro template="helper_thread_options" name="thread_status" arg-thread="{$thread}" />
		</div>

		<xf:submitrow icon="save" sticky="true">
			<xf:html>
				<xf:if is="$thread.canDelete()">
					<xf:button href="{{ link('threads/delete', $thread) }}" icon="delete" overlay="true">{{ phrase('delete...') }}</xf:button>
				</xf:if>
			</xf:html>
		</xf:submitrow>
	</div>

	<xf:if is="$noInlineMod">
		<xf:hiddenval name="_xfNoInlineMod">1</xf:hiddenval>
	</xf:if>
	<xf:if is="$forumName">
		<xf:hiddenval name="_xfForumName">1</xf:hiddenval>
	</xf:if>
</xf:form>