<?page title="${labels.TravelOrdersFormTitle}" contentType="text/html;charset=UTF-8"?>
<zk
	xmlns="http://www.zkoss.org/2005/zul"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.zkoss.org/2005/zul http://www.zkoss.org/2005/zul/zul.xsd">
	<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
	<vbox vflex="1">
		<button
			vflex="min"
			image="/img/upload-016.png"
			label="Připojit soubor"
			upload="true"
			onUpload="@command('uploadAttachment')"
			sclass="nicebutton" />
		<grid
			model="@load(vm.attachments)"
			vflex="1">
			<columns>
				<column
					label="Soubor"
					width="220px" />
				<column
					label="Popis"
					hflex="max" />
				<column width="200px" />
			</columns>
			<rows>
				<template name="model">
					<row>
						<a
							href="@load('/api/dl/'.concat(each.pathInFilesystem).concat('/').concat(each.fileName))"
							label="@load(each.fileName)"
							target="blank" />
						<textbox
							value="@bind(each.description)"
							sclass="grid-textbox-max" />
						<hbox>
							<button
								image="/img/delete-016.png"
								label="Odebrat"
								onClick="@command('deleteAttachment', attachment=each)"
								sclass="nicebutton" />
							<button
								image="/img/download-016.png"
								label="Stáhnout"
								onClick="@command('downloadAttachment', attachment=each)"
								sclass="nicebutton" />
						</hbox>
					</row>
				</template>
			</rows>
		</grid>
	</vbox>
</zk>