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

<xf:form action="{{ link('languages/import') }}" upload="true" ajax="true" class="block">
	<div class="block-container">
		<div class="block-body">
			<xf:uploadrow name="upload" accept=".xml"
				label="{{ phrase('import_from_uploaded_xml_file') }}" />

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

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

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

					<xf:select name="overwrite_language_id">
						<xf:foreach loop="$languageTree.getFlattened(0)" value="$treeEntry">
							<xf:option value="{$treeEntry.record.language_id}">{{ repeat('--', $treeEntry.depth) }}
								{$treeEntry.record.title}
							</xf:option>
						</xf:foreach>
					</xf:select>
					<xf:html><div class="formRow-explain">{{ phrase('overwrite_language_id_explain') }}</div></xf:html>
				</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>