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

<xf:pageaction>
	<xf:button href="{{ link('logs/payment-provider/search') }}" icon="search">{{ phrase('search_logs') }}</xf:button>
</xf:pageaction>

<xf:if is="$entries is not empty">
	<div class="block">
		<div class="block-container">
			<div class="block-body">
				<xf:datalist>
					<xf:foreach loop="$entries" value="$entry">
						<xf:set var="$purchaseRequest" value="{$entry.PurchaseRequest}" />
						<xf:datarow>
							<xf:main href="{{ link('logs/payment-provider', $entry) }}" overlay="true">
								<xf:label>
									{{ $entry.log_type == 'payment' ? phrase('payment')
										: ($entry.log_type == 'info' ? phrase('information')
										: ($entry.log_type == 'error' ? phrase('error')
										: ($entry.log_type == 'cancel' ? phrase('cancellation')
										: ($entry.log_type))))
									}}{$xf.language.label_separator}
									<span dir="auto">{$entry.log_message}</span>
								</xf:label>
								<xf:explain>
									<ul class="listInline listInline--bullet">
										<li>{{ $purchaseRequest.PaymentProfile.title ?: phrase('unknown_payment_profile') }}</li>
										<li>{{ $purchaseRequest.Purchasable.title ?: phrase('unknown_purchasable') }}</li>
										<li><xf:date time="{$entry.log_date}" /></li>
										<li>{{ $purchaseRequest.User ? $purchaseRequest.User.username : phrase('unknown_user') }}</li>
									</ul>
								</xf:explain>
							</xf:main>
						</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/payment-provider" params="{$linkParams}"
			wrapperclass="block-outer block-outer--after" />
	</div>
<xf:else />
	<div class="blockMessage">{{ phrase('no_entries_have_been_logged') }}</div>
</xf:if>