<xf:if is="$prefix.isInsert()">
	<xf:title>{{ phrase('add_prefix') }}</xf:title>
<xf:else />
	<xf:title>{{ phrase('edit_prefix:') }} {$prefix.title}</xf:title>
</xf:if>

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

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

			<xf:textboxrow name="title" value="{{ $prefix.prefix_id ? $prefix.MasterTitle.phrase_text : '' }}"
				label="{{ phrase('title') }}" />

			<xf:if is="$prefix.hasRelation('MasterDescription')">
				<xf:codeeditorrow name="description" value="{{ $prefix.prefix_id ? $prefix.MasterDescription.phrase_text : '' }}"
					mode="html" data-line-wrapping="true"
					rows="1"
					readonly="0"
					class="codeEditor--autoSize"
					label="{{ phrase('description') }}"
					explain="{{ phrase('prefix_description_explain') }}" />
			</xf:if>

			<xf:if is="$prefix.hasRelation('MasterUsageHelp')">
				<xf:codeeditorrow name="usage_help" value="{{ $prefix.prefix_id ? $prefix.MasterUsageHelp.phrase_text : '' }}"
					mode="html" data-line-wrapping="true"
					readonly="0"
					class="codeEditor--autoSize"
					label="{{ phrase('prefix_usage_help') }}"
					explain="{{ phrase('prefix_usage_help_explain') }}" />
			</xf:if>

			<xf:macro template="base_prefix_edit_macros" name="display_style" arg-prefix="{$prefix}"
				arg-displayStyles="{$displayStyles}" />

			<hr class="formRowSep" />

			<xf:macro template="base_prefix_edit_macros" name="prefix_groups" arg-prefix="{$prefix}"
				arg-prefixGroups="{$prefixGroups}" />

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

			<hr class="formRowSep" />

			<xf:macro template="helper_user_group_edit" name="checkboxes"
				arg-selectedUserGroups="{{ $prefix.prefix_id ? $prefix.allowed_user_group_ids : [-1] }}" />

			{$extraOptions|raw}
		</div>
		<xf:submitrow sticky="true" icon="save" />
	</div>
</xf:form>