<xf:if is="$trophy.isInsert()">
	<xf:title>{{ phrase('add_trophy') }}</xf:title>
<xf:else />
	<xf:title>{{ phrase('edit_trophy:') }} {$trophy.title}</xf:title>
</xf:if>

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

<xf:form action="{{ link('trophies/save', $trophy) }}" ajax="true" class="block">
	<div class="block-container">
		<h2 class="block-tabHeader tabs hScroller" data-xf-init="h-scroller tabs" role="tablist">
			<span class="hScroller-scroll">
				<a class="tabs-tab is-active" role="tab" tabindex="0" aria-controls="trophy-options">{{ phrase('trophy_options') }}</a>
				<xf:macro template="helper_criteria" name="user_tabs" arg-userTabTitle="{{ phrase('award_this_trophy_if') }}" />
			</span>
		</h2>

		<ul class="block-body tabPanes">
			<li class="is-active" role="tabpanel" id="trophy-options">
				<xf:textboxrow name="title" value="{{ $trophy.trophy_id ? $trophy.MasterTitle.phrase_text : ''  }}"
					label="{{ phrase('title') }}"/>

				<xf:numberboxrow name="trophy_points" value="{$trophy.trophy_points}" min="0"
					label="{{ phrase('trophy_points') }}"
					explain="{{ phrase('points_can_be_used_track_progression_and_change_title') }}" />

				<xf:textarearow name="description" value="{{ $trophy.trophy_id ? $trophy.MasterDescription.phrase_text : ''  }}" autosize="true"
					label="{{ phrase('description') }}"
					hint="{{ phrase('you_may_use_html') }}"
					explain="{{ phrase('optionally_describe_trophy_and_criteria_user_needs_to_award') }}" />
			</li>

			<xf:macro template="helper_criteria" name="user_panes"
				arg-criteria="{{ $userCriteria.getCriteriaForTemplate() }}"
				arg-data="{{ $userCriteria.getExtraTemplateData() }}" />
		</ul>

		<xf:submitrow sticky="true" icon="save" />
	</div>
</xf:form>