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

<xf:form action="{{ link('styles/import') }}" upload="true" ajax="true" class="block">
	<div class="block-container">
		<div class="block-body">
			<xf:if is="$canSupportStyleArchives">
				<xf:uploadrow name="upload" accept=".xml,.zip"
					label="{{ phrase('import_from_uploaded_xml_or_archive_file') }}" />
			<xf:else />
				<xf:uploadrow name="upload" accept=".xml"
					label="{{ phrase('import_from_uploaded_xml_file') }}" />
			</xf:if>

			<xf:radiorow name="target"
				label="{{ phrase('import_as') }}">

				<xf:option value="new" checked="checked"
					label="{{ phrase('child_of_style:') }}">

					<xf:select name="parent_style_id">
						<xf:option>{{ phrase('(no_parent)') }}</xf:option>
						<xf:foreach loop="$styleTree.getFlattened(0)" value="$treeEntry">
							<xf:option value="{$treeEntry.record.style_id}">
								{{ repeat('--', $treeEntry.depth) }} {$treeEntry.record.title}
							</xf:option>
						</xf:foreach>
					</xf:select>
				</xf:option>
				<xf:option value="overwrite"
					label="{{ phrase('overwrite_style') }}">

					<xf:select name="overwrite_style_id">
						<xf:foreach loop="$styleTree.getFlattened(0)" value="$treeEntry">
							<xf:option value="{$treeEntry.record.style_id}">{{ repeat('--', $treeEntry.depth) }}
								{$treeEntry.record.title}
							</xf:option>
						</xf:foreach>
					</xf:select>
				</xf:option>
			</xf:radiorow>

			<xf:checkboxrow>
				<xf:option name="force">
					<xf:label>{{ phrase('skip_import_checks') }}</xf:label>
					<xf:hint>{{ phrase('selecting_bypass_checks_made_by_import_prevent_accidents') }}</xf:hint>
				</xf:option>
			</xf:checkboxrow>

		</div>
		<xf:submitrow icon="import" />
	</div>
</xf:form>