<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.route_type}"
				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.route_prefix}"
				maxlength="{{ max_length($route, 'route_prefix') }}"
				label="{{ phrase('route_prefix') }}"
				dir="ltr" />

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

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

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

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

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

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

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

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

</xf:form>