<xf:title>{{ phrase('manage_reply_bans:') }} {{ prefix('thread', $thread, 'escaped') }}{$thread.title}</xf:title>
<xf:h1>{{ phrase('manage_reply_bans:') }} {{ prefix('thread', $thread) }}{$thread.title}</xf:h1>

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

<xf:form action="{{ link('threads/reply-bans', $thread) }}" ajax="true" class="block">
	<div class="block-container">
		<div class="block-body">
			<xf:if is="$bans is not empty">
				<xf:datalist data-xf-init="responsive-data-list">
					<xf:datarow rowtype="header">
						<xf:cell>{{ phrase('user') }}</xf:cell>
						<xf:cell>{{ phrase('reason') }}</xf:cell>
						<xf:cell>{{ phrase('end_date') }}</xf:cell>
						<xf:cell class="dataList-cell--min">{{ phrase('delete') }}</xf:cell>
					</xf:datarow>
					<xf:foreach loop="$bans" value="$ban">
						<xf:datarow rowclass="dataList-row--noHover">
							<xf:cell><xf:username user="$ban.User" /></xf:cell>
							<xf:cell>
								<xf:if is="$ban.reason">
									{$ban.reason}
								<xf:else />
									{{ phrase('n_a') }}
								</xf:if>
							</xf:cell>
							<xf:cell>
								<xf:if is="$ban.expiry_date">
									<xf:date time="{$ban.expiry_date}" />
								<xf:else />
									{{ phrase('permanent') }}
								</xf:if>
							</xf:cell>
							<xf:toggle name="delete[{$ban.user_id}]" class="dataList-cell--separated dataList-cell--alt" />
						</xf:datarow>
					</xf:foreach>
				</xf:datalist>
			</div>
			<h2 class="block-formSectionHeader">{{ phrase('new_reply_ban') }}</h2>
			<div class="block-body">
			</xf:if>

			<xf:textboxrow name="username" ac="single"
				maxlength="{{ max_length($xf.visitor, 'username') }}"
				label="{{ phrase('user_name') }}"
				explain="{{ phrase('this_user_still_able_to_view_thread_not_reply') }}" />

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

				<xf:option value="permanent"
					label="{{ phrase('permanent') }}" />

				<xf:option value="temporary" selected="true"
					label="{{ phrase('temporary:') }}">

					<xf:dependent>
						<div class="inputGroup inputGroup--auto">
							<xf:textbox name="ban_length_value" value="7" />
							<span class="inputGroup-splitter"></span>
							<xf:select name="ban_length_unit">
								<xf:option value="hours">{{ phrase('hours') }}</xf:option>
								<xf:option value="days" selected="true">{{ phrase('days') }}</xf:option>
								<xf:option value="weeks">{{ phrase('weeks') }}</xf:option>
								<xf:option value="months">{{ phrase('months') }}</xf:option>
							</xf:select>
						</div>
					</xf:dependent>
				</xf:option>
			</xf:radiorow>

			<xf:textboxrow name="reason" maxlength="{{ max_length('XF:ThreadReplyBan', 'reason') }}"
				label="{{ phrase('reason') }}"
				explain="{{ phrase('this_will_be_shown_to_user_if_you_choose_to_notify_them') }}" />

			<xf:checkboxrow>
				<xf:option name="send_alert">{{ phrase('notify_user_of_this_action') }}</xf:option>
			</xf:checkboxrow>
		</div>
		<xf:submitrow icon="save" sticky="true" />
	</div>
</xf:form>