<vn>
<h1 id="title">
	_ShoppingBasket
</h1>
<div id="actions">
	<htk-bar-button
		icon="ok"
		tip="_Checkout"
		on-click="onCheckoutClick"/>
	<htk-bar-button
		icon="view-dual"
		tip="_Catalog"
		on-click="onCatalogClick"/>
	<htk-bar-button
		icon="preferences"
		tip="_ConfigureOrder"
		on-click="onConfigureClick"/>
</div>
<div id="main" class="basket">
	<div class="card form">
		<div class="head">
			<p>
				_Total 
				<htk-text format="%.2d€">
					<db-calc-sum property="param" func="subtotal" model="items"/>
				</htk-text>
			</p>
		</div>
		<htk-repeater renderer="repeaterFunc">
			<db-model id="items" property="model" updatable="true" result-index="1">
				SET @a = -8;
				SELECT r.id, r.amount, r.price, @a := @a + 4 available,
						i.name, i.size, i.category, i.image
					FROM basket_item r
						JOIN vn.item i ON i.id = r.item_id
			</db-model>
			<custom>
				<div class="line">
					<htk-button
						lot="iter"
						class="delete"
						tip="_Remove"
						icon="delete"
						on-click="onDeleteClick"/>
					<htk-image
						value="{{image}}"
						class="photo"
						directory="catalog"
						subdir="200x200"
						full-dir="900x900"/>
					<p class="concept">
						{{name}} {{size}} {{category}}
					</p>
					<p class="amount">
						<span id="row">{{amount}}</span> x
						<htk-text lot="iter" name="price" format="%.2d€"/>
						<span class="subtotal">
							<htk-text id="subtotal" format="%.2d€"/>
						</span>
					</p>
					<span id="available">
						{{available}} <span>_availables</span> 
					</span>
					<div class="clear"/>
				</div>
			</custom>
		</htk-repeater>
	</div>
</div>
</vn>
