<xf:title>{{ phrase('member_stats') }}</xf:title>
<xf:description>{{ phrase('member_stats_description') }}</xf:description>

<xf:pageaction>
	<xf:button href="{{ link('member-stats/add') }}" icon="add">{{ phrase('add_member_stat') }}</xf:button>
</xf:pageaction>

<xf:if is="$memberStats is not empty">
	<xf:form action="{{ link('member-stats/toggle') }}" class="block" ajax="true">
		<div class="block-outer">
			<xf:macro template="filter_macros" name="quick_filter" arg-key="member_stats" arg-class="block-outer-opposite" />
		</div>
		<div class="block-container">
			<div class="block-body">
				<xf:datalist>
					<xf:foreach loop="$memberStats" value="$memberStat">
						<xf:datarow
							label="{$memberStat.title}"
							href="{{ link('member-stats/edit', $memberStat) }}"
							delete="{{ link('member-stats/delete', $memberStat) }}">

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