hedera-web/forms/ecomerce/catalog/ui.xml

532 lines
13 KiB
XML
Raw Normal View History

2015-03-06 23:33:54 +00:00
<vn>
2022-05-28 19:27:36 +00:00
<div id="title">
<h1 id="title-text"><t>Catalog</t></h1>
<div id="subtitle"></div>
</div>
<div id="actions" class="catalog-actions">
2022-06-06 08:53:59 +00:00
<htk-search-entry form="params" column="search"/>
2022-05-28 19:27:36 +00:00
<htk-bar-button
id="view-button"
tip="_Switch view"
icon="view_list"
on-click="this.onSwitchViewClick()"/>
<htk-bar-button
icon="shopping_cart_checkout"
tip="_ShoppingBasket"
on-click="this.onBasketClick()"/>
<button
class="menu"
on-click="onShowMenuClick">
<htk-icon name="menu" alt="_Menu"/>
</button>
</div>
2015-03-06 23:33:54 +00:00
<vn-group>
2022-05-30 01:30:33 +00:00
<vn-lot-query id="params" on-change="this.onFilterChange()">
<vn-spec name="search" type="String"/>
<vn-spec name="realm" type="Number"/>
<vn-spec name="type" type="Number"/>
2022-11-23 12:11:16 +00:00
<vn-spec name="color" type="String"/>
<vn-spec name="origin" type="Number"/>
<vn-spec name="category" type="String"/>
<vn-spec name="producer" type="Number"/>
2022-05-30 01:30:33 +00:00
</vn-lot-query>
2022-06-06 08:53:59 +00:00
<vn-lot id="filter-lot"/>
2022-05-28 19:27:36 +00:00
</vn-group>
<vn-group>
2022-06-06 08:53:59 +00:00
<sql-filter-item
2022-05-28 19:27:36 +00:00
id="id-op"
2022-06-06 08:53:59 +00:00
type="EQUAL"
target="i"
field="id"
param="search"/>
2022-05-28 19:27:36 +00:00
<sql-operation
2022-06-06 08:53:59 +00:00
id="search-op"
type="OR">
<sql-filter-item
type="LIKE"
target="i"
field="longName"
param="search"/>
<sql-filter-item
type="LIKE"
target="i"
field="subname"
param="search"/>
2022-05-28 19:27:36 +00:00
</sql-operation>
2022-06-06 08:53:59 +00:00
<sql-filter-item
2022-05-28 19:27:36 +00:00
id="realm-op"
2022-06-06 08:53:59 +00:00
type="EQUAL"
target="t"
field="categoryFk"
param="realm"/>
<sql-filter-item
2022-05-28 19:27:36 +00:00
id="type-op"
2022-06-06 08:53:59 +00:00
type="EQUAL"
target="i"
field="typeFk"
param="type"/>
<sql-filter-item
2022-05-28 19:27:36 +00:00
id="color-op"
type="EQUAL"
2022-06-06 08:53:59 +00:00
target="i"
field="inkFk"
param="color"/>
<sql-filter-item
2022-05-28 19:27:36 +00:00
type="EQUAL"
2022-06-06 08:53:59 +00:00
id="origin-op"
target="i"
field="originFk"
param="origin"/>
<sql-filter-item
type="EQUAL"
id="category-op"
target="i"
field="category"
param="category"/>
<sql-filter-item
2022-05-28 19:27:36 +00:00
id="producer-op"
2022-06-06 08:53:59 +00:00
type="EQUAL"
target="i"
field="producerFk"
param="producer"/>
2022-05-28 19:27:36 +00:00
</vn-group>
2015-03-06 23:33:54 +00:00
<vn-group>
2023-02-15 13:07:09 +00:00
<vn-lot id="order-lot"/>
2022-06-18 21:04:34 +00:00
<db-form v-model="basket">
2023-02-15 13:07:09 +00:00
<db-model property="model" lot="order-lot">
2023-02-23 13:32:13 +00:00
SELECT o.id, o.sent, ad.nickname
2023-02-15 13:07:09 +00:00
FROM myOrder o
2023-02-23 13:32:13 +00:00
LEFT JOIN myAddress ad ON ad.id = o.addressFk
2023-02-15 13:07:09 +00:00
WHERE o.id = #orderId
2016-05-04 14:36:51 +00:00
</db-model>
</db-form>
<db-model
2022-05-28 19:27:36 +00:00
id="items"
2022-06-06 08:53:59 +00:00
auto-load="false"
2022-10-13 15:01:18 +00:00
result-index="3"
2016-05-04 14:36:51 +00:00
on-status-changed="onItemsChange">
2022-10-13 15:01:18 +00:00
DROP TEMPORARY TABLE IF EXISTS tmp.item;
2019-06-05 07:05:54 +00:00
CREATE TEMPORARY TABLE tmp.item
(INDEX (itemFk))
2018-03-27 14:35:53 +00:00
ENGINE = MEMORY
2019-06-05 07:05:54 +00:00
SELECT i.id itemFk
2018-03-27 14:35:53 +00:00
FROM vn.item i
JOIN vn.itemType t ON t.id = i.typeFk
WHERE #filter;
2023-02-15 13:07:09 +00:00
CALL myOrder_calcCatalogFull(#orderId);
2022-06-18 21:04:34 +00:00
SELECT i.id, i.longName item, i.subName,
i.tag5, i.value5, i.tag6, i.value6,
i.tag7, i.value7, i.tag8, i.value8,
2023-10-09 17:51:59 +00:00
i.relevancy, i.size, i.category, i.minQuantity,
2020-08-13 08:21:59 +00:00
k.name ink, p.name producer, o.name origin,
b.available, b.price, b.`grouping`,
i.image, im.updated
2019-06-05 07:05:54 +00:00
FROM tmp.ticketCalculateItem b
JOIN vn.item i ON i.id = b.itemFk
2020-08-13 08:21:59 +00:00
LEFT JOIN vn.ink k ON k.id = i.inkFk
LEFT JOIN vn.producer p ON p.id = i.producerFk
LEFT JOIN vn.origin o ON o.id = i.originFk
2019-05-27 13:38:06 +00:00
LEFT JOIN image im
ON im.collectionFk = 'catalog'
AND im.name = i.image
WHERE b.available > 0
ORDER BY i.relevancy DESC, i.name, i.size
2020-09-26 11:34:05 +00:00
LIMIT 5000;
2022-10-13 15:01:18 +00:00
DROP TEMPORARY TABLE
tmp.item,
tmp.ticketCalculateItem,
tmp.ticketComponentPrice,
tmp.ticketComponent,
tmp.ticketLot,
tmp.zoneGetShipped;
2015-07-07 15:27:47 +00:00
</db-model>
2022-06-18 21:04:34 +00:00
<db-form id="$card" v-model="card" model="items"/>
2022-05-30 01:30:33 +00:00
<vn-lot id="card-lot"/>
2015-03-06 23:33:54 +00:00
</vn-group>
<div id="form" class="catalog">
<div id="main" class="main">
<htk-repeater
id="grid-view"
empty-message="_Choose filter from right menu"
form-id="item"
2023-10-09 18:20:01 +00:00
model="items"
renderer="itemRenderer">
<custom>
<div
id="item-box"
2022-05-28 00:37:24 +00:00
class="item-box clickable"
title="{{_('AddToBasket')}}"
2022-06-18 21:04:34 +00:00
on-click="this.onAddItemClick($event, $iter)">
2016-05-02 13:05:49 +00:00
<htk-image
directory="catalog"
subdir="200x200"
2022-06-18 21:04:34 +00:00
form="$iter"
column="image"
2019-05-27 13:38:06 +00:00
stamp-column="updated"
2022-05-28 00:37:24 +00:00
full-dir="1600x900"
title="_Zoom image"/>
<div class="item-info">
<h2>
2022-05-24 10:18:44 +00:00
{{item.item}}
</h2>
<p class="sub-name">
<span class="item-id">
#{{item.id}}
</span>
2022-05-24 10:18:44 +00:00
{{item.subName}}
</p>
<table class="item-tags">
2019-04-16 13:54:55 +00:00
<tr>
2022-05-24 10:18:44 +00:00
<td>{{item.tag5}}</td>
<td>{{item.value5}}</td>
2019-04-16 13:54:55 +00:00
</tr>
<tr>
2022-05-24 10:18:44 +00:00
<td>{{item.tag6}}</td>
<td>{{item.value6}}</td>
2019-04-16 13:54:55 +00:00
</tr>
<tr>
2022-05-24 10:18:44 +00:00
<td>{{item.tag7}}</td>
<td>{{item.value7}}</td>
2019-04-16 13:54:55 +00:00
</tr>
<tr>
<td>{{item.tag8}}</td>
<td>{{item.value8}}</td>
</tr>
2019-04-16 13:54:55 +00:00
</table>
2022-04-13 13:17:43 +00:00
<div class="available-price">
<span class="grouping" title="_MinimalGrouping">
2022-05-24 10:18:44 +00:00
{{Vn.Value.format(item.grouping, 'x%.0d')}}
2022-04-13 13:17:43 +00:00
</span>
<span class="available" title="_Available">
2022-05-24 10:18:44 +00:00
{{item.available}}
2022-04-13 13:17:43 +00:00
</span>
<span class="price" title="_GroupingPrice">
2022-05-28 00:37:24 +00:00
{{Vn.Value.format(item.price, '%.02d€')}}
2022-04-13 13:17:43 +00:00
</span>
</div>
2023-10-09 18:20:01 +00:00
<div id="min-quantity" class="min-quantity" title="_MinimalQuantity">
2023-10-09 17:51:59 +00:00
<span class="htk-icon material-symbols-rounded">
production_quantity_limits
</span>
{{item.minQuantity}}
</div>
</div>
2015-03-06 23:33:54 +00:00
</div>
</custom>
</htk-repeater>
2015-03-06 23:33:54 +00:00
</div>
</div>
<div id="right-panel" class="catalog-panel right-panel side-panel" on-click="onRightPanelClick">
<div class="basket-info">
2023-02-23 13:32:13 +00:00
<p>{{basket.nickname}}</p>
2022-06-18 21:04:34 +00:00
<p>{{Vn.Value.format(basket.sent, '%D')}}</p>
2022-05-26 14:26:20 +00:00
<button class="thin" on-click="this.onConfigureClick()">
2022-05-21 21:31:56 +00:00
<t>Modify</t>
2015-12-10 13:48:43 +00:00
</button>
</div>
<div class="filter">
<div class="categories">
<div class="realms">
<htk-repeater
2022-05-24 10:18:44 +00:00
form-id="form"
renderer="realmRenderer"
class="realms-box">
<db-model
2022-05-28 19:27:36 +00:00
id="realms"
property="model"
2022-05-28 19:27:36 +00:00
on-status-changed="refreshTitle">
2021-11-17 07:36:38 +00:00
SELECT c.id, l.name, c.color, c.code
FROM vn.itemCategory c
JOIN vn.itemCategoryL10n l ON l.id = c.id
WHERE c.display
2019-02-12 15:40:17 +00:00
ORDER BY display
</db-model>
<custom>
<a id="link">
2022-05-24 10:18:44 +00:00
<img
id="image"
src="{{`image/family/black/${form.code}.svg`}}"
title="{{form.name}}"
alt="{{form.name}}"/>
</a>
</custom>
</htk-repeater>
<div class="clear"/>
</div>
</div>
<div id="realm-msg" class="realm-msg">
2022-05-26 06:08:31 +00:00
<h5><t>Choose a realm</t></h5>
</div>
<div id="filters" class="filters">
<h2><t>Filter by</t></h2>
2022-06-06 08:53:59 +00:00
<htk-combo
placeholder="_Family"
2022-06-06 08:53:59 +00:00
form="params"
column="type"
2022-05-28 19:27:36 +00:00
id="type-filter">
<db-model
2022-05-28 19:27:36 +00:00
id="types"
property="model"
conn="conn"
2022-06-06 08:53:59 +00:00
lot="params"
result-index="1"
on-status-changed="refreshTitle">
2023-02-15 13:07:09 +00:00
CALL myOrder_getAvailable(#orderId);
SELECT DISTINCT t.id, l.name
FROM vn.item i
JOIN vn.itemType t ON t.id = i.typeFk
2018-05-18 11:52:05 +00:00
JOIN tmp.itemAvailable a ON a.id = i.id
JOIN vn.itemTypeL10n l ON l.id = t.id
2022-06-06 08:53:59 +00:00
WHERE t.`order` >= 0
AND t.categoryFk = #realm
2022-10-13 15:01:18 +00:00
ORDER BY t.`order`, l.name;
DROP TEMPORARY TABLE tmp.itemAvailable;
</db-model>
2022-06-06 08:53:59 +00:00
</htk-combo>
<htk-combo
placeholder="_Color"
2022-06-06 08:53:59 +00:00
form="params"
column="color"
2022-06-18 21:04:34 +00:00
on-mousedown="colors.lazyRefresh()">
2022-06-06 08:53:59 +00:00
<db-model
id="colors"
property="model"
auto-load="false"
result-index="1">
2023-02-15 13:07:09 +00:00
CALL myOrder_getAvailable(#orderId);
2018-03-27 14:35:53 +00:00
SELECT DISTINCT l.id, l.name
FROM vn.item i
JOIN vn.itemType t ON t.id = i.typeFk
2018-05-18 11:52:05 +00:00
JOIN tmp.itemAvailable a ON a.id = i.id
2018-03-27 14:35:53 +00:00
JOIN vn.inkL10n l ON l.id = i.inkFk
WHERE #filter
2022-10-13 15:01:18 +00:00
ORDER BY name;
DROP TEMPORARY TABLE tmp.itemAvailable;
</db-model>
2022-06-06 08:53:59 +00:00
</htk-combo>
<htk-combo
placeholder="_Producer"
2022-06-06 08:53:59 +00:00
form="params"
column="producer"
2022-06-18 21:04:34 +00:00
on-mousedown="producers.lazyRefresh()">
2022-06-06 08:53:59 +00:00
<db-model
id="producers"
property="model"
auto-load="false"
result-index="1">
2023-02-15 13:07:09 +00:00
CALL myOrder_getAvailable(#orderId);
SELECT DISTINCT p.id, p.name
FROM vn.item i
JOIN vn.itemType t ON t.id = i.typeFk
2018-05-18 11:52:05 +00:00
JOIN tmp.itemAvailable a ON a.id = i.id
JOIN vn.producer p ON p.id = i.producerFk
WHERE #filter
2022-10-13 15:01:18 +00:00
ORDER BY name;
DROP TEMPORARY TABLE tmp.itemAvailable;
</db-model>
2022-06-06 08:53:59 +00:00
</htk-combo>
<htk-combo
placeholder="_Origin"
2022-06-06 08:53:59 +00:00
form="params"
column="origin"
2022-06-18 21:04:34 +00:00
on-mousedown="origins.lazyRefresh()">
2022-06-06 08:53:59 +00:00
<db-model
id="origins"
property="model"
auto-load="false"
result-index="1">
2023-02-15 13:07:09 +00:00
CALL myOrder_getAvailable(#orderId);
SELECT DISTINCT o.id, l.name, o.code
FROM vn.item i
JOIN vn.itemType t ON t.id = i.typeFk
2018-05-18 11:52:05 +00:00
JOIN tmp.itemAvailable a ON a.id = i.id
JOIN vn.origin o ON o.id = i.originFk
JOIN vn.originL10n l ON l.id = o.id
WHERE #filter
2022-10-13 15:01:18 +00:00
ORDER BY name;
DROP TEMPORARY TABLE tmp.itemAvailable;
</db-model>
2022-06-06 08:53:59 +00:00
</htk-combo>
<htk-combo
placeholder="_Category"
2022-06-06 08:53:59 +00:00
form="params"
column="category"
2022-06-18 21:04:34 +00:00
on-mousedown="categorys.lazyRefresh()">
2022-06-06 08:53:59 +00:00
<db-model
id="categorys"
property="model"
auto-load="false"
result-index="1">
2023-02-15 13:07:09 +00:00
CALL myOrder_getAvailable(#orderId);
SELECT DISTINCT i.category, i.category
FROM vn.item i
JOIN vn.itemType t ON t.id = i.typeFk
2018-05-18 11:52:05 +00:00
JOIN tmp.itemAvailable a ON a.id = i.id
WHERE #filter
2022-10-13 15:01:18 +00:00
ORDER BY category;
DROP TEMPORARY TABLE tmp.itemAvailable;
</db-model>
2022-06-06 08:53:59 +00:00
</htk-combo>
</div>
<div id="order" class="order">
<h2><t>Order by</t></h2>
<select on-change="onOrderChange">
2017-06-07 14:46:58 +00:00
<option value="D|relevancy" selected="true">
2017-06-07 12:19:20 +00:00
<t>Relevancy</t>
</option>
<option value="A|item">
<t>Name</t>
</option>
<option value="A|price">
<t>Lower price</t>
</option>
<option value="D|price">
<t>Higher price</t>
</option>
<option value="A|available">
<t>Available</t>
</option>
<option value="A|size">
<t>Lower size</t>
</option>
<option value="D|size">
<t>Higher size</t>
</option>
2020-08-13 08:21:59 +00:00
<option value="A|ink">
<t>Color</t>
</option>
<option value="A|producer">
<t>Producer</t>
</option>
<option value="A|origin">
<t>Origin</t>
</option>
<option value="A|category">
<t>Category</t>
</option>
</select>
</div>
2015-10-14 11:51:43 +00:00
</div>
2015-03-06 23:33:54 +00:00
</div>
<htk-popup id="desc-popup">
<div
property="child-node"
class="desc-popup"
id="description"/>
</htk-popup>
2016-05-04 14:36:51 +00:00
<htk-popup
id="card-popup"
class="card-popup"
modal="true"
on-closed="onPopupClose">
<div property="child-node" class="item-card">
2022-06-18 21:04:34 +00:00
<db-form vModel="extendedCard">
<db-model
property="model"
2022-05-30 01:30:33 +00:00
lot="card-lot"
on-status-changed-after="onCardLoad">
SELECT i.description, o.name origin
FROM vn.item i
LEFT JOIN vn.originL10n o ON o.id = i.originFk
WHERE i.id = #item
</db-model>
</db-form>
2016-05-04 14:36:51 +00:00
<div class="top">
<htk-image
directory="catalog"
subdir="200x200"
2022-06-18 21:04:34 +00:00
form="$card"
column="image"
2019-05-27 13:38:06 +00:00
stamp-column="updated"
full-dir="1600x900"
2016-10-11 14:45:10 +00:00
conn="conn"
2016-05-04 14:36:51 +00:00
editable="true"/>
<div class="item-info">
2022-06-18 21:04:34 +00:00
<h2>{{card.item}}</h2>
<p class="sub-name">{{card.subName}}</p>
<p class="item-id">#{{card.id}}</p>
2022-06-18 21:04:34 +00:00
<p>{{Vn.Value.format(card.stems, _('%.0d Units'))}}</p>
2016-05-04 14:36:51 +00:00
</div>
2022-06-18 21:04:34 +00:00
<p class="desc">{{extendedCard.description}}</p>
<htk-repeater show-status="false" form-id="tag" class="item-tags">
2018-03-27 14:35:53 +00:00
<db-model
property="model"
2022-05-30 01:30:33 +00:00
lot="card-lot"
2018-03-27 14:35:53 +00:00
on-status-changed-after="onCardLoad">
SELECT l.name, it.value
FROM vn.itemTag it
JOIN vn.tag t ON t.id = it.tagFk
JOIN vn.tagL10n l ON l.id = t.id
WHERE it.itemFk = #item
AND priority >= 0
ORDER BY it.priority
2018-03-27 14:35:53 +00:00
</db-model>
<custom>
<tr>
2022-06-18 21:04:34 +00:00
<td>{{tag.name}}</td>
<td>{{tag.value}}</td>
</tr>
2018-03-27 14:35:53 +00:00
</custom>
</htk-repeater>
2023-10-09 18:20:01 +00:00
<div id="card-min-quantity" class="min-quantity" title="_MinimalQuantity">
2023-10-09 17:51:59 +00:00
<span class="htk-icon material-symbols-rounded">
production_quantity_limits
</span>
{{card.minQuantity}}
2023-10-09 17:51:59 +00:00
</div>
2016-05-04 14:36:51 +00:00
</div>
<htk-grid class="lots-grid" show-header="false">
<db-model
id="item-lots"
property="model"
result-index="1"
on-status-changed-after="onCardLoad"
2022-05-30 01:30:33 +00:00
lot="card-lot">
2023-02-15 13:07:09 +00:00
CALL myOrder_calcCatalogFromItem(#orderId, #item);
2019-09-16 08:09:41 +00:00
SELECT l.warehouseFk, w.name warehouse, p.`grouping`,
p.price, p.priceKg, p.rate, l.available
2019-06-05 07:05:54 +00:00
FROM tmp.ticketLot l
JOIN tmp.ticketComponentPrice p ON p.warehouseFk = l.warehouseFk
JOIN vn.warehouse w ON w.id = p.warehouseFk
2019-03-01 14:17:50 +00:00
ORDER BY warehouseFk, `grouping`;
2022-10-13 15:01:18 +00:00
DROP TEMPORARY TABLE
tmp.ticketCalculateItem,
tmp.ticketComponentPrice,
tmp.ticketComponent,
tmp.ticketLot,
tmp.zoneGetShipped;
</db-model>
2019-09-16 08:09:41 +00:00
<htk-column-spin column="price" unit="€" digits="2"/>
<htk-column-spin column="priceKg" unit="€/kg" digits="3" class="price-kg"/>
<htk-column-text column="grouping" format="x%.0d"/>
<htk-column-button
column="id"
2016-09-26 09:28:47 +00:00
icon="add"
tip="_Add"
on-clicked="onAddLotClick"/>
</htk-grid>
<div class="footer">
2022-05-26 06:08:31 +00:00
<button
title="_Erase"
on-click="this.onEraseClick()"
class="erase">
2016-09-26 09:28:47 +00:00
<htk-icon
2022-05-21 21:31:56 +00:00
name="delete"
2016-09-26 09:28:47 +00:00
theme="dark"
alt="_Erase"/>
</button>
<htk-text id="amount"/>
2022-05-26 06:08:31 +00:00
<button
title="_Confirm"
on-click="this.onConfirmClick()"
class="confirm">
2016-09-26 09:28:47 +00:00
<htk-icon
2022-05-21 21:31:56 +00:00
name="done"
2016-09-26 09:28:47 +00:00
theme="dark"
alt="_Confirm"/>
</button>
</div>
</div>
</htk-popup>
2015-03-06 23:33:54 +00:00
</vn>