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

<xf:form action="{{ link('logs/link-proxy') }}" class="block">
	<div class="block-container">
		<div class="block-body block-row">
			<xf:textbox name="url" value="{$filters.url}"
				placeholder="{{ phrase('url_contains...') }}"
				class="input--inline" />

			<span>
				{{ phrase('ordered_by:') }}
				<xf:select name="order" value="{{ $filters.order ? $filters.order : 'last_request_date' }}"
					class="input--inline">
					<xf:option value="last_request_date">{{ phrase('last_requested') }}</xf:option>
					<xf:option value="first_request_date">{{ phrase('first_requested') }}</xf:option>
					<xf:option value="hits">{{ phrase('hits') }}</xf:option>
				</xf:select>
			</span>

			<xf:button type="submit">{{ phrase('go') }}</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('link') }}</xf:cell>
						<xf:cell>{{ phrase('hits') }}</xf:cell>
					</xf:datarow>
					<xf:foreach loop="$entries" value="$entry">
						<xf:datarow>
							<xf:cell href="{{ link('logs/link-proxy', $entry) }}" overlay="true">
								<div class="dataList-textRow">{$entry.url}</div>
								<div class="dataList-subRow">
									<ul class="listInline listInline--bullet">
										<li>{{ phrase('first_requested:') }} <xf:date time="{$entry.first_request_date}" /></li>
										<li>{{ phrase('last_requested:') }} <xf:date time="{$entry.last_request_date}" /></li>
									</ul>
								</div>
							</xf:cell>
							<xf:cell href="{{ link('logs/link-proxy', $entry) }}" class="dataList-cell--min"
								overlay="true">
								{$entry.hits|number}
							</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/link-proxy" params="{$filters}"
			wrapperclass="block-outer block-outer--after" />
	</div>
<xf:else />
	<div class="blockMessage">{{ phrase('no_entries_have_been_logged') }}</div>
</xf:if>