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

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

<xf:if is="$widgetDefinitions is not empty">
	<div class="block">
		<div class="block-outer">
			<xf:macro id="filter_macros::quick_filter" arg-key="widget-definitions" arg-class="block-outer-opposite" />
		</div>
		<div class="block-container">
			<div class="block-body">
				<xf:datalist>
					<xf:foreach loop="$widgetDefinitions" value="$widgetDefinition">
						<xf:datarow
							label="{$widgetDefinition.title}"
							hint="{$widgetDefinition.definition_class}"
							explain="{$widgetDefinition.description}"
							href="{{ link('widgets/definitions/edit', $widgetDefinition) }}"
							delete="{{ link('widgets/definitions/delete', $widgetDefinition) }}">

							<xf:action href="{{ link('widgets/add', null, {'definition_id': $widgetDefinition.definition_id}) }}">
								{{ phrase('add_widget') }}
							</xf:action>
						</xf:datarow>
					</xf:foreach>
				</xf:datalist>
			</div>
			<div class="block-footer">
				<span class="block-footer-counter">{{ display_totals($widgetDefinitions) }}</span>
			</div>
		</div>
	</div>
<xf:else />
	<div class="blockMessage">{{ phrase('no_items_have_been_created_yet') }}</div>
</xf:if>