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

<xf:macro template="public:nestable_macros" name="setup" />

<xf:form action="{{ link('activity-summary/sort') }}" class="block" ajax="true">
	<div class="block-container">
		<div class="block-body">
			<div class="nestable-container" data-xf-init="nestable" data-max-depth="1" data-value-function="serialize">
				<xf:macro name="section_list" arg-sections="{$sections}" />
				<xf:hiddenval name="sections" value="" />
			</div>
		</div>
		<xf:submitrow icon="save" rowtype="simple" />
	</div>
</xf:form>

<xf:macro name="section_list" arg-sections="!">
	<ol class="nestable-list">
		<xf:foreach loop="$sections" key="$id" value="$section">
			<li class="nestable-item" data-id="{$id}">
				<div class="nestable-handle" aria-label="{{ phrase('drag_handle')|for_attr }}"><xf:fa icon="fa-bars" /></div>
				<div class="nestable-content">
					{$section.title}
				</div>
			</li>
		</xf:foreach>
	</ol>
</xf:macro>