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

<xf:if is="$bans is not empty">
	<xf:form action="{{ link('threads/reply-bans') }}" class="block">
		<div class="block-outer">
			<span class="filterBlock">
				<xf:textbox name="username" value="{$user.username}" class="input filterBlock-input" ac="single"
					 placeholder="{{ phrase('user_name...') }}" />

				<xf:button type="submit" class="button--small">{{ phrase('filter') }}</xf:button>
			</span>
		</div>
		<div class="block-container">
			<div class="block-body">
				<xf:datalist data-xf-init="responsive-data-list">
					<xf:datarow rowtype="header">
						<xf:cell>{{ phrase('user') }}</xf:cell>
						<xf:cell>{{ phrase('thread') }}</xf:cell>
						<xf:cell>{{ phrase('reason') }}</xf:cell>
						<xf:cell>{{ phrase('end_date') }}</xf:cell>
						<xf:cell></xf:cell>
					</xf:datarow>
					<xf:foreach loop="$bans" value="$ban">
						<xf:datarow rowclass="dataList-row--noHover">
							<xf:cell>
								<xf:username user="$ban.User" href="{{ link('users/edit', $ban.User) }}" />
							</xf:cell>
							<xf:cell>
								<a href="{{ link_type('public', 'threads', $ban.Thread) }}">{$ban.Thread.title}</a>
							</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:delete href="{{ link('threads/reply-bans/delete', $ban) }}" overlay="true" />
						</xf:datarow>
					</xf:foreach>
				</xf:datalist>
			</div>
			<div class="block-footer">
				<span class="block-footer-counter">{{ display_totals($bans, $total) }}</span>
			</div>
		</div>

		<xf:pagenav page="{$page}" perpage="{$perPage}" total="{$total}"
			link="threads/reply-bans" params="{$linkParams}"
			wrapperclass="block-outer block-outer--after" />
	</xf:form>
<xf:else />
	<div class="blockMessage">{{ phrase('no_results_found') }}</div>
</xf:if>