0
1
Fork 0
hedera-web-mindshore/forms/ecomerce/catalog/ui.xml

471 lines
13 KiB
XML
Raw Normal View History

2015-03-06 23:33:54 +00:00
<vn>
<vn-group>
2016-05-04 14:36:51 +00:00
<vn-param id="card-item"/>
<vn-param id="realm" on-changed="onRealmChange"/>
2015-11-09 08:14:33 +00:00
<vn-param id="type" on-changed="onTypeChange"/>
<vn-param id="search" on-changed="onFilterChange"/>
<vn-param id="color" on-changed="onFilterChange"/>
<vn-param id="origin" on-changed="onFilterChange"/>
<vn-param id="category" on-changed="onFilterChange"/>
<vn-param id="producer" on-changed="onFilterChange"/>
<vn-hash-param key="realm" param="realm"/>
<vn-hash-param key="type" param="type"/>
2015-03-06 23:33:54 +00:00
<sql-filter type="AND" id="filter">
2015-11-19 13:57:23 +00:00
<sql-filter-item type="EQUAL" primary="false" id="op-realm">
<sql-field target="t" name="categoryFk"/>
<sql-value id="realm-value"/>
2015-03-06 23:33:54 +00:00
</sql-filter-item>
<sql-filter-item type="EQUAL" id="op-type">
<sql-field target="i" name="typeFk"/>
<sql-value id="type-value"/>
2015-11-19 13:57:23 +00:00
</sql-filter-item>
<sql-filter-item type="LIKE" id="op-name">
<sql-field target="i" name="longName"/>
2015-03-06 23:33:54 +00:00
<sql-search-tags param="search"/>
</sql-filter-item>
<sql-filter-item type="EQUAL" id="op-color">
<sql-field target="i" name="inkFk"/>
<sql-value param="color"/>
</sql-filter-item>
<sql-filter-item type="EQUAL" id="op-origin">
<sql-field target="i" name="originFk"/>
<sql-value param="origin"/>
</sql-filter-item>
<sql-filter-item type="EQUAL" id="op-category">
<sql-field target="i" name="category"/>
<sql-value param="category"/>
</sql-filter-item>
<sql-filter-item type="EQUAL" id="op-producer">
<sql-field target="i" name="producerFk"/>
<sql-value param="producer"/>
</sql-filter-item>
2015-03-06 23:33:54 +00:00
</sql-filter>
2016-05-04 14:36:51 +00:00
<db-form id="basket" on-ready="onBasketReady">
<db-model property="model">
SELECT b.id, b.sent, a.description agency, m.code method
FROM myBasket b
JOIN vn.agencyMode a ON a.id = b.agencyModeFk
JOIN vn.deliveryMethod m ON m.id = b.deliveryMethodFk
2016-05-04 14:36:51 +00:00
</db-model>
</db-form>
<db-model
id="items-model"
result-index="2"
on-status-changed="onItemsChange">
CREATE TEMPORARY TABLE tmp.bionic_calc
2018-03-27 14:35:53 +00:00
(INDEX (item_id))
ENGINE = MEMORY
SELECT i.id item_id
FROM vn.item i
JOIN vn.itemType t ON t.id = i.typeFk
WHERE #filter;
CALL bionic_calc;
SELECT i.id, i.description, i.image, i.longName item,
i.subName, i.tag5, i.value5, i.tag6, i.value6, i.tag7, i.value7,
b.available, b.price
FROM tmp.bionic_item b
JOIN vn.item i ON i.id = b.item_id
WHERE b.available > 0
ORDER BY i.relevancy DESC, i.name, i.size
LIMIT 400;
2015-11-19 13:57:23 +00:00
<sql-batch property="batch" id="filter-batch">
<custom>
<item name="filter" object="filter"/>
</custom>
2015-07-07 15:27:47 +00:00
</sql-batch>
</db-model>
2016-05-04 14:36:51 +00:00
<db-form id="card" model="items-model"/>
<sql-batch id="card-batch">
<custom>
<item name="item" param="card-item"/>
</custom>
</sql-batch>
2015-03-06 23:33:54 +00:00
</vn-group>
<div id="title">
<h1 id="title-text"><t>Catalog</t></h1>
</div>
2015-09-16 16:11:15 +00:00
<div id="actions" class="catalog-actions">
<button class="menu" on-click="onShowMenuClick">
2016-09-19 06:40:18 +00:00
<img src="image/icon/dark/menu.svg" alt="_Menu"/>
</button>
2016-09-19 06:40:18 +00:00
<htk-bar-button
icon="basket"
2015-09-16 16:11:15 +00:00
tip="_ShoppingBasket"
2016-09-19 06:40:18 +00:00
on-click="onBasketClick"/>
<htk-bar-button
id="view-button"
tip="_Switch view"
2016-09-19 06:40:18 +00:00
on-click="onSwitchViewClick"/>
<htk-search-entry
param="search"/>
</div>
2015-03-06 23:33:54 +00:00
<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"
model="items-model">
<custom>
<div class="box item-box">
2016-05-02 13:05:49 +00:00
<htk-image
directory="catalog"
subdir="200x200"
form="item"
column="image"
full-dir="1600x900"/>
<div class="item-info">
<htk-button
form="item"
2015-07-07 15:27:47 +00:00
column="id"
tip="_AddToBasket"
2016-09-19 06:40:18 +00:00
icon="add"
2016-05-04 14:36:51 +00:00
on-click="onAddItemClick"
class="add-button"/>
<h2>
<htk-text form="item" column="item"/>
</h2>
<p class="sub-name">
<htk-text form="item" column="subName"/>
</p>
<table class="tags">
<tr>
<td><htk-text form="item" column="tag5"/></td>
<td><htk-text form="item" column="value5"/></td>
</tr>
<tr class="extra">
<td><htk-text form="item" column="tag6"/></td>
<td><htk-text form="item" column="value6"/></td>
</tr>
<tr class="extra">
<td><htk-text form="item" column="tag7"/></td>
<td><htk-text form="item" column="value7"/></td>
</tr>
</table>
2016-05-04 14:36:51 +00:00
<div class="aval-price">
<htk-text form="item" column="available"/>
<span class="from">
<t>from</t>
</span>
<span class="price">
<htk-text form="item" column="price" format="%.2d€"/>
</span>
</div>
</div>
2015-03-06 23:33:54 +00:00
</div>
</custom>
</htk-repeater>
2015-03-06 23:33:54 +00:00
</div>
</div>
2015-09-16 16:11:15 +00:00
<div id="right-panel" class="right-panel" on-click="onRightPanelClick">
<div class="basket-info">
<p>
<htk-text form="basket" column="sent" format="%D"/>
</p>
<p>
2015-12-10 13:48:43 +00:00
<span id="method"/>
<htk-text form="basket" column="agency"/>
</p>
2015-12-10 13:48:43 +00:00
<button class="thin" on-click="onConfigureClick">
2015-12-10 23:24:14 +00:00
<t>Change</t>
2015-12-10 13:48:43 +00:00
</button>
</div>
<div class="filter">
<div class="categories">
<div class="realms">
<htk-repeater
model="realms-model"
form-id="realm-form"
renderer="realmRenderer"
class="realms-box">
<db-model
id="realms-model"
property="model"
on-status-changed="refreshTitleColor">
SELECT c.id, l.name, c.color
FROM vn.itemCategory c
JOIN vn.itemCategoryL10n l ON l.id = c.id
WHERE c.display
ORDER BY name
</db-model>
<custom>
<a id="link">
<img id="image"/>
</a>
</custom>
</htk-repeater>
<div class="clear"/>
</div>
</div>
<div id="realm-msg" class="realm-msg">
<h1><t>Choose a realm</t></h1>
</div>
<div id="filters" class="filters">
<h2><t>Filter by</t></h2>
<vn-filter
placeholder="_Family"
param="type">
<db-model
id="types-model"
property="model"
conn="conn"
result-index="1"
on-status-changed="refreshTitle">
2018-05-18 11:52:05 +00:00
CALL itemGetAvailable;
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
WHERE #filter
ORDER BY name
</db-model>
<sql-filter property="filter" type="AND">
<sql-filter-item type="EQUAL">
<sql-field name="categoryFk" target="t"/>
<sql-value param="realm"/>
</sql-filter-item>
</sql-filter>
</vn-filter>
<vn-filter
placeholder="_Color"
param="color">
<db-model property="model" auto-load="false" result-index="1">
2018-05-18 11:52:05 +00:00
CALL itemGetAvailable;
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
ORDER BY name
</db-model>
<sql-filter property="filter" always-ready="true" type="AND">
<pointer object="op-realm"/>
<pointer object="op-type"/>
<pointer object="op-name"/>
<pointer object="op-origin"/>
<pointer object="op-category"/>
<pointer object="op-producer"/>
</sql-filter>
</vn-filter>
<vn-filter
placeholder="_Producer"
param="producer">
<db-model property="model" auto-load="false" result-index="1">
2018-05-18 11:52:05 +00:00
CALL itemGetAvailable;
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
ORDER BY name
</db-model>
<sql-filter property="filter" always-ready="true" type="AND">
<pointer object="op-realm"/>
<pointer object="op-type"/>
<pointer object="op-name"/>
<pointer object="op-origin"/>
<pointer object="op-color"/>
<pointer object="op-category"/>
</sql-filter>
</vn-filter>
<vn-filter
placeholder="_Origin"
param="origin">
<db-model property="model" auto-load="false" result-index="1">
2018-05-18 11:52:05 +00:00
CALL itemGetAvailable;
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
ORDER BY name
</db-model>
<sql-filter property="filter" always-ready="true" type="AND">
<pointer object="op-realm"/>
<pointer object="op-type"/>
<pointer object="op-name"/>
<pointer object="op-color"/>
<pointer object="op-category"/>
<pointer object="op-producer"/>
</sql-filter>
</vn-filter>
<vn-filter
placeholder="_Category"
param="category">
<db-model property="model" auto-load="false" result-index="1">
2018-05-18 11:52:05 +00:00
CALL itemGetAvailable;
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
ORDER BY category
</db-model>
<sql-filter property="filter" always-ready="true" type="AND">
<pointer object="op-realm"/>
<pointer object="op-type"/>
<pointer object="op-name"/>
<pointer object="op-color"/>
<pointer object="op-origin"/>
<pointer object="op-producer"/>
</sql-filter>
</vn-filter>
</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>
<option value="A|color">
<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">
<db-form id="card-extend">
<db-model
property="model"
batch="card-batch"
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"
form="card"
column="image"
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">
<h2>
<htk-text form="card" column="item"/>
2016-05-04 14:36:51 +00:00
</h2>
<p class="sub-name">
<htk-text form="card" column="subName"/>
2016-05-04 14:36:51 +00:00
</p>
<p>
2018-04-09 12:43:21 +00:00
@<htk-text form="card" column="id"/>
</p>
2016-05-04 14:36:51 +00:00
<p>
2018-03-27 14:35:53 +00:00
<htk-text form="card" column="stems" format="_%.0d Units"/>
2016-05-04 14:36:51 +00:00
</p>
</div>
<p class="desc">
<htk-text form="card-extend" column="description" id="desc"/>
</p>
2018-03-27 14:35:53 +00:00
<htk-repeater show-status="false" form-id="tag" class="tags">
<db-model
property="model"
batch="card-batch"
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>
<td><htk-text form="tag" column="name"/></td>
<td><htk-text form="tag" column="value"/></td>
</tr>
2018-03-27 14:35:53 +00:00
</custom>
</htk-repeater>
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"
batch="card-batch">
CALL bionic_from_item (#item);
SELECT w.id warehouseFk, w.name warehouse, p.grouping, p.price, p.rate, l.available
FROM tmp.bionic_lot l
JOIN tmp.bionic_price p ON p.warehouse_id = l.warehouse_id
JOIN vn.warehouse w ON w.id = p.warehouse_id
ORDER BY warehouseFk, grouping;
</db-model>
<htk-column-text title="_Store" column="warehouse"/>
<htk-column-spin title="_Price" column="price" unit="€" digits="2"/>
<htk-column-text title="_Pack" 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">
<button on-click="onEraseClick" title="_Erase" class="erase">
2016-09-26 09:28:47 +00:00
<htk-icon
icon="delete"
theme="dark"
alt="_Erase"/>
</button>
<htk-text id="amount"/>
<button on-click="onConfirmClick" title="_Confirm" class="confirm">
2016-09-26 09:28:47 +00:00
<htk-icon
icon="ok"
theme="dark"
alt="_Confirm"/>
</button>
<div class="clear"/>
</div>
</div>
</htk-popup>
2015-03-06 23:33:54 +00:00
</vn>