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

<xf:pageaction>
	<xf:button href="{{ link('oauth2/clients/add') }}" icon="add">{{ phrase('add_oauth2_client') }}</xf:button>
</xf:pageaction>

<xf:if is="$clients is not empty">
	<xf:form action="{{ link('oauth2/clients/toggle') }}" class="block" ajax="true">
		<div class="block-outer">
			<xf:macro template="filter_macros" name="quick_filter" arg-key="oauth2-clients" arg-class="block-outer-opposite" />
		</div>
		<div class="block-container">
			<div class="block-body">
				<xf:datalist>
					<xf:foreach loop="$clients" value="$client">
						<xf:datarow
							label="{$client.title}"
							href="{{ link('oauth2/clients/edit', $client) }}"
							delete="{{ link('oauth2/clients/delete', $client) }}">
							<xf:explain>
								<ul class="listInline listInline--bullet">
									<li>
										{{ phrase('created') }}:
										<xf:date time="{$client.creation_date}"/>
									</li>
								</ul>
							</xf:explain>

							<xf:toggle name="active[{$client.client_id}]" selected="$client.active"
								class="dataList-cell--separated" submit="true"
								tooltip="{{ phrase('enable_disable_x', {'title': $client.title}) }}" />
						</xf:datarow>
					</xf:foreach>
				</xf:datalist>
			</div>
			<div class="block-footer">
				<span class="block-footer-counter">{{ display_totals($clients) }}</span>
			</div>
		</div>
	</xf:form>
<xf:else />
	<div class="blockMessage">{{ phrase('no_items_have_been_created_yet') }}</div>
</xf:if>