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

<xf:head option="metaNoindex"><meta name="robots" content="noindex" /></xf:head>

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

<xf:form action="{{ link('threads/add-reply', $thread) }}" class="block" ajax="true" draft="{{ link('threads/draft', $thread) }}" data-xf-init="attachment-manager">
	<div class="block-container">
		<div class="block-body">
			<xf:editorrow name="message"
				value="{$defaultMessage}"
				attachments="{{ $attachmentData ? $attachmentData.attachments : [] }}"
				rowtype="fullWidth noLabel"
				placeholder="{{ phrase('reply_placeholder') }}"
				label="{{ phrase('message') }}"
				data-preview-url="{{ link('threads/reply-preview', $thread) }}" />

			<xf:formrow>
				<xf:if is="$attachmentData">
					<xf:macro template="helper_attach_upload" name="upload_block"
						arg-attachmentData="{$attachmentData}"
						arg-forceHash="{$thread.draft_reply.attachment_hash}" />
				</xf:if>

				<xf:if is="$xf.options.multiQuote">
					<xf:macro template="multi_quote_macros" name="button"
						arg-href="{{ link('threads/multi-quote', $thread) }}"
						arg-messageSelector=".js-post"
						arg-storageKey="multiQuoteThread" />
				</xf:if>
			</xf:formrow>

			<xf:if is="!$xf.visitor.user_id AND !$thread.canReplyPreReg()">
				<xf:textboxrow name="_xfUsername" data-xf-init="guest-username"
					maxlength="{{ max_length($xf.visitor, 'username') }}"
					label="{{ phrase('name') }}"/>
			<xf:elseif is="$xf.visitor.user_id" />
				<xf:macro template="helper_thread_options" name="watch_input" arg-thread="{$thread}" />
				<xf:macro template="helper_thread_options" name="thread_status" arg-thread="{$thread}" />
			</xf:if>

			<xf:captcharow label="{{ phrase('verification') }}" />
		</div>
		<xf:submitrow submit="{{ phrase('post_reply') }}" icon="reply" sticky="true" />
	</div>
</xf:form>