diff --git a/debian/changelog b/debian/changelog
index 3ce35a76..7461d478 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-hedera-web (1.328-deb8) stable; urgency=low
+hedera-web (1.337-deb8) stable; urgency=low
* Initial Release.
diff --git a/web/forms/ecomerce/basket/style.css b/web/forms/ecomerce/basket/style.css
index c250a813..7893b0dc 100644
--- a/web/forms/ecomerce/basket/style.css
+++ b/web/forms/ecomerce/basket/style.css
@@ -52,6 +52,7 @@
float: left;
border-radius: 50%;
height: 3.2em;
+ width: 3.2em;
}
.basket .line > p
{
diff --git a/web/forms/ecomerce/basket/ui.xml b/web/forms/ecomerce/basket/ui.xml
index 629c3036..7fba5f82 100755
--- a/web/forms/ecomerce/basket/ui.xml
+++ b/web/forms/ecomerce/basket/ui.xml
@@ -55,7 +55,6 @@
class="photo"
directory="catalog"
subdir="200x200"
- show-full="true"
full-dir="900x900"/>
diff --git a/web/forms/ecomerce/catalog/catalog.js b/web/forms/ecomerce/catalog/catalog.js
index 9117a6db..076f7077 100644
--- a/web/forms/ecomerce/catalog/catalog.js
+++ b/web/forms/ecomerce/catalog/catalog.js
@@ -87,12 +87,6 @@ Vn.Catalog = new Class
Vn.Node.setText (this.$('method'), _('Warehouse'));
}
- ,typeRenderer: function (builder, form)
- {
- var link = builder.$('link');
- link.href = this.hash.make ({'type': form.get ('tipo_id')}, true);
- }
-
,onItemsChange: function (model, status)
{
if (status !== Db.Model.Status.CLEAN)
@@ -241,98 +235,42 @@ Vn.Catalog = new Class
this.hideMenuCallback = null;
}
- ,onBasketClick: function ()
- {
- if (!Vn.Cookie.check ('hedera_guest'))
- this.hash.set ({'form': 'ecomerce/basket'});
- else
- Htk.Toast.showError (_('YouMustBeLoggedIn'));
- }
-
- ,onConfigureClick: function ()
- {
- if (!Vn.Cookie.check ('hedera_guest'))
- this.hash.set ({'form': 'ecomerce/checkout'});
- else
- Htk.Toast.showError (_('YouMustBeLoggedIn'));
- }
-
- ,nameRenderer: function (renderer, form)
- {
- renderer.subtitle = form.get ('producer');
- }
-
- ,amountRender: function (renderer, form)
- {
- var amount = form.get ('amount');
- var grouping = form.get ('grouping');
-
- if (amount && grouping)
- renderer.value = amount / grouping;
- else
- renderer.value = null;
- }
-
- ,amountChanged: function (renderer, row, newValue)
- {
- var model = this.$('items-model');
- model.set (row, 'amount', newValue * model.get (row, 'grouping'));
- }
-
- ,catRenderer: function (column, form)
- {
- switch (form.get ('Categoria'))
- {
- case 'A2':
- column.td.className = 'second-category';
- break;
- case 'B1':
- column.td.className = 'third-category';
- break;
- default:
- column.td.className = '';
- }
- }
-
- ,onInfoClick: function (button, form)
- {
- var descNode = this.$('description');
- Vn.Node.removeChilds (descNode);
-
- var desc = form.get ('description');
-
- if (!desc)
- desc = _('No info available');
-
- descNode.appendChild (document.createTextNode (desc));
-
- this.$('desc-popup').show (button.getNode ());
- }
-
- ,onGridAddItemClick: function (button, form)
- {
- this.showAmountPopup (button.getNode (), form.row);
- }
-
- ,onAddItemClick: function (column, value, row, button)
- {
- this.showAmountPopup (button, row);
- }
-
- ,showAmountPopup: function (button, row)
+ ,isGuest: function ()
{
if (Vn.Cookie.check ('hedera_guest'))
{
Htk.Toast.showError (_('YouMustBeLoggedIn'));
- return;
+ return true;
}
+
+ return false;
+ }
+
+ ,onBasketClick: function ()
+ {
+ if (this.isGuest ())
+ return;
- var itemId = this.$('items-model').get (row, 'item_id')
- this.$('lots-batch').addValue ('item', itemId);
+ this.hash.set ({'form': 'ecomerce/basket'});
+ }
+
+ ,onConfigureClick: function ()
+ {
+ if (this.isGuest ())
+ return;
+
+ this.hash.set ({'form': 'ecomerce/checkout'});
+ }
+
+ ,onAddItemClick: function (button, form)
+ {
+ if (this.isGuest ())
+ return;
- this.itemRow = row;
this.onEraseClick ();
- this.$('lots-popup').show (button);
+ this.$('card').row = form.row;
+ this.$('card-item').value = form.get ('item_id');
+ this.$('card-popup').show (button.getNode ());
}
,onAddLotClick: function (column, value, row, button)
@@ -361,16 +299,8 @@ Vn.Catalog = new Class
Htk.Toast.showError (_('NoMoreAmountAvailable'));
}
- ,onEraseClick: function ()
- {
- this.$('amount').value = 0;
- this.items = {};
- }
-
,onConfirmClick: function ()
{
- var model = this.$('items-model');
-
var sql = '';
var batch = new Sql.Batch ();
var query = new Sql.String ({query: 'CALL basket_item_add (#warehouse, #item, #amount);'});
@@ -382,7 +312,7 @@ Vn.Catalog = new Class
amountSum += amount;
batch.addValue ('warehouse', warehouse);
- batch.addValue ('item', model.get (this.itemRow, 'item_id'));
+ batch.addValue ('item', this.$('card-item').value);
batch.addValue ('amount', amount);
sql += query.render (batch);
}
@@ -391,26 +321,30 @@ Vn.Catalog = new Class
{
this.conn.execQuery (sql);
- var itemName = model.get (this.itemRow, 'Article');
+ var itemName = this.$('card').get ('Article');
Htk.Toast.showMessage (
sprintf (_('Added%dOf%s'), amountSum, itemName));
}
- this.$('lots-popup').hide ();
+ this.$('card-popup').hide ();
+ }
+
+ ,onEraseClick: function ()
+ {
+ this.$('amount').value = 0;
+ this.items = {};
+ }
+
+ ,onPopupClose: function ()
+ {
+ this.onEraseClick ();
+ this.$('card').row = -1;
+ this.$('card-item').value = undefined;
}
,onStatusChange: function (model)
{
- this.$('lots-popup').reset ();
- }
-
- ,gridRenderer: function (res, form)
- {
- if (!form.get ('description'))
- {
- var button = res.$('info-button').getNode ();
- button.style.display = 'none';
- }
+ this.$('card-popup').reset ();
}
});
@@ -597,32 +531,5 @@ Vn.Filter = new Class
this._label.nodeValue = _('Loading...');
}
}
-})
-
-Vn.ColumnItem = new Class
-({
- Extends: Htk.Column
- ,Tag: 'vn-column-item'
-
- ,render: function (tr)
- {
- var td = this.parent (tr);
- td.style.textAlign = 'left';
-
- if (this.value)
- {
- var node = document.createTextNode (
- Vn.Value.format (this.value, this._format));
- td.appendChild (node);
- }
-
- if (this.subtitle)
- {
- td.appendChild (document.createElement ('br'));
- td.appendChild (document.createTextNode (this.subtitle));
- }
-
- return td;
- }
-})
+});
diff --git a/web/forms/ecomerce/catalog/style.css b/web/forms/ecomerce/catalog/style.css
index 7e3de3c1..b94cc19e 100644
--- a/web/forms/ecomerce/catalog/style.css
+++ b/web/forms/ecomerce/catalog/style.css
@@ -7,7 +7,7 @@
.htk-toast
{
- margin-left: -11em;
+ margin-left: -10.5em;
}
/* Topbar */
@@ -150,71 +150,40 @@
margin-top: 1em;
}
-/* Item description */
-
-.desc-popup
-{
- padding: 1em;
- max-width: 15em;
-}
-
-/* Lots popup*/
-
-.lots-popup .footer
-{
- text-align: center;
- background-color: #009688;
- color: white;
- line-height: 2em;
- padding: .4em;
-}
-.lots-popup .footer > button
-{
- margin: 0;
-}
-.lots-popup .erase
-{
- float: left;
-}
-.lots-popup .confirm
-{
- float: right;
-}
-.lots-popup .erase > img,
-.lots-popup .confirm > img
-{
- display: block;
- height: 1em;
-}
-
/* Items */
-.catalog .second-category
+.item-info
+{
+ position: relative;
+}
+.item-info .second-category
{
font-weight: bold;
color: orange;
}
-.catalog .third-category
+.item-info .third-category
{
font-weight: bold;
color: red;
}
-.catalog .price
+.item-info .from
+{
+ font-size: .8em;
+ font-style: italic;
+}
+.item-info .price
{
color: green;
font-size: 1.1em;
}
-.catalog .footer-message
-{
- padding-bottom: 1em;
- text-align: center;
-}
-.catalog .item-info > h2
+.item-info > h2
{
+ padding: 0;
+ padding-bottom: .1em;
font-weight: normal;
font-size: 1.1em;
}
-.catalog .item-info > p
+.item-info > p
{
margin: 0;
padding: 0;
@@ -224,11 +193,18 @@
white-space: nowrap;
overflow: hidden;
}
-.catalog .item-info > .producer
+.item-info .producer
{
text-transform: uppercase;
font-weight: bold;
- padding: .15em 0;
+ padding: 0;
+ padding-bottom: .2em;
+ font-size: 1em;
+}
+.item-info > .aval-price
+{
+ position: absolute;
+ bottom: 0;
}
.catalog .item-info > .htk-button
{
@@ -239,10 +215,72 @@
{
vertical-align: middle;
}
-.catalog .item-info .from
+
+/* Card */
+
+
+.card-popup
{
- font-size: .8em;
- font-style: italic;
+ overflow: auto;
+}
+.item-card
+{
+ font-size: .9em;
+ width: 20em;
+}
+.item-card .top
+{
+ padding: 1em;
+ border-bottom: 1px solid #DDD;
+}
+.item-card .item-info
+{
+ margin-left: 9em;
+ height: 8em;
+}
+.item-card .htk-image
+{
+ height: 8em;
+ width: 8em;
+ float: left;
+ border-radius: .3em;
+}
+.item-card .desc
+{
+ clear: both;
+ margin: 0;
+ margin-top: 1em;
+ font-size: .9em;
+}
+.item-card .lots-grid tr
+{
+ height: 3em;
+}
+.item-card .footer
+{
+ text-align: center;
+ background-color: #009688;
+ color: white;
+ line-height: 2em;
+ padding: .4em;
+}
+.item-card .footer > button
+{
+ margin: 0;
+}
+.item-card .erase
+{
+ float: left;
+}
+.item-card .confirm
+{
+ float: right;
+}
+.item-card .erase > img,
+.item-card .confirm > img
+{
+ display: block;
+ height: 1em;
}
/* List view */
@@ -288,7 +326,6 @@
.list-view .item-info > h2
{
font-size: 1em;
- padding: 0;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
@@ -299,8 +336,6 @@
}
.list-view .item-info > .aval-price
{
- position: absolute;
- bottom: 0;
right: .3em;
}
.list-view .item-info > .htk-button
@@ -348,14 +383,8 @@
bottom: 0;
margin: .6em;
}
-.grid-view .item-info > h2
-{
- padding-top: 0;
-}
.grid-view .item-info > .aval-price
{
- position: absolute;
- bottom: 0;
right: 2.8em;
}
.grid-view .item-info .add-button
diff --git a/web/forms/ecomerce/catalog/ui.xml b/web/forms/ecomerce/catalog/ui.xml
index a667114d..660b435c 100755
--- a/web/forms/ecomerce/catalog/ui.xml
+++ b/web/forms/ecomerce/catalog/ui.xml
@@ -1,5 +1,6 @@
+
@@ -39,6 +40,16 @@
+
+
+
+ SELECT o.id, o.date_send, ag.description agency, v.code method
+ FROM basket o
+ JOIN vn2008.Agencias ag ON ag.Id_Agencia = o.agency_id
+ JOIN vn2008.Vistas v ON v.vista_id = o.delivery_method_id
+
+
+
SELECT item_id, warehouse_id, SUM(amount) amount
@@ -46,7 +57,10 @@
GROUP BY warehouse_id
-
+
CREATE TEMPORARY TABLE tmp.bionic_calc
(INDEX (item_id))
@@ -56,8 +70,8 @@
WHERE #filter;
CALL bionic_calc ();
SELECT a.Id_Article item_id, a.description, b.available, b.price,
- p.name producer, a.Foto, a.Article, a.Categoria, a.Medida,
- IF(a.Tallos > 1, a.Tallos, NULL) Tallos, c.str color, o.str origin
+ b.producer, a.Foto, a.Article, a.Categoria, a.Medida,
+ IF(a.Tallos > 1, a.Tallos, NULL) Tallos, c.str color
FROM tmp.bionic_item b
JOIN vn2008.Articles a ON a.Id_Article = b.item_id
LEFT JOIN vn2008.producer p ON p.producer_id = a.producer_id
@@ -73,7 +87,30 @@
-
+
+
+
+
+
+
+
+
+
+ SELECT a.description, o.str origin
+ FROM vn2008.Articles a
+ LEFT JOIN vn_locale.origin_view o ON o.origin_id = a.id_origen
+ WHERE a.Id_Article = #item
+
+
+
+
CALL bionic_from_item (#item);
SELECT p.warehouse_id, w.name warehouse, p.grouping, p.price, p.rate, l.available
@@ -82,18 +119,7 @@
JOIN vn2008.warehouse w ON w.id = p.warehouse_id
ORDER BY warehouse_id, grouping;
-
-
-
-
- SELECT o.id, o.date_send, ag.description agency, v.code method
- FROM basket o
- JOIN vn2008.Agencias ag ON ag.Id_Agencia = o.agency_id
- JOIN vn2008.Vistas v ON v.vista_id = o.delivery_method_id
-
-
-
Catalog
@@ -122,7 +148,6 @@
id="grid-view"
empty-message="_Choose filter from right menu"
form-id="item"
- renderer="gridRenderer"
model="items-model">
@@ -131,33 +156,15 @@
subdir="200x200"
form="item"
column="Foto"
- full-dir="900x900"
- editable="true"/>
+ full-dir="900x900"/>
-
-
-
-
- from
-
-
-
-
-
@@ -172,6 +179,15 @@
Color
+
+
+
+ from
+
+
+
+
+
@@ -393,8 +409,43 @@
class="desc-popup"
id="description"/>
-