This commit is contained in:
Juan Ferrer Toribio 2015-09-28 11:46:24 +02:00
parent f3cc7db96d
commit 8aa306d2ee
16 changed files with 265 additions and 139 deletions

View File

@ -17,15 +17,4 @@ div.form-group
{ {
padding: 0.4em; padding: 0.4em;
} }
.address label
{
display: block;
margin-bottom: 0.5em;
}
.address input,
.address select
{
margin: 0;
width: 100%;
}

View File

@ -17,17 +17,6 @@
{ {
padding: 0.4em; padding: 0.4em;
} }
.conf .form-group label
{
display: block;
margin-bottom: 0.5em;
}
.conf .form-group input[type=text],
.conf .form-group input[type=password]
{
margin: 0;
width: 100%;
}
.conf .form-group input[type=password] .conf .form-group input[type=password]
{ {
margin-bottom: 0.5em; margin-bottom: 0.5em;

View File

@ -9,7 +9,7 @@ Vn.Photos = new Class
this.$('photo-size').value = 10 /* MB */ * 1048576; this.$('photo-size').value = 10 /* MB */ * 1048576;
this.$('photo-id').focus (); this.$('photo-id').focus ();
this.$('html-form').action = this.$('html-form').action =
'//'+ Vn.Config['image_host'] +'/hedera-web/rest.php?action=image'; '//'+ Vn.Config['image_host'] +'/rest.php?action=image';
} }
,onFormSubmit: function () ,onFormSubmit: function ()

View File

@ -12,21 +12,6 @@
margin: 0 auto; margin: 0 auto;
max-width: 25em; max-width: 25em;
} }
div.form-group
{
padding: 0.4em;
}
.photos form label
{
display: block;
margin-bottom: 0.5em;
}
.photos input,
.photos select
{
margin: 0;
width: 100%;
}
.photos iframe .photos iframe
{ {
display: none; display: none;

View File

@ -25,21 +25,6 @@
display: block; display: block;
margin-top: 2em; margin-top: 2em;
} }
div.form-group
{
padding: 0.4em;
}
.contact form label
{
display: block;
margin-bottom: 0.5em;
}
.contact input,
.contact textarea
{
margin: 0;
width: 100%;
}
.contact textarea .contact textarea
{ {
height: 5em; height: 5em;

View File

@ -38,8 +38,8 @@
</div> </div>
<div class="form-group captcha"> <div class="form-group captcha">
<label><t>Anti-Spam</t></label> <label><t>Anti-Spam</t></label>
<img alt="Captcha" id="captcha-img"/>
<input type="text" name="captcha"/> <input type="text" name="captcha"/>
<img alt="Captcha" id="captcha-img"/>
</div> </div>
<p> <p>
<t>AllFieldsMandatory</t> <t>AllFieldsMandatory</t>

View File

@ -1,4 +1,7 @@
Vn.resource ('forms/ecomerce/catalog/filter-button.xml');
Vn.define (function () {
Vn.Catalog = new Class Vn.Catalog = new Class
({ ({
Extends: Vn.Module Extends: Vn.Module
@ -343,7 +346,83 @@ Vn.Catalog = new Class
} }
}); });
Htk.ColumnCheck = new Class Vn.FilterButton = new Class
({
Extends: Htk.Widget
,Tag: 'vn-filter-button'
,Child: 'model'
,Properties:
{
model:
{
type: Db.Model
,set: function (x)
{
this._grid.model = x;
this._model = x;
}
,get: function ()
{
return this._model;
}
},
text:
{
type: String
,set: function (x)
{
Vn.Node.setText (this._button, x);;
this._text = x;
}
,get: function ()
{
return this._text;
}
},
column:
{
type: String
,set: function (x)
{
this._col.column = x;
}
,get: function ()
{
return this._col.column;
}
},
}
,initialize: function (props)
{
this.parent (props);
this.builderInit ('forms/ecomerce/catalog/filter-button.xml');
this._button = this.createElement ('button');
this._button.className = 'vn-filter-button thin';
this._button.addEventListener ('click', this._onButtonClick.bind (this));
this._grid = new Htk.Grid ();
this._grid.showHeader = false;
this._col = new Htk.ColumnText ();
this._grid.appendColumn (this._col);
}
,_onButtonClick: function ()
{
if (!this._model)
return;
this._model.refresh ();
var popup = new Htk.Popup ();
popup.setChild (this._grid);
popup.show (this._button);
}
});
Vn.ColumnItem = new Class
({ ({
Extends: Htk.Column Extends: Htk.Column
,Tag: 'vn-column-item' ,Tag: 'vn-column-item'
@ -370,3 +449,4 @@ Htk.ColumnCheck = new Class
} }
}); });
});

View File

@ -0,0 +1,11 @@
<vn>
<button
id="button"
class="vn-filter-button thin"
on-click="_onButtonClick"/>
<htk-repeater id="popup" form-id="form">
<div>
<htk-text form="form" id="cell"/>
</div>
</htk-repeater>
</vn>

View File

@ -57,7 +57,7 @@
vertical-align: middle; vertical-align: middle;
} }
/* Menu */ /* Right panel */
.right-panel .right-panel
{ {
@ -66,10 +66,24 @@
top: 3.9em; top: 3.9em;
bottom: 0; bottom: 0;
right: 0; right: 0;
width: 17em; width: 15em;
background-color: white; background-color: white;
box-shadow: 0 0.2em 0.2em #AAA; box-shadow: 0 0.2em 0.2em #AAA;
text-align: center;
padding: 1em;
overflow: auto;
} }
.right-panel select,
.right-panel button
{
color: #333;
margin: 1em auto;
width: 12em;
background-color: #EEE;
border: 0;
}
button.basket button.basket
{ {
width: 100%; width: 100%;
@ -241,6 +255,7 @@ td.third-category
max-height: 9em; max-height: 9em;
display: block; display: block;
margin: 0 auto; margin: 0 auto;
border-radius: .3em;
} }
.item-box > p .item-box > p
{ {

View File

@ -161,40 +161,108 @@
</div> </div>
</template> </template>
</htk-repeater> </htk-repeater>
<div id="right-panel" class="right-panel" on-click="onRightPanelClick"> <div id="realm-popup">
<htk-repeater <htk-grid show-header="false">
model="realms-model" <db-model property="model" id="filter-model">
form-id="realm-form"
renderer="realmRenderer"
class="realms-box">
<db-model id="realms-model" on-status-changed="onTypeChange">
SELECT id, reino, color FROM vn2008.reinos SELECT id, reino, color FROM vn2008.reinos
WHERE display != FALSE ORDER BY reino WHERE display != FALSE ORDER BY reino
</db-model> </db-model>
<template> <htk-column-text column="reino"/>
<a id="link"> </htk-grid>
<img id="image"/> </div>
</a> <div id="right-panel" class="right-panel" on-click="onRightPanelClick">
</template> <select>
</htk-repeater> <option value="">
<htk-repeater <t>Order by</t>
model="types-model" </option>
form-id="type-form" <option value="Article">
renderer="typeRenderer" <t>Item</t>
empty-message="_SelectFamily" </option>
class="types-box"> <option value="price">
<db-model id="types-model" on-status-changed="refreshTitle"> <t>Price</t>
CALL type_list (#realm) </option>
<sql-batch property="batch"> <option value="available">
<item name="realm" param="realm"/> <t>Available</t>
</sql-batch> </option>
<option value="Color">
<t>Color</t>
</option>
<option value="producer">
<t>Producer</t>
</option>
<option value="Medida">
<t>Size</t>
</option>
<option value="Categoria">
<t>Category</t>
</option>
<option value="Abreviatura">
<t>Origin</t>
</option>
</select>
<vn-filter-button text="_Realm" column="reino">
<db-model>
SELECT id, reino, color FROM vn2008.reinos
WHERE display != FALSE ORDER BY reino
</db-model> </db-model>
<template> </vn-filter-button>
<a id="link"> <vn-filter-button text="_Subtype" column="Tipo">
<htk-text form="type-form" column="Tipo"/> <db-model>
</a> CALL type_list (1)
</template> </db-model>
</htk-repeater> </vn-filter-button>
<vn-filter-button text="_Color" column="Color">
<db-model>
SELECT Id_Color, Color
FROM vn2008.Colores ORDER BY Color
</db-model>
</vn-filter-button>
<vn-filter-button text="_Origin" column="Origen">
<db-model>
SELECT id, Abreviatura, Origen
FROM vn2008.Origen ORDER BY Origen
</db-model>
</vn-filter-button>
<vn-filter-button text="_Category" column="category">
<db-model>
SELECT 'A1' category UNION SELECT 'A2' UNION SELECT 'B1'
</db-model>
</vn-filter-button>
<div style="display: none">
<htk-repeater
model="realms-model"
form-id="realm-form"
renderer="realmRenderer"
class="realms-box">
<db-model id="realms-model" on-status-changed="onTypeChange">
SELECT id, reino, color FROM vn2008.reinos
WHERE display != FALSE ORDER BY reino
</db-model>
<template>
<a id="link">
<img id="image"/>
</a>
</template>
</htk-repeater>
<htk-repeater
model="types-model"
form-id="type-form"
renderer="typeRenderer"
empty-message="_SelectFamily"
class="types-box">
<db-model id="types-model" on-status-changed="refreshTitle">
CALL type_list (#realm)
<sql-batch property="batch">
<item name="realm" param="realm"/>
</sql-batch>
</db-model>
<template>
<a id="link">
<htk-text form="type-form" column="Tipo"/>
</a>
</template>
</htk-repeater>
</div>
</div> </div>
<div id="lots-popup" class="lots-popup"> <div id="lots-popup" class="lots-popup">
<htk-grid class="lots-grid" model="item-lots" show-header="false"> <htk-grid class="lots-grid" model="item-lots" show-header="false">

View File

@ -15,22 +15,6 @@
{ {
padding: 2em; padding: 2em;
} }
.new div.form-group
{
padding: 0.4em;
}
.new div.form-group label
{
display: block;
margin-bottom: 0.5em;
}
.new div.form-group input,
.new div.form-group textarea,
.new div.form-group select
{
margin: 0;
width: 100%;
}
.new textarea .new textarea
{ {
min-height: 20em; min-height: 20em;

View File

@ -18,6 +18,11 @@
<h1><t>AddEditNew</t></h1> <h1><t>AddEditNew</t></h1>
</div> </div>
<div id="actions"> <div id="actions">
<htk-button
image="image/dark/close.svg"
tip="_Return"
on-click="onReturnClick"
showText="true"/>
<htk-button <htk-button
image="image/dark/ok.svg" image="image/dark/ok.svg"
tip="_Accept" tip="_Accept"

View File

@ -18,13 +18,16 @@
body body
{ {
color: #333;
margin: 0; margin: 0;
} }
body, body,
label, label,
button, button,
input, input,
textarea textarea,
select,
option
{ {
font-size: 1em; font-size: 1em;
font-family: 'Open Sans', 'Verdana', 'Sans'; font-family: 'Open Sans', 'Verdana', 'Sans';
@ -90,42 +93,29 @@ input[type=number],
textarea, textarea,
select select
{ {
border: 1px solid #CCD; border: none;
margin: 0.2em; border-bottom: 1px solid #999;
border-radius: 0.1em; margin: .2em;
box-shadow: 0 0.1em 0.1em #CCC; box-sizing: border-box;
color: #333;
/* border-radius: 0.1em;
border: .1em solid #CCD;
box-shadow: 0 0.1em 0.1em #CCC;*/
}
input[type=text],
input[type=password],
input[type=number],
textarea
{
padding: 0 .2em;
} }
input[type=text], input[type=text],
input[type=password], input[type=password],
input[type=file], input[type=file],
input[type=number], input[type=number],
textarea
{
padding: 0.3em;
}
select select
{ {
background-color: white; height: 2.2em;
font-size: 1.1em;
height: 1.8em;
}
option
{
padding: 0.3em;
border-width: 0;
font-weight: normal;
font-size: 1em;
}
select,
option
{
cursor: pointer;
}
input[type=text],
input[type=password]
{
height: 1.6em;
} }
textarea textarea
{ {
@ -134,10 +124,11 @@ textarea
} }
input[type=text]:focus, input[type=text]:focus,
input[type=password]:focus, input[type=password]:focus,
input[type=file]:focus,
input[type=number]:focus,
textarea:focus textarea:focus
{ {
background-color: #EEF; border-color: #333;
border-color: #BBC;
} }
input[type=checkbox], input[type=checkbox],
input[type=radio] input[type=radio]
@ -148,6 +139,24 @@ input[type=radio]
width: 0.8em; width: 0.8em;
height: 0.8em; height: 0.8em;
} }
select
{
background-color: white;
-moz-appearance: none;
appearance: none;
}
option
{
padding: .4em;
border-width: 0;
font-weight: normal;
font-size: 1em;
}
select,
option
{
cursor: pointer;
}
/* Buttons */ /* Buttons */
@ -275,10 +284,16 @@ img.editable
.form-group > label .form-group > label
{ {
display: block; display: block;
margin-bottom: 0.5em; margin: 0;
margin-top: .5em;
margin-bottom: .2em;
font-size: .9em;
color: #222;
} }
.form-group > input[type=text], .form-group > input[type=text],
.form-group > input[type=password], .form-group > input[type=password],
.form-group > input[type=file],
.form-group > input[type=number],
.form-group > select, .form-group > select,
.form-group > textarea .form-group > textarea
{ {

View File

@ -27,7 +27,7 @@ Htk.Grid = new Class
} }
,get: function () ,get: function ()
{ {
this._model; return this._model;
} }
}, },
emptyMessage: emptyMessage:

View File

@ -16,7 +16,7 @@ Htk.ImageEditor = new Class
this.$('max-size').value = 10 /* MB */ * 1048576; this.$('max-size').value = 10 /* MB */ * 1048576;
this.$('form').action = this.$('form').action =
'//'+ Vn.Config['image_host'] +'/hedera-web/rest.php?action=image' '//'+ Vn.Config['image_host'] +'/rest.php?action=image'
} }
,onNameChange: function () ,onNameChange: function ()

View File

@ -301,7 +301,7 @@ var Vn =
if (loaded) if (loaded)
{ {
if (this.currentCallback) if (this.currentCallback)
includeData.callbacks.push (this.currentCallback); includeData.callbacks.unshift (this.currentCallback);
var includes = this.currentDeps; var includes = this.currentDeps;