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

<xf:if is="$testSuccess AND $xf.visitor.email">
	<div class="blockMessage blockMessage--success blockMessage--iconic">{{ phrase('test_activity_summary_email_sent_to_x_successfully', {'email': $xf.visitor.email}) }}</div>
</xf:if>

<xf:if is="$isImportRunning AND $xf.options.activitySummaryEmail.enabled">
	<div class="blockMessage blockMessage--important blockMessage--iconic">
		{{ phrase('while_import_running_sending_activity_summary_disabled') }}
	</div>
</xf:if>

<xf:pageaction>
	<div class="buttonGroup">
		<xf:button href="{{ link('activity-summary/add') }}" icon="add" overlay="true">{{ phrase('add_activity_summary_section') }}</xf:button>
		<xf:button href="{{ link('activity-summary/sort') }}" icon="sort" overlay="true" />
	</div>

	<xf:if is="$sections is not empty AND $xf.visitor.email">
		<xf:button href="{{ link('activity-summary/send-test-email') }}" fa="fa-envelope" overlay="true">{{ phrase('send_test_email') }}</xf:button>
	</xf:if>
</xf:pageaction>

<xf:if is="$sections is not empty">
	<xf:form action="{{ link('activity-summary/toggle') }}" class="block" ajax="true">
		<div class="block-outer">
			<xf:macro template="filter_macros" name="quick_filter" arg-key="activity-summary-sections" arg-class="block-outer-opposite" />
		</div>
		<div class="block-container">
			<div class="block-body">
				<xf:datalist>
					<xf:foreach loop="$sections" value="$section">
						<xf:datarow
							label="{$section.title}"
							href="{{ link('activity-summary/edit', $section) }}"
							delete="{{ link('activity-summary/delete', $section) }}">
							<xf:toggle name="active[{$section.section_id}]" selected="$section.active"
								class="dataList-cell--separated" submit="true"
								tooltip="{{ phrase('enable_disable_x', {'title': $section.title}) }}" />
						</xf:datarow>
					</xf:foreach>
				</xf:datalist>
			</div>
			<div class="block-footer">
				<span class="block-footer-counter">{{ display_totals($sections) }}</span>
			</div>
		</div>
	</xf:form>
<xf:else />
	<div class="blockMessage">{{ phrase('no_items_have_been_created_yet') }}</div>
</xf:if>

<xf:macro template="option_macros" name="option_form_block" arg-options="{$options}" />