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

<xf:if is="$entries 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') }}</xf:cell>
						<xf:cell>{{ phrase('applied_by') }}</xf:cell>
						<xf:cell>{{ phrase('application_date') }}</xf:cell>
						<xf:cell>{{ phrase('restored') }}</xf:cell>
						<xf:cell class="dataList-cell--min">&nbsp;</xf:cell>
					</xf:datarow>

					<xf:foreach loop="$entries" value="$entry">
						<xf:datarow>
							<xf:cell>
								<xf:username user="$entry.User"
									defaultname="{$entry.username}"
									href="{{ $entry.User ? link('users/edit', $entry.User) : null }}" />
							</xf:cell>

							<xf:cell>
								<xf:username user="$entry.ApplyingUser"
									defaultname="{$entry.applying_username}"
									href="{{ $entry.ApplyingUser ? link_type('public', 'members', $entry.ApplyingUser) : null }}" />
							</xf:cell>

							<xf:cell>
								<xf:date time="$entry.application_date" />
							</xf:cell>

							<xf:cell>
								<xf:if is="$entry.restored_date">
									<xf:date time="$entry.restored_date" />
								<xf:else />
									{{ phrase('no') }}
								</xf:if>
							</xf:cell>

							<xf:cell href="{{ link('logs/spam-cleaner/restore', $entry) }}" overlay="true"
								class="dataList-cell--action">
								{{ phrase('restore') }}
							</xf:cell>
						</xf:datarow>
					</xf:foreach>
				</xf:datalist>
			</div>
			<div class="block-footer">
				<span class="block-footer-counter">{{ display_totals($entries, $total) }}</span>
			</div>
		</div>
		<xf:pagenav page="{$page}" perpage="{$perPage}" total="{$total}"
			link="logs/spam-cleaner"
			wrapperclass="block-outer block-outer--after" />
	</div>
<xf:else />
	<div class="blockMessage">{{ phrase('no_entries_have_been_logged') }}</div>
</xf:if>