<xf:if is="$route.isInsert()">
	<xf:title>{{ phrase('add_route') }}</xf:title>
<xf:else />
	<xf:title>{{ phrase('edit_route:') }} {$route.unique_name}</xf:title>
</xf:if>

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

<xf:form action="{{ link('routes/save', $route) }}" ajax="true" class="block">

	<div class="block-container">
		<div class="block-body">
			<xf:selectrow name="route_type" value="{$route}"
				label="{{ phrase('route_type') }}">

				<xf:option value="">&nbsp;</xf:option>
				<xf:foreach loop="$routeTypes" key="$routeTypeId" value="$routeType">
					<xf:option value="{$routeTypeId}">{$routeType}</xf:option>
				</xf:foreach>
			</xf:selectrow>

			<xf:textboxrow name="route_prefix" value="{$route}"
				label="{{ phrase('route_prefix') }}"
				dir="ltr" />

			<xf:textboxrow name="sub_name" value="{$route}"
				label="{{ phrase('sub_name') }}"
				dir="ltr" />

			<xf:textboxrow name="format" value="{$route}"
				label="{{ phrase('route_format') }}"
				dir="ltr" />

			<xf:textboxrow name="context" value="{$route}"
				label="{{ phrase('section_context') }}"
				dir="ltr" />

			<xf:formrow rowtype="input"
				label="{{ phrase('link_building_callback') }}"
				explain="{{ phrase('link_building_callback_explanation_html') }}">

				<xf:macro id="helper_callback_fields::callback_fields"
					arg-namePrefix="build"
					arg-data="{$route}" />
			</xf:formrow>

			<xf:textboxrow name="controller" value="{$route}"
				label="{{ phrase('controller') }}"
				dir="ltr" />

			<xf:textboxrow name="action_prefix" value="{$route}"
				label="{{ phrase('action_prefix') }}"
				dir="ltr" />

			<xf:macro id="addon_macros::addon_edit" arg-addOnId="{$route.addon_id}" />
		</div>
		<xf:submitrow sticky="true" icon="save" />
	</div>

</xf:form>