diff --git a/debian/changelog b/debian/changelog index 051cda79..47c5f3be 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (1.315-deb8) stable; urgency=low +hedera-web (1.316-deb8) stable; urgency=low * Initial Release. diff --git a/debian/conf/config.php b/debian/conf/config.php index b59b22a8..1ee3ec59 100755 --- a/debian/conf/config.php +++ b/debian/conf/config.php @@ -1,6 +1,17 @@ config.www.php + * - http://test.mydomain.org -> config.test.php **/ $conf = [ @@ -9,16 +20,12 @@ $conf = [ **/ 'db' => [ 'host' => 'db.verdnatura.es' + ,'port' => 3306 ,'schema' => 'hedera-web' ,'user' => 'hedera-web' ,'pass' => 'base64pass' ] -/** - * The default language. - **/ -,'defaultLang' => 'es' - ]; ?> diff --git a/lib/vn/hedera/init.php b/lib/vn/hedera/init.php index cddca06c..7706960c 100644 --- a/lib/vn/hedera/init.php +++ b/lib/vn/hedera/init.php @@ -8,7 +8,7 @@ if (!defined (__NAMESPACE__.'\_DEVELOPER_MODE')) define (__NAMESPACE__.'\_LOG_DIR', '/var/log'); } -require_once (_CONFIG_DIR .'/config.php'); +$conf = NULL; ini_set ('log_errors', TRUE); ini_set ('error_log', 'syslog'); diff --git a/lib/vn/hedera/web.php b/lib/vn/hedera/web.php index b9b0f701..235d34e7 100755 --- a/lib/vn/hedera/web.php +++ b/lib/vn/hedera/web.php @@ -16,12 +16,13 @@ class Web { static $sysConn = NULL; static $conn = NULL; + static $confIncluded = FALSE; /** * Initializes the Hedera web library. **/ static function init () - { + { if (self::isHttps ()) ini_set ('session.cookie_secure', TRUE); @@ -83,6 +84,8 @@ class Web { global $conf; + self::includeConf (); + if (self::$sysConn) return; @@ -109,9 +112,41 @@ class Web return (int) filectime (__FILE__); } + /** + * Includes the configuration file. + **/ + static function includeConf () + { + global $conf; + + if (self::$confIncluded) + return; + + $customFile = _CONFIG_DIR .'/config.my.php'; + + if (!empty ($_SERVER['SERVER_NAME']) + && preg_match ('/^[\w\-\.]+$/', $_SERVER['SERVER_NAME'])) + { + $hostSplit = explode ('.', $_SERVER['SERVER_NAME']); + $hostFile = _CONFIG_DIR .'/config.'. $hostSplit[0] .'.php'; + } + + if (isset ($hostFile) && file_exists ($hostFile)) + $confFile = $hostFile; + elseif (file_exists ($customFile)) + $confFile = $customFile; + else + $confFile = _CONFIG_DIR .'/config.php'; + + require ($confFile); + self::$confIncluded = TRUE; + } + static function login () { global $conf; + + self::includeConf (); $wasLoged = Auth::isLogged (); $useCookies = TRUE; diff --git a/lib/vn/tpv/tpv.php b/lib/vn/tpv/tpv.php index 5369c51e..2ec5035b 100755 --- a/lib/vn/tpv/tpv.php +++ b/lib/vn/tpv/tpv.php @@ -193,14 +193,13 @@ class Tpv try { return self::$conn->query ( - 'CALL transaction_confirm_with_check (#, #, #, #, #, #, #)', + 'CALL transaction_confirm (#, #, #, #, #, #, #)', [ $params['Ds_Amount'] ,$params['Ds_Order'] ,$params['Ds_MerchantCode'] ,$params['Ds_Currency'] ,$params['Ds_Response'] - ,$params['Ds_Signature'] ,$error ] ); diff --git a/web/forms/account/address/ui.xml b/web/forms/account/address/ui.xml index 3a1d8ce6..c8a7f77d 100755 --- a/web/forms/account/address/ui.xml +++ b/web/forms/account/address/ui.xml @@ -28,16 +28,16 @@

AddEditAddress

- +
diff --git a/web/forms/admin/connections/ui.xml b/web/forms/admin/connections/ui.xml index 6e8a7880..12e26d2e 100755 --- a/web/forms/admin/connections/ui.xml +++ b/web/forms/admin/connections/ui.xml @@ -3,6 +3,11 @@

Connections

+
connections
-
diff --git a/web/forms/cms/home/style.css b/web/forms/cms/home/style.css index 8f75629b..a3e7f890 100755 --- a/web/forms/cms/home/style.css +++ b/web/forms/cms/home/style.css @@ -9,7 +9,7 @@ .action-bar button.start-order { background-color: #EF5350; - margin: .7em .4em; + margin: .7em; padding: .5em; box-shadow: 0 0 0.4em rgba(1, 1, 1, 0.4); } diff --git a/web/forms/cms/home/ui.xml b/web/forms/cms/home/ui.xml index 1189ba9b..13cc1f3f 100755 --- a/web/forms/cms/home/ui.xml +++ b/web/forms/cms/home/ui.xml @@ -25,10 +25,12 @@

-
+ --> +
diff --git a/web/forms/ecomerce/basket/ui.xml b/web/forms/ecomerce/basket/ui.xml index c8d57f0f..7c2d4f40 100755 --- a/web/forms/ecomerce/basket/ui.xml +++ b/web/forms/ecomerce/basket/ui.xml @@ -4,9 +4,9 @@
diff --git a/web/forms/ecomerce/catalog/catalog.js b/web/forms/ecomerce/catalog/catalog.js index c98a68b7..5a3589ab 100755 --- a/web/forms/ecomerce/catalog/catalog.js +++ b/web/forms/ecomerce/catalog/catalog.js @@ -31,9 +31,6 @@ Vn.Catalog = new Class ,activate: function () { document.body.appendChild (this.$('right-panel')); - - this.popup = new Htk.Popup (); - this.popup.setChildNode (this.$('lots-popup')); this.$('items-model').setInfo ('a', 'Articles', 'vn2008', ['item_id']); @@ -66,12 +63,20 @@ Vn.Catalog = new Class if (view === Vn.Catalog.View.GRID) { + this.$('view-button').setProperties ({ + image: 'image/dark/view-list.svg', + tip: _('List view') + }); this.view = Vn.Catalog.View.GRID; this.viewNode = this.$('grid-view').getNode (); this.viewHolder = this.$('grid-view'); } else { + this.$('view-button').setProperties ({ + image: 'image/dark/view-grid.svg', + tip: _('Grid view') + }); this.view = Vn.Catalog.View.LIST; this.viewNode = this.$('list-view'); this.viewHolder = this.$('items-grid'); @@ -96,6 +101,25 @@ Vn.Catalog = new Class link.href = this.hash.make ({'type': form.get ('tipo_id')}, true); } + ,onItemsChange: function (model, status) + { + if (status !== Db.Model.Status.CLEAN) + this.$('order').style.display = 'block'; + else + this.$('order').style.display = 'none'; + } + + ,onOrderChange: function (e) + { + var value = e.target.value; + var sortField = value.substr (2); + var sortWay = value.charAt (0) === 'A' ? + Db.Model.SortWay.ASC : Db.Model.SortWay.DESC; + + if (sortField) + this.$('items-model').sortByName (sortField, sortWay); + } + ,realmRenderer: function (builder, form) { var link = builder.$('link'); @@ -105,17 +129,50 @@ Vn.Catalog = new Class }); var img = builder.$('image'); - img.src = 'image/family/'+ form.get ('id') +'.svg'; - img.title = form.get ('reino'); + img.src = 'image/family_dark/'+ form.get ('id') +'.svg'; + img.title = form.get ('name'); img.alt = img.title; } - - ,onTypeChange: function () + + ,onRealmChange: function (param, newValue) { - if (this.$('type').value) + if (newValue) + { + this.$('filters').style.display = 'block'; + this.$('realm-msg').style.display = 'none'; + } + else + { + this.$('filters').style.display = 'none'; + this.$('realm-msg').style.display = 'block'; + } + + this.refreshTitleColor (); + this.refreshFilter (newValue, undefined); + } + + ,onTypeChange: function (param, newValue) + { + if (newValue) this.hideMenu (); this.refreshTitle (); + this.refreshFilter (undefined, newValue); + } + + ,refreshFilter: function (realm, type) + { + var batch = this.$('filter-batch'); + batch.block (); + this.$('realm-value').value = realm; + this.$('type-value').value = type; + this.$('search').value = undefined; + this.$('color').value = undefined; + this.$('origin').value = undefined; + this.$('category').value = undefined; + this.$('producer').value = undefined; + batch.unblock (); + batch.changed (); } ,refreshTitleColor: function () @@ -241,19 +298,17 @@ Vn.Catalog = new Class ,onInfoClick: function (button, form) { - var descNode = this.$('desc-popup'); + var descNode = this.$('description'); Vn.Node.removeChilds (descNode); - var desc = this.$('items-model').get (form.row, 'description'); + var desc = form.get ('description'); if (!desc) desc = _('No info available'); descNode.appendChild (document.createTextNode (desc)); - var popup = new Htk.Popup (); - popup.setChildNode (descNode); - popup.show (button.getNode ()); + this.$('desc-popup').show (button.getNode ()); } ,onGridAddItemClick: function (button, form) @@ -279,7 +334,7 @@ Vn.Catalog = new Class this.itemRow = row; this.onEraseClick (); - this.popup.show (button); + this.$('lots-popup').show (button); } ,onAddLotClick: function (column, value, row, button) @@ -343,38 +398,12 @@ Vn.Catalog = new Class sprintf (_('Added%dOf%s'), amountSum, itemName)); } - this.popup.hide (); + this.$('lots-popup').hide (); } ,onStatusChange: function (model) { - if (this.popup) - this.popup.reset (); - } - - ,onOrderChange: function (e) - { - var sortField = e.target.value; - - if (sortField) - this.$('items-model').sortByName (sortField); - } - - ,onRemoveFiltersClick: function () - { - var batch = this.$('filter-batch'); - batch.block (); - - this.$('search').value = undefined; - this.$('realm').value = undefined; - this.$('type').value = undefined; - this.$('color').value = undefined; - this.$('origin').value = undefined; - this.$('category').value = undefined; - this.$('producer').value = undefined; - - batch.unblock (); - batch.changed (); + this.$('lots-popup').reset (); } ,gridRenderer: function (res, form) @@ -387,6 +416,14 @@ Vn.Catalog = new Class } }); +Vn.Catalog.extend +({ + View: { + LIST: 0, + GRID: 1 + } +}); + Vn.Filter = new Class ({ Extends: Htk.Field @@ -421,18 +458,6 @@ Vn.Filter = new Class return this._placeholder; } }, - column: - { - type: String - ,set: function (x) - { - this._column = x; - } - ,get: function () - { - return this._column; - } - }, filter: { type: Sql.Filter @@ -457,7 +482,7 @@ Vn.Filter = new Class this.node.className = 'vn-filter'; this._select = new Htk.Select (); - this._select.on ('mousedown', this._onClick, this); + this._select.on ('mousedown', this._onMouseDown, this); this._select.on ('changed', this._onChange, this); this._select.on ('ready', this._onReady, this); this.node.appendChild (this._select.getNode ()); @@ -469,7 +494,7 @@ Vn.Filter = new Class this.parent (props); } - ,_onClick: function (e) + ,_onMouseDown: function (e) { if (this._model && this._model.status === Db.Model.Status.CLEAN) this._model.refresh (); @@ -520,7 +545,7 @@ Vn.Filter = new Class ,putValue: function (value) { - this._onClick (); + this._onMouseDown (); this._realSetValue (value); } @@ -576,14 +601,6 @@ Vn.Filter = new Class } }) -Vn.Catalog.extend -({ - View: { - LIST: 0, - GRID: 1 - } -}); - Vn.ColumnItem = new Class ({ Extends: Htk.Column diff --git a/web/forms/ecomerce/catalog/style.css b/web/forms/ecomerce/catalog/style.css index 2543c6f1..3697ed10 100755 --- a/web/forms/ecomerce/catalog/style.css +++ b/web/forms/ecomerce/catalog/style.css @@ -5,10 +5,6 @@ /* Main */ -.catalog > .main -{ - padding: .5em; -} .htk-toast { margin-left: -11em; @@ -35,29 +31,19 @@ box-shadow: 0 0 .2em rgba(1, 1, 1, 0.4); overflow: auto; } -.right-panel > .body -{ - text-align: center; -} -.right-panel .section -{ - padding: 1.2em 2em; -} -.right-panel .section > button -{ - display: block; - margin: 0 auto; - margin-top: .4em; -} .right-panel .basket-info { - background-color: #00acc1; + background-color: #00ACC1; color: white; box-shadow: 0 .1em .1em rgba(1, 1, 1, 0.3); + padding: 1.2em 2em; } .right-panel .basket-info > button { - color: #e0f2f1; + color: #E0F2F1; + margin: 0 auto; + display: block; + margin-top: .4em; } .right-panel .basket-info > p { @@ -69,17 +55,67 @@ white-space: nowrap; overflow: hidden; } -.right-panel .filters +.right-panel .filter { + padding: 1em 1.8em; } -.right-panel .section > select, -.right-panel .section > .vn-filter +.right-panel .filters, +.right-panel .order { - margin-bottom: 1em; + display: none; } +.right-panel .realm-msg +{ + margin-top: 1em; +/* box-shadow: 0 0 .3em rgba(1, 1, 1, 0.5); + border-radius: 50%; + overflow: hidden;*/ +} +.right-panel .realm-msg > h1 +{ + font-weight: normal; + text-align: center; + padding: 2.5em 0; + color: #777; +/* background-color: #009688; + color: white;*/ +} +.right-panel h2 +{ + font-weight: normal; + padding: .4em 0; + color: #777; + font-size: 1.1em; +} +.right-panel .realms +{ + width: 95%; + margin: .2em auto; +} +.right-panel .realms a +{ + display: block; + float: left; + width: 33.33%; +} +.right-panel .realms a:hover +{ + background-color: rgba(1, 1, 1, 0.05); + border-radius: .1em; +} +.right-panel .realms a > img +{ + display: block; + padding: 0; + width: 100%; +} +.right-panel .vn-filter, .right-panel select { - width: 100%; + margin: 0 auto; + margin-bottom: .7em; + width: 90%; + display: block; } .vn-filter > ul { @@ -87,14 +123,14 @@ list-style-type: none; text-align: left; color: #666; - padding-left: 1.5em; + padding-left: .8em; } .vn-filter li { margin: 0; - margin-top: .4em; + margin-top: .3em; line-height: 2em; - max-width: 85%; + max-width: 90%; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; @@ -106,6 +142,12 @@ padding: .2em; margin-right: .2em; } +.right-panel .filters > button +{ + display: block; + margin: 0 auto; + margin-top: 1em; +} /* Item description */ @@ -144,7 +186,7 @@ button.confirm > img .catalog .list-view { margin: 0 auto; - padding: .5em; + padding: 1em; max-width: 45em; min-width: 25em; } @@ -198,17 +240,20 @@ td.third-category .catalog .grid-view { + padding: 1em; + padding-right: .2em; + padding-bottom: .4em; text-align: center; } .item-box { - display: inline-block; text-align: left; position: relative; - width: 23em; -/* padding: .8em;*/ - margin: .4em; - margin-bottom: .1em; + display: inline-block; + width: 22.5em; + margin: 0; + margin-right: .8em; + margin-bottom: .6em; height: 10em; overflow: hidden; } @@ -217,7 +262,6 @@ td.third-category width: 10em; height: 100%; float: left; - margin-right: 1em; } .item-box > .image > img { @@ -225,9 +269,23 @@ td.third-category height: 100%; display: block; margin: 0 auto; -/* border-radius: .3em;*/ } -.item-box > p +.item-info +{ + position: absolute; + left: 10.4em; + right: 0; + top: 0; + bottom: 0; + margin: .6em; +} +.item-info > h2 +{ + font-size: 1.2em; + font-weight: normal; + padding-top: 0; +} +.item-info > p { margin: 0; padding: 0; @@ -237,36 +295,33 @@ td.third-category white-space: nowrap; overflow: hidden; } -.item-box > .producer +.item-info > .producer { text-transform: uppercase; } -.item-box > h2 -{ - font-size: 1.2em; - font-weight: normal; - padding-top: .6em; -} -.item-box > .aval-price +.item-info > .aval-price { position: absolute; - bottom: .6em; - right: 3.5em; + bottom: 0; + right: 2.8em; } -.item-box .from +.item-info .from { font-size: .8em; font-style: italic; - } -.item-box > .add-button +.item-info .add-button { position: absolute; - bottom: .2em; - right: .3em; + bottom: 0; + right: 0; padding: .3em; } -.item-box > .info-button +.item-info .add-button > img +{ + vertical-align: middle; +} +.item-info > .info-button { float: right; } @@ -276,6 +331,7 @@ td.third-category .catalog-actions > button.menu { display: none; + padding: 1.1em .5em; } .catalog-actions > button.menu > img { diff --git a/web/forms/ecomerce/catalog/ui.xml b/web/forms/ecomerce/catalog/ui.xml index cdee7115..cb55d6aa 100755 --- a/web/forms/ecomerce/catalog/ui.xml +++ b/web/forms/ecomerce/catalog/ui.xml @@ -1,27 +1,27 @@ - - + + - - + + - + + + + + - - - - @@ -39,10 +39,6 @@ - - - - SELECT item_id, warehouse_id, SUM(amount) amount @@ -50,7 +46,7 @@ GROUP BY warehouse_id - + CREATE TEMPORARY TABLE tmp.bionic_calc (INDEX (item_id)) @@ -103,22 +99,22 @@

Catalog

- - + - + +
@@ -128,7 +124,7 @@ @@ -186,62 +182,51 @@ full-dir="900x900" editable="true"/>
- -

- -

-

- -

-

- Size , - Category -

-

- Color - -

-
- - - from - - - - +
+ +

+ +

+

+ +

+

+ Size , + Category +

+

+ Color + +

+
+ + + from + + + + +
+
- -
-
+

@@ -253,204 +238,234 @@ Change
-
- - - - - SELECT r.id, l.str name, r.color - FROM vn2008.reinos r - LEFT JOIN vn_locale.realm_view l ON l.realm_id = r.id - WHERE r.display != FALSE - ORDER BY name - - - - - - - CALL item_available (); - SELECT DISTINCT t.tipo_id, l.str name - FROM vn2008.Tipos t - JOIN vn2008.Articles a ON a.tipo_id = t.tipo_id - LEFT JOIN vn_locale.family_view l ON l.family_id = t.tipo_id - JOIN tmp.item_available i ON i.item_id = a.Id_Article - WHERE #filter - ORDER BY name - - - - - - - - - - - - - - - - - - CALL item_available (); - SELECT DISTINCT c.Id_Tinta, l.str name - FROM vn2008.Tintas c - JOIN vn2008.Articles a ON a.Color = c.Id_Tinta - LEFT JOIN vn_locale.color_view l ON l.color_id = c.Id_Tinta - JOIN tmp.item_available i ON i.item_id = a.Id_Article - WHERE #filter - ORDER BY name - - - - - - - - - - - - - - CALL item_available (); - SELECT DISTINCT p.producer_id, p.name - FROM vn2008.producer p - JOIN vn2008.Articles a ON a.producer_id = p.producer_id - JOIN tmp.item_available i ON i.item_id = a.Id_Article - WHERE #filter - ORDER BY name - - - - - - - - - - - - - - CALL item_available (); - SELECT DISTINCT o.id, l.str name, o.Abreviatura - FROM vn2008.Origen o - JOIN vn2008.Articles a ON a.id_origen = o.id - LEFT JOIN vn_locale.origin_view l ON l.origin_id = o.id - JOIN tmp.item_available i ON i.item_id = a.Id_Article - WHERE #filter - ORDER BY name - - - - - - - - - - - - - - CALL item_available (); - SELECT DISTINCT a.Categoria, a.Categoria category - FROM vn2008.Articles a - JOIN tmp.item_available i ON i.item_id = a.Id_Article - WHERE #filter - ORDER BY a.Categoria - - - - - - - - - - - +
+
+
+ + + + SELECT r.id, l.str name, r.color + FROM vn2008.reinos r + LEFT JOIN vn_locale.realm_view l ON l.realm_id = r.id + WHERE r.display != FALSE + ORDER BY name + + + + + + + + +
+
+
+
+

Choose a realm

+
+
+

Filter by

+ + + + CALL item_available (); + SELECT DISTINCT t.tipo_id, l.str name + FROM vn2008.Tipos t + JOIN vn2008.Articles a ON a.tipo_id = t.tipo_id + LEFT JOIN vn_locale.family_view l ON l.family_id = t.tipo_id + JOIN tmp.item_available i ON i.item_id = a.Id_Article + WHERE #filter + ORDER BY name + + + + + + + + + + + + + CALL item_available (); + SELECT DISTINCT c.Id_Tinta, l.str name + FROM vn2008.Tintas c + JOIN vn2008.Articles a ON a.Color = c.Id_Tinta + JOIN vn2008.Tipos t ON t.tipo_id = a.tipo_id + LEFT JOIN vn_locale.color_view l ON l.color_id = c.Id_Tinta + JOIN tmp.item_available i ON i.item_id = a.Id_Article + WHERE #filter + ORDER BY name + + + + + + + + + + + + + + + CALL item_available (); + SELECT DISTINCT p.producer_id, p.name + FROM vn2008.producer p + JOIN vn2008.Articles a ON a.producer_id = p.producer_id + JOIN vn2008.Tipos t ON t.tipo_id = a.tipo_id + JOIN tmp.item_available i ON i.item_id = a.Id_Article + WHERE #filter + ORDER BY name + + + + + + + + + + + + + + + CALL item_available (); + SELECT DISTINCT o.id, l.str name, o.Abreviatura + FROM vn2008.Origen o + JOIN vn2008.Articles a ON a.id_origen = o.id + JOIN vn2008.Tipos t ON t.tipo_id = a.tipo_id + LEFT JOIN vn_locale.origin_view l ON l.origin_id = o.id + JOIN tmp.item_available i ON i.item_id = a.Id_Article + WHERE #filter + ORDER BY name + + + + + + + + + + + + + + + CALL item_available (); + SELECT DISTINCT a.Categoria, a.Categoria category + FROM vn2008.Articles a + JOIN vn2008.Tipos t ON t.tipo_id = a.tipo_id + JOIN tmp.item_available i ON i.item_id = a.Id_Article + WHERE #filter + ORDER BY a.Categoria + + + + + + + + + + + +
+
+

Order by

+ +
-
-
- - - - - - -
- - - -
+ +
+ + +
+ + + + + + +
+ + + +
+
-
+
diff --git a/web/forms/ecomerce/orders/ui.xml b/web/forms/ecomerce/orders/ui.xml index 0b13099d..af6f0b1f 100755 --- a/web/forms/ecomerce/orders/ui.xml +++ b/web/forms/ecomerce/orders/ui.xml @@ -12,6 +12,15 @@

LastOrders

+ +
Balance: @@ -33,15 +42,6 @@ class="info" alt="Info"/>
- -
diff --git a/web/forms/news/new/ui.xml b/web/forms/news/new/ui.xml index e041e7e6..3df63967 100755 --- a/web/forms/news/new/ui.xml +++ b/web/forms/news/new/ui.xml @@ -25,16 +25,16 @@

AddEditNew

- +
diff --git a/web/image/blog.svg b/web/image/blog.svg new file mode 100644 index 00000000..c162845a --- /dev/null +++ b/web/image/blog.svg @@ -0,0 +1,154 @@ + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/web/image/dark/view-grid.svg b/web/image/dark/view-grid.svg index 5f2d7ebe..86f11ed6 100644 --- a/web/image/dark/view-grid.svg +++ b/web/image/dark/view-grid.svg @@ -59,7 +59,7 @@ inkscape:window-width="1920" inkscape:window-x="1920" inkscape:window-y="27" - inkscape:zoom="51.5"> + inkscape:zoom="51.6875"> - - - - - - - - - + + + + + + + + + + + diff --git a/web/image/dark/view-list.svg b/web/image/dark/view-list.svg index 1316d90c..43de6898 100644 --- a/web/image/dark/view-list.svg +++ b/web/image/dark/view-list.svg @@ -63,7 +63,7 @@ inkscape:window-width="1920" inkscape:window-x="1920" inkscape:window-y="27" - inkscape:zoom="51.5"> + inkscape:zoom="51.6875"> - - - - - - + + + + + + + + diff --git a/web/image/family_dark/1.svg b/web/image/family_dark/1.svg new file mode 100644 index 00000000..665cb84f --- /dev/null +++ b/web/image/family_dark/1.svg @@ -0,0 +1,73 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/web/image/family_dark/2.svg b/web/image/family_dark/2.svg new file mode 100644 index 00000000..f658ceb3 --- /dev/null +++ b/web/image/family_dark/2.svg @@ -0,0 +1,92 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/web/image/family_dark/3.svg b/web/image/family_dark/3.svg new file mode 100644 index 00000000..ebf769fa --- /dev/null +++ b/web/image/family_dark/3.svg @@ -0,0 +1,69 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/web/image/family_dark/4.svg b/web/image/family_dark/4.svg new file mode 100644 index 00000000..bcf2debb --- /dev/null +++ b/web/image/family_dark/4.svg @@ -0,0 +1,62 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/web/image/family_dark/5.svg b/web/image/family_dark/5.svg new file mode 100644 index 00000000..9a9bf0ff --- /dev/null +++ b/web/image/family_dark/5.svg @@ -0,0 +1,62 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/web/image/family_dark/7.svg b/web/image/family_dark/7.svg new file mode 100644 index 00000000..830a9ad6 --- /dev/null +++ b/web/image/family_dark/7.svg @@ -0,0 +1,96 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/web/image/loader-black.gif b/web/image/loader-black.gif deleted file mode 100644 index dec45f56..00000000 Binary files a/web/image/loader-black.gif and /dev/null differ diff --git a/web/image/loader-white.gif b/web/image/loader-white.gif deleted file mode 100644 index 757c9c2b..00000000 Binary files a/web/image/loader-white.gif and /dev/null differ diff --git a/web/image/loader.gif b/web/image/loader.gif deleted file mode 100644 index 77b27250..00000000 Binary files a/web/image/loader.gif and /dev/null differ diff --git a/web/js/db/model.js b/web/js/db/model.js index 2eeb8e02..3afde179 100755 --- a/web/js/db/model.js +++ b/web/js/db/model.js @@ -130,7 +130,7 @@ Db.Model.implement ,set: function (x) { this._mainTable = null; - this.requestedMainTable = x; + this._requestedMainTable = x; this._refreshMainTable (); } ,get: function () @@ -147,7 +147,7 @@ Db.Model.implement ,set: function (x) { this._updatable = false; - this.requestedUpdatable = x; + this._requestedUpdatable = x; this._refreshUpdatable (); } ,get: function () @@ -220,16 +220,19 @@ Db.Model.implement ,columnMap: null ,_updatable: false - ,sortColumn: -1 - ,sortWay: null - ,requestedIndexes: {} - ,indexes: [] + ,_requestedSortIndex: -1 + ,_requestedSortName: null + ,_sortColumn: -1 + ,_sortWay: null - ,requestedUpdatable: false - ,operations: null - ,operationsMap: null - ,defaults: [] - ,requestedMainTable: null + ,_requestedIndexes: {} + ,_indexes: [] + + ,_requestedUpdatable: false + ,_operations: null + ,_operationsMap: null + ,_defaults: [] + ,_requestedMainTable: null ,initialize: function (props) { @@ -261,11 +264,31 @@ Db.Model.implement **/ ,refresh: function () { - if (this._stmt && this._batch) - this._stmt.findHolders (this._batch); + var ready = false; + + if (this._stmt && this._conn) + { + var ids = this._stmt.findHolders (); + + if (ids) + { + if (this._batch && this._batch.isReady ()) + { + ready = true; - if (this._conn && this._stmt - && (!this._batch || this._batch.isReady ())) + for (var i = 0; i < ids.length; i++) + if (!this._batch.get (ids[i])) + { + ready = false; + break; + } + } + } + else + ready = true; + } + + if (ready) { this._setStatus (Db.Model.Status.LOADING); this._conn.execStmt (this._stmt, this._selectDone.bind (this), this._batch); @@ -293,7 +316,6 @@ Db.Model.implement if (dataResult && typeof dataResult === 'object') { - this.sortColumn = -1; this.data = dataResult.data; this.tables = dataResult.tables; this.columns = dataResult.columns; @@ -301,9 +323,20 @@ Db.Model.implement this._repairColumns (); this._refreshRowIndexes (0); this._refreshMainTable (); - - for (column in this.requestedIndexes) + + for (column in this._requestedIndexes) this._buildIndex (column); + + var sortColumn = -1; + + if (this._requestedSortName) + sortColumn = this.getColumnIndex (this._requestedSortName); + else if (this._requestedSortIndex !== -1 + && this.checkColExists (this._requestedSortIndex)) + sortColumn = this._requestedSortIndex; + + if (sortColumn !== -1) + this._realSort (sortColumn, this._sortWay); this._setStatus (Db.Model.Status.READY); } @@ -316,12 +349,12 @@ Db.Model.implement for (var i = start; i < this.data.length; i++) this.data[i].index = i; - if (this.operationsMap) + if (this._operationsMap) { - this.operationsMap = {}; + this._operationsMap = {}; - for (var i = 0; i < this.operations.length; i++) - this.operationsMap[i] = this.operations[i]; + for (var i = 0; i < this._operations.length; i++) + this._operationsMap[i] = this._operations[i]; } } @@ -331,14 +364,15 @@ Db.Model.implement this.tables = null; this.columns = null; this.columnMap = null; - this.indexes = []; + this._sortColumn = -1; + this._indexes = []; this._resetOperations (); } ,_refreshUpdatable: function () { var oldValue = this._updatable; - this._updatable = this._mainTable !== null && this.requestedUpdatable; + this._updatable = this._mainTable !== null && this._requestedUpdatable; if (oldValue != this._updatable) this.signalEmit ('updatable-changed'); @@ -352,8 +386,8 @@ Db.Model.implement if (tables) for (var i = 0; i < tables.length; i++) if (tables[i].pks.length > 0) - if (!this.requestedMainTable - || tables[i].name === this.requestedMainTable) + if (!this._requestedMainTable + || tables[i].name === this._requestedMainTable) { newMainTable = i; break; @@ -372,7 +406,7 @@ Db.Model.implement **/ ,setDefault: function (field, table, expr) { - this.defaults.push + this._defaults.push ({ field: field ,table: table @@ -389,7 +423,7 @@ Db.Model.implement **/ ,setDefaultFromValue: function (field, table, value) { - this.defaults.push + this._defaults.push ({ field: field ,table: table @@ -407,7 +441,7 @@ Db.Model.implement **/ ,setDefaultFromColumn: function (field, table, srcColumn) { - this.defaults.push + this._defaults.push ({ field: field ,table: table @@ -591,7 +625,7 @@ Db.Model.implement var op = this._createOperation (rowIndex); op.type |= Db.Model.Operation.DELETE; - if (!this.requestedMainTable) + if (!this._requestedMainTable) { this.signalEmit ('row-deleted-before', rowIndex); this.data.splice (rowIndex, 1); @@ -659,7 +693,7 @@ Db.Model.implement **/ ,performOperations: function () { - var ops = this.operations; + var ops = this._operations; if (ops.length === 0) { @@ -742,9 +776,9 @@ Db.Model.implement var dmlQuery = new Sql.Insert (); var table = this.tables[tableIndex]; - for (var i = 0; i < this.defaults.length; i++) + for (var i = 0; i < this._defaults.length; i++) { - var def = this.defaults[i]; + var def = this._defaults[i]; if (def.table === table.name) { @@ -798,10 +832,10 @@ Db.Model.implement { if (resultSet.getError ()) { - this.operations = this.operations.concat (ops); + this._operations = this._operations.concat (ops); for (var i = 0; i < ops.length; i++) - this.operationsMap[ops[i].row.index] = ops[i]; + this._operationsMap[ops[i].row.index] = ops[i]; return; } @@ -874,9 +908,9 @@ Db.Model.implement **/ ,reverseOperations: function () { - for (var i = 0; i < this.operations.length; i++) + for (var i = 0; i < this._operations.length; i++) { - var op = this.operations[i]; + var op = this._operations[i]; var row = op.row; if (op.type & Db.Model.Operation.DELETE @@ -909,8 +943,8 @@ Db.Model.implement ,_resetOperations: function () { - this.operations = []; - this.operationsMap = {}; + this._operations = []; + this._operationsMap = {}; } /* @@ -947,12 +981,13 @@ Db.Model.implement **/ ,sortByName: function (columnName, way) { + this._requestedSortIndex = -1; + this._requestedSortName = columnName; + var index = this.getColumnIndex (columnName); if (index != -1) - this.sort (index, way); - else - console.warn ('Db.Model: Column %s doesn\'t exist', columnName); + this._sort (index, way); } /** @@ -963,28 +998,40 @@ Db.Model.implement **/ ,sort: function (column, way) { + this._requestedSortIndex = column; + this._requestedSortName = null; + if (!this.checkColExists (column)) return; - - this._setStatus (Db.Model.Status.LOADING); - if (column !== this.sortColumn) + this._sort (column, way); + } + + ,_sort: function (column, way) + { + this._setStatus (Db.Model.Status.LOADING); + this._realSort (column, way); + this._setStatus (Db.Model.Status.READY); + } + + ,_realSort: function (column, way) + { + if (column !== this._sortColumn) { if (way === Db.Model.SortWay.DESC) var sortFunction = this.sortFunctionDesc; else var sortFunction = this.sortFunctionAsc; - + this.data.sort (sortFunction.bind (this, column)); } - else if (way !== this.sortWay) + else if (way !== this._sortWay) this.data.reverse (); - - this.sortColumn = column; - this.sortWay = way; + + this._sortColumn = column; + this._sortWay = way; this._refreshRowIndexes (0); - this._setStatus (Db.Model.Status.READY); } /** @@ -998,7 +1045,7 @@ Db.Model.implement **/ ,indexColumn: function (column) { - this.requestedIndexes[column] = true; + this._requestedIndexes[column] = true; if (this._status === Db.Model.Status.READY) this._buildIndex (column); @@ -1026,7 +1073,7 @@ Db.Model.implement index[data[i][columnIndex]] = i; } - this.indexes[columnIndex] = index; + this._indexes[columnIndex] = index; } } @@ -1077,7 +1124,7 @@ Db.Model.implement // Searchs the value using an internal index. - var index = this.indexes[col]; + var index = this._indexes[col]; if (index) { @@ -1168,7 +1215,7 @@ Db.Model.implement ,_createOperation: function (rowIndex) { - var op = this.operationsMap[rowIndex]; + var op = this._operationsMap[rowIndex]; if (!op) { @@ -1176,8 +1223,8 @@ Db.Model.implement type: 0, row: this.data[rowIndex] }; - this.operations.push (op); - this.operationsMap[rowIndex] = op; + this._operations.push (op); + this._operationsMap[rowIndex] = op; } return op; diff --git a/web/js/hedera/gui.css b/web/js/hedera/gui.css index fdbf5e9d..8360b67c 100755 --- a/web/js/hedera/gui.css +++ b/web/js/hedera/gui.css @@ -6,8 +6,7 @@ /* Font */ -.vn-gui .welcome, -.vn-gui .supplant > span, +.vn-gui .user-info, .vn-gui .menu-title, .vn-gui .main-menu a { @@ -28,18 +27,18 @@ box-shadow: 0 0.1em 0.1em rgba(1, 1, 1, 0.3); height: 3.9em; color: white; -/* + transition-property: left, background-color, transform; transition-duration: 200ms; - transition-timing-function: linear; -*/ - transition: transform 200ms ease-in-out; - -webkit-transition: transform 200ms ease-in-out; + transition-timing-function: ease-in-out; +/* transition: transform 100ms ease-in-out; + -webkit-transition: transform 100ms ease-in-out;*/ } .vn-gui .menu-button { + position: absolute; + left: 0; display: none; - float: left; border: none; background-color: transparent; padding: 0 .4em; @@ -64,7 +63,7 @@ font-weight: normal; font-size: 1.4em; padding: .7em .6em; - padding-right: 0; + padding-right: .3em; margin: 0; } .vn-gui .navbar > .htk-spinner @@ -72,22 +71,6 @@ float: left; margin: 1.05em .8em; } -.vn-gui .exit -{ - float: right; - padding: 0 .4em; - display: block; - height: 100%; -} -.vn-gui .exit:hover -{ - background-color: rgba(0, 0, 0, .2); -} -.vn-gui .exit > img -{ - height: 1.8em; - vertical-align: middle; -} /* Action bar */ @@ -106,12 +89,12 @@ } .vn-gui .action-bar > div > * { - float: left; + float: right; } .vn-gui .action-bar button { margin: 0; - padding: 1.15em .5em; + padding: 1.25em .5em; } .vn-gui .action-bar button:hover { @@ -179,31 +162,34 @@ width: 12em; margin-bottom: .6em; } -.vn-gui .welcome +.vn-gui .user-info { - display: block; + position: relative; +} +.vn-gui .user-info > span +{ + max-width: 9em; + display: inline-block; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; + vertical-align: middle; +} +.vn-gui button.logout +{ + float: right; + padding: .2em; +} +.vn-gui button.logout > img +{ + height: 1.2em; + display: block; } .vn-gui .supplant { margin-top: .2em; display: none; } -.vn-gui .supplant > span -{ - max-width: 10em; - display: inline-block; - text-overflow: ellipsis; - white-space: nowrap; - overflow: hidden; -} -.vn-gui .supplant > button -{ - float: right; - padding: .2em; -} /* Test link */ @@ -356,6 +342,7 @@ } .vn-gui > .navbar { + padding-left: 2.8em; left: 0; } .vn-gui > .body diff --git a/web/js/hedera/gui.js b/web/js/hedera/gui.js index 61d7f65f..34bab537 100755 --- a/web/js/hedera/gui.js +++ b/web/js/hedera/gui.js @@ -204,7 +204,7 @@ Vn.Gui = new Class { if (this._scrollTimeout === null) this._scrollTimeout = setTimeout ( - this._scrollTimeoutFunc.bind (this), 300); + this._scrollTimeoutFunc.bind (this), 150); } ,_scrollTimeoutFunc: function () diff --git a/web/js/hedera/gui.xml b/web/js/hedera/gui.xml index 694232f4..d4e464e5 100755 --- a/web/js/hedera/gui.xml +++ b/web/js/hedera/gui.xml @@ -1,13 +1,10 @@