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

<xf:form action="{{ link('logs/moderator') }}" class="block">
	<div class="block-container">
		<div class="block-body block-row">
			<span>
				{{ phrase('filter_by_user:') }}
				<xf:select name="user_id" value="{$userId}" class="input--inline">
					<xf:option value="0">{{ phrase('any') }}</xf:option>
					<xf:options source="$logUsers" />
				</xf:select>
			</span>

			<xf:button type="submit">{{ phrase('filter') }}</xf:button>
		</div>
	</div>
</xf:form>

<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('action') }}</xf:cell>
						<xf:cell>{{ phrase('user') }}</xf:cell>
						<xf:cell>{{ phrase('ip_address') }}</xf:cell>
						<xf:cell>{{ phrase('date') }}</xf:cell>
					</xf:datarow>
					<xf:foreach loop="$entries" value="$entry">
						<xf:datarow>
							<xf:cell>
								<div>
									<a href="{{ link('logs/moderator', $entry) }}" data-xf-click="overlay">{$entry.action_text|strip_tags}</a>
									<div class="dataList-subRow">{$entry.content_title}</div>
								</div>
							</xf:cell>
							<xf:cell><xf:username user="$entry.User" href="{{ link('users/edit', $entry.User) }}" /></xf:cell>
							<xf:cell class="u-ltr">{{ $entry.ip_address ? $entry.ip_address|ip : '' }}</xf:cell>
							<xf:cell><xf:date time="{$entry.log_date}" /></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/moderator" params="{$linkFilters}"
			wrapperclass="block-outer block-outer--after" />
	</div>
<xf:else />
	<div class="blockMessage">{{ phrase('no_entries_have_been_logged') }}</div>
</xf:if>