<xf:if is="$section.isInsert()">
	<xf:title>{{ phrase('add_activity_summary_section') }}</xf:title>
<xf:else />
	<xf:title>{{ phrase('edit_activity_summary_section:') }} {$section.title}</xf:title>
</xf:if>

<xf:pageaction if="$section.isUpdate()">
	<xf:button href="{{ link('activity-summary/delete', $section) }}" icon="delete" overlay="true" />
</xf:pageaction>

<xf:form action="{{ link('activity-summary/save', $section) }}" class="block" ajax="true">
	<div class="block-container">
		<div class="block-body">

			<xf:formrow
				label="{{ phrase('activity_summary_definition') }}"
				explain="{$definition.description}">
				{$definition.title}
				<xf:hiddenval name="definition_id">{$definition.definition_id}</xf:hiddenval>
			</xf:formrow>

			<hr class="formRowSep" />

			<xf:textboxrow name="title" value="{{ $section.section_id ? $section.MasterTitle.phrase_text : '' }}"
				label="{{ phrase('title') }}"
				hint="{{ phrase('optional') }}"
				explain="{{ phrase('you_may_choose_enter_title_for_section_if_not_default') }}" />

			<xf:macro template="display_order_macros" name="row"
				arg-value="{$section.display_order}" />

			<xf:checkboxrow>
				<xf:option name="show_value" value="1" selected="$section.show_value"
					label="{{ phrase('display_total_count_in_summary') }}" />
				<xf:explain>{{ phrase('if_enabled_total_found_section_displayed_top_activity_summary_email') }}</xf:explain>
			</xf:checkboxrow>

			<xf:checkboxrow>
				<xf:option name="active" value="1" selected="$section.active">
					{{ phrase('enabled') }}
				</xf:option>
			</xf:checkboxrow>

			{$section.renderOptions()|raw}
		</div>
		<xf:submitrow sticky="true" icon="save" />
	</div>
</xf:form>