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

<xf:breadcrumb source="$breadcrumbs"/>

<xf:form action="{$confirmUrl}" class="block" ajax="true">
	<div class="block-container">
		<xf:if contentcheck="true">
			<div class="block-body">
				<xf:contentcheck>
					<xf:if is="$showVisibilityToggle">
						<xf:checkboxrow>
							<xf:option name="always_visible" checked="{$feature.always_visible}"
								label="{{ phrase('always_visible') }}"
								hint="{{ phrase('if_selected_feature_will_be_visible_even_if_member_does_not_have') }}"/>
						</xf:checkboxrow>
					</xf:if>
				</xf:contentcheck>
			</div>
		</xf:if>

		<h3 class="block-formSectionHeader">
			<span class="collapseTrigger collapseTrigger--block {{ $feature.isCustomized() ? 'is-active' : '' }}"
				data-xf-click="toggle" data-target="< :up:next">

				<span class="block-formSectionHeader-aligner">{{ phrase('customize') }}</span>
			</span>
		</h3>

		<div class="block-body block-body--collapsible {{ $feature.isCustomized() ? 'is-active' : '' }}">
			<xf:formrow>
				{{ phrase('if_you_leave_these_values_blank_feature_will_automatically_derive_them') }}
			</xf:formrow>

			<xf:textboxrow name="title" value="{$feature.title_}"
				maxlength="{{ max_length('XF:FeaturedContent', 'title') }}"
				label="{{ phrase('feature_title') }}"/>

			<xf:textarearow name="snippet" value="{$feature.snippet_}"
				rows="2" autosize="true"
				maxlength="{{ max_length('XF:FeaturedContent', 'snippet') }}"
				label="{{ phrase('feature_snippet') }}"/>

			<xf:formrow label="{{ phrase('feature_image') }}">
				<xf:upload name="image" accept=".gif,.jpeg,.jpg,.jpe,.png,.webp"/>

				<div class="formRow-explain">
					{{ phrase('it_is_recommended_that_you_use_image_that_is_at_least_x_pixels', {
					'width': 640,
					'height': 640
					}) }}
				</div>

				<xf:if is="$feature.image_date">
					<xf:checkbox standalone="true">
						<xf:option name="delete_image" label="{{ phrase('delete_current_image') }}"/>
					</xf:checkbox>
				</xf:if>
			</xf:formrow>

			<xf:datetimeinputrow name="date" value="{$feature.feature_date}"
				label="{{ phrase('featured_date') }}"
				explain="{{ phrase('featured_content_is_ordered_by_feature_date_from_newest_to_oldest') }}"/>
		</div>

		<xf:redirect/>

		<xf:submitrow icon="save">
			<xf:html>
				<xf:button href="{$deleteUrl}" icon="delete" overlay="true">{{ phrase('unfeature') }}...</xf:button>
			</xf:html>
		</xf:submitrow>
	</div>
</xf:form>