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

<xf:pageaction>
	<xf:button href="{{ link('widgets/positions/add') }}" icon="add">{{ phrase('add_widget_position') }}</xf:button>
</xf:pageaction>

<xf:if is="$widgetPositions is not empty">
	<xf:form action="{{ link('widgets/positions/toggle') }}" class="block" ajax="true">
		<div class="block-outer">
			<xf:macro template="filter_macros" name="quick_filter" arg-key="widget-positions" arg-class="block-outer-opposite" />
		</div>
		<div class="block-container">
			<div class="block-body">
				<xf:datalist>
					<xf:foreach loop="$widgetPositions" value="$widgetPosition">
						<xf:datarow
							label="{$widgetPosition.title}"
							explain="{$widgetPosition.description|raw}"
							href="{{ link('widgets/positions/edit', $widgetPosition) }}"
							delete="{{ link('widgets/positions/delete', $widgetPosition) }}">

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