<xf:title>{{ phrase('message_users') }}</xf:title>
<xf:description>{{ phrase('message_users_description') }}</xf:description>

<xf:if is="$sent">
	<div class="blockMessage blockMessage--success blockMessage--iconic">
		{{ phrase('your_direct_message_was_sent_to_x_users', {'sent': $sent|number}) }}
	</div>
</xf:if>

<xf:form action="{{ link('users/message/confirm') }}" class="block">
	<div class="block-container">
		<div class="block-body">
			<xf:textboxrow name="from_user" value="{$xf.visitor.username}" ac="single"
				label="{{ phrase('from_user') }}">

				<xf:explain>
					<p>{{ phrase('enter_name_of_existing_user_direct_message_should_be_started_by') }}</p>
					<p><b>{{ phrase('note:') }}</b> {{ phrase('you_cannot_send_direct_message_to_yourself') }}</p>
				</xf:explain>
			</xf:textboxrow>

			<hr class="formRowSep" />

			<xf:textboxrow name="message_title" maxlength="100"
				label="{{ phrase('direct_message_title') }}"
				required="true" />

			<xf:textarearow name="message_body" rows="5" autosize="true"
				label="{{ phrase('direct_message_body') }}"
				required="true"
				hint="{{ phrase('you_may_use_bb_code') }}"
				explain="{{ phrase('following_placeholders_will_be_replaced_in_body_for_direct_message') }} {{ phrase('you_may_also_use_phrase_title_which_will_be_replaced') }}" />

			<hr class="formRowSep" />

			<xf:checkboxrow label="{{ phrase('direct_message_options') }}">
				<xf:option name="open_invite" value="1">{{ phrase('allow_anyone_in_direct_message_to_invite_others') }}</xf:option>
				<xf:option name="conversation_locked" value="1">{{ phrase('lock_direct_message_no_responses_will_be_allowed') }}</xf:option>
			</xf:checkboxrow>

			<xf:radiorow name="delete_type"
				label="{{ phrase('future_message_handling') }}">

				<xf:option selected="true"
					label="{{ phrase('do_not_leave_direct_message') }}"
					explain="{{ phrase('direct_message_remain_in_inbox_and_notified_of_replies') }}" />
				<xf:option value="deleted"
					label="{{ phrase('leave_direct_message_and_accept_future_responses') }}"
					explain="{{ phrase('should_direct_message_receive_responses_restored_to_inbox') }}" />
				<xf:option value="deleted_ignored"
					label="{{ phrase('leave_direct_message_and_ignore_future_responses') }}"
					explain="{{ phrase('not_notified_of_responses_direct_message_remain_deleted') }}" />
			</xf:radiorow>
		</div>

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

		<xf:submitrow submit="{{ phrase('proceed...') }}" sticky="true" />
	</div>
</xf:form>