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

<xf:pageaction>
	<xf:button href="{{ link('banning/users/add') }}" icon="add">{{ phrase('ban_user') }}</xf:button>
</xf:pageaction>

<xf:if is="$userBans is not empty">
	<div class="block">
		<div class="block-container">
			<div class="block-body">
				<xf:datalist data-xf-init="responsive-data-list">
					<xf:datarow rowtype="header">
						<xf:cell>{{ phrase('user_name') }}</xf:cell>
						<xf:cell>{{ phrase('end_date') }}</xf:cell>
						<xf:cell>{{ phrase('reason') }}</xf:cell>
						<xf:cell>&nbsp;</xf:cell>
						<xf:cell>&nbsp;</xf:cell>
					</xf:datarow>
					<xf:foreach loop="$userBans" value="$userBan">
						<xf:datarow>
							<xf:cell href="{{ link('banning/users', $userBan.User) }}">{$userBan.User.username}</xf:cell>
							<xf:cell href="{{ link('banning/users', $userBan.User) }}">{{ $userBan.end_date ? date($userBan.end_date) : phrase('permanent') }}</xf:cell>
							<xf:cell href="{{ link('banning/users', $userBan.User) }}">{{ $userBan.user_reason ?: phrase('n_a') }}</xf:cell>
							<xf:action href="{{ link('users/edit', $userBan.User) }}">{{ phrase('user') }}</xf:action>
							<xf:delete href="{{ link('banning/users/lift', $userBan.User) }}" tooltip="{{ phrase('lift_ban') }}" />
						</xf:datarow>
					</xf:foreach>
				</xf:datalist>
			</div>
			<div class="block-footer">
				<span class="block-footer-counter">{{ display_totals($userBans, $total) }}</span>
			</div>
		</div>

		<xf:pagenav page="{$page}" perpage="{$perPage}" total="{$total}"
			link="banning/users"
			wrapperclass="block-outer block-outer--after" />
	</div>
<xf:else />
	<div class="blockMessage">{{ phrase('there_no_banned_users') }}</div>
</xf:if>