Los formularios ahora son responsive

This commit is contained in:
Juan Ferrer Toribio 2015-12-02 18:26:58 +01:00
parent c21a0dae60
commit 63342ba25b
38 changed files with 610 additions and 317 deletions

View File

@ -5,7 +5,7 @@
} }
.address-list .box .address-list .box
{ {
max-width: 40em; max-width: 30em;
} }
.address-list .form .address-list .form
{ {
@ -15,19 +15,30 @@
} }
.address .address
{ {
color: #555; padding: 1em;
padding: .5em; border-bottom: 1px solid #DDD;
}
.address p.consignee
{
font-weight: bold;
} }
.address p .address p
{ {
font-size: 1.4em;
margin: 0.2em 0; margin: 0.2em 0;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
.address p.important
{
font-size: 1.2em;
} }
.address .actions .address .actions
{ {
text-align: right; float: right;
}
.address .actions > *
{
display: inline-block;
vertical-align: middle;
}
.address .actions > input
{
margin: .6em;
} }

View File

@ -31,7 +31,6 @@
</div> </div>
<div id="form" class="address-list"> <div id="form" class="address-list">
<div class="box"> <div class="box">
<div class="form">
<htk-radio-group <htk-radio-group
id="default-address" id="default-address"
column="default_address" column="default_address"
@ -39,16 +38,6 @@
<htk-repeater model="addresses" form-id="iter"> <htk-repeater model="addresses" form-id="iter">
<custom> <custom>
<div class="address"> <div class="address">
<p class="consignee">
<htk-text form="iter" column="consignee"/>
</p>
<p>
<htk-text form="iter" column="name"/>
</p>
<p>
<htk-text form="iter" column="zip_code"/>,
<htk-text form="iter" column="city"/>
</p>
<div class="actions"> <div class="actions">
<htk-radio <htk-radio
form="iter" form="iter"
@ -68,10 +57,19 @@
image="image/edit.svg" image="image/edit.svg"
on-click="onEditAddressClick"/> on-click="onEditAddressClick"/>
</div> </div>
<p class="important">
<htk-text form="iter" column="consignee"/>
</p>
<p>
<htk-text form="iter" column="name"/>
</p>
<p>
<htk-text form="iter" column="zip_code"/>,
<htk-text form="iter" column="city"/>
</p>
</div> </div>
</custom> </custom>
</htk-repeater> </htk-repeater>
</div> </div>
</div>
</div> </div>
</vn> </vn>

View File

@ -5,15 +5,15 @@
} }
.address .box .address .box
{ {
max-width: 40em; max-width: 30em;
padding: 2em;
} }
.address .box .body .address .form
{ {
margin: 0 auto; margin: 0 auto;
max-width: 25em; max-width: 25em;
padding: 3em;
} }
div.form-group .address .form-group
{ {
padding: 0.4em; padding: 0.4em;
} }

View File

@ -36,7 +36,7 @@
</div> </div>
<div id="form" class="address"> <div id="form" class="address">
<div class="box"> <div class="box">
<div class="body"> <div class="form">
<div class="form-group"> <div class="form-group">
<label><t>Name</t></label> <label><t>Name</t></label>
<htk-entry column="consignee" form="iter"/> <htk-entry column="consignee" form="iter"/>

View File

@ -5,13 +5,13 @@
} }
.conf .box .conf .box
{ {
max-width: 40em; max-width: 30em;
padding: 2em;
} }
.conf .form .conf .form
{ {
margin: 0 auto; margin: 0 auto;
max-width: 25em; max-width: 25em;
padding: 2em;
} }
.conf .form-group .conf .form-group
{ {

View File

@ -1,15 +1,36 @@
.access-log .access-log
{ {
padding: 1em; padding: 1em;
min-width: 35em;
} }
.access-log .box .access-log .box
{ {
max-width: 50em; max-width: 25em;
margin: 0 auto; margin: 0 auto;
} }
.access-log .htk-grid tbody tr .access-log .form
{ {
height: 3.4em; padding: 2em;
}
.access-log .form > p
{
font-size: 1.2em;
margin: .1em 0;
}
/* List */
.access-log .list
{
margin-top: 1em;
}
.access-log .item
{
display: block;
padding: 1em;
border-bottom: 1px solid #DDD;
}
.access-log .item > p
{
margin: .1em 0;
} }

View File

@ -1,14 +1,17 @@
<vn> <vn>
<vn-group> <vn-group>
<vn-hash-param key="user">
<vn-param id="user"/> <vn-param id="user"/>
</vn-hash-param> <vn-hash-param key="user" param="user"/>
<db-form id="user-form"> <db-form id="user-form">
<db-model> <db-model property="model">
<custom>
SELECT Id_Cliente, Cliente, Telefono, movil SELECT Id_Cliente, Cliente, Telefono, movil
FROM vn2008.Clientes WHERE Id_Cliente = #user FROM vn2008.Clientes WHERE Id_Cliente = #user
</custom>
<sql-batch property="batch"> <sql-batch property="batch">
<custom>
<item name="user" param="user"/> <item name="user" param="user"/>
</custom>
</sql-batch> </sql-batch>
</db-model> </db-model>
</db-form> </db-form>
@ -18,63 +21,57 @@
</div> </div>
<div id="form" class="access-log"> <div id="form" class="access-log">
<div class="box"> <div class="box">
<table class="form"> <div class="form">
<tbody> <p>
<tr> <htk-text form="user-form" column="Id_Cliente"/>
<td class="label"> </p>
<label><t>UserNumber:</t></label> <p>
</td> <htk-text form="user-form" column="Cliente"/>
<td> </p>
<htk-text column="Id_Cliente" form="user-form"/> <p>
</td> <htk-text form="user-form" column="Telefono"/>
</tr> </p>
<tr> <p>
<td class="label"> <htk-text form="user-form" column="movil"/>
<label><t>User:</t></label> </p>
</td> </div>
<td> </div>
<htk-text column="Cliente" form="user-form"/> <div class="list box">
</td>
</tr>
<tr>
<td class="label">
<label><t>Phone:</t></label>
</td>
<td>
<htk-text column="Telefono" form="user-form"/>
</td>
</tr>
<tr>
<td class="label">
<label><t>Mobile:</t></label>
</td>
<td>
<htk-text column="movil" form="user-form"/>
</td>
</tr>
</tbody>
</table>
<div> <div>
<htk-grid> <htk-repeater form-id="iter">
<db-model> <db-model property="model">
<custom>
SELECT u.date_time, a.platform, a.browser, a.version, a.javascript, a.cookies SELECT u.date_time, a.platform, a.browser, a.version, a.javascript, a.cookies
FROM visit_user u FROM visit_user u
JOIN visit_access c ON u.access_id = c.id JOIN visit_access c ON u.access_id = c.id
JOIN visit_agent a ON c.agent_id = a.id JOIN visit_agent a ON c.agent_id = a.id
WHERE u.user_id = #user WHERE u.user_id = #user
ORDER BY u.date_time DESC ORDER BY u.date_time DESC
LIMIT 30 LIMIT 8
</custom>
<sql-batch property="batch"> <sql-batch property="batch">
<custom>
<item name="user" param="user"/> <item name="user" param="user"/>
</custom>
</sql-batch> </sql-batch>
</db-model> </db-model>
<htk-column-date title="_Access" column="date_time" format="_%a, %e %b %Y at %T"/> <custom>
<htk-column-text title="_SO" column="platform"/> <div class="item">
<htk-column-text title="_Browser" column="browser"/> <p>
<htk-column-text title="_Version" column="version"/> <htk-text form="iter" column="date_time" format="_%a, %e %b %Y at %T"/>
<htk-column-check title="_Javascript" column="javascript"/> </p>
<htk-column-check title="_Cookies" column="cookies"/> <p>
</htk-grid> <htk-text form="iter" column="platform"/>,
<htk-text form="iter" column="browser"/>
<htk-text form="iter" column="version"/>
</p>
<!-- <p>
<htk-text form="iter" column="javascript"/>,
<htk-text form="iter" column="cookies"/>
</p>
--> </div>
</custom>
</htk-repeater>
</div> </div>
</div> </div>
</div> </div>

View File

@ -5,14 +5,13 @@
} }
.items .box .items .box
{ {
max-width: 40em; max-width: 30em;
padding: 2em; padding: 2em;
} }
.items .body .items .form
{ {
max-width: 20em; max-width: 25em;
margin: auto; margin: auto;
padding: 0;
} }
.items .form-group .items .form-group
{ {

View File

@ -4,7 +4,7 @@
</div> </div>
<div id="form" class="items"> <div id="form" class="items">
<div class="box"> <div class="box">
<div class="body"> <div class="form">
<div class="form-group"> <div class="form-group">
<label><t>Store</t></label> <label><t>Store</t></label>
<htk-combo> <htk-combo>

View File

@ -3,14 +3,9 @@ Vn.Links = new Class
({ ({
Extends: Vn.Form Extends: Vn.Form
,activate: function () ,repeaterFunc: function (res, form)
{ {
this.$('column-link').renderer = this.linkRenderer; res.$('link').href = form.get ('link');
}
,linkRenderer: function (column, form)
{
column.href = form.get ('link');
} }
}); });

View File

@ -5,14 +5,34 @@
} }
.cpanel .box .cpanel .box
{ {
max-width: 60em; max-width: 30em;
min-width: 25em;
} }
.cpanel tbody tr
/* Items */
.cpanel .item
{ {
height: 3.5em; display: block;
padding: 1em;
border-bottom: 1px solid #DDD;
} }
.cpanel tbody td img .cpanel .item:hover
{ {
min-height: 1.6em; background-color: rgba(1, 1, 1, 0.05);
}
.cpanel .item > img
{
margin: .2em 0;
margin-right: 1em;
float: left;
max-height: 3em;
max-width: 3em;
}
.cpanel .item > p
{
margin: .1em 0;
}
.cpanel .item > p.important
{
font-size: 1.2em;
} }

View File

@ -4,17 +4,29 @@
</div> </div>
<div id="form" class="cpanel"> <div id="form" class="cpanel">
<div class="box"> <div class="box">
<htk-grid show-header="false"> <htk-repeater form-id="iter" renderer="repeaterFunc">
<db-model property="model"> <db-model property="model">
<custom> <custom>
SELECT image, name, description, link FROM link SELECT image, name, description, link FROM link
ORDER BY name ORDER BY name
</custom> </custom>
</db-model> </db-model>
<htk-column-image directory="link" subdir="full" column="image"/> <custom>
<htk-column-link column="name" target="\_blank" id="column-link"/> <a id="link" class="item" target="_blank">
<htk-column-text column="description"/> <htk-image
</htk-grid> form="iter"
column="image"
directory="link"
subdir="full"/>
<p class="important">
<htk-text form="iter" column="name"/>
</p>
<p>
<htk-text form="iter" column="description"/>
</p>
</a>
</custom>
</htk-repeater>
</div> </div>
</div> </div>
</vn> </vn>

View File

@ -5,9 +5,10 @@
} }
.photos .box .photos .box
{ {
max-width: 40em; max-width: 30em;
padding: 2em;
} }
.photos form .photos .form
{ {
margin: 0 auto; margin: 0 auto;
max-width: 25em; max-width: 25em;

View File

@ -4,7 +4,7 @@
</div> </div>
<div id="form" class="photos"> <div id="form" class="photos">
<div class="box"> <div class="box">
<div class="body"> <div class="form">
<form <form
id="html-form" id="html-form"
method="post" method="post"
@ -33,7 +33,7 @@
<input type="file" name="image"/> <input type="file" name="image"/>
<input type="hidden" name="MAX_FILE_SIZE" id="photo-size"/> <input type="hidden" name="MAX_FILE_SIZE" id="photo-size"/>
</div> </div>
<button class="flat" id="submit"> <button class="thin" id="submit">
<t>Upload</t> <t>Upload</t>
</button> </button>
</form> </form>

View File

@ -5,14 +5,13 @@
} }
.shelves .box .shelves .box
{ {
max-width: 40em; max-width: 30em;
padding: 2em; padding: 2em;
} }
.shelves .body .shelves .form
{ {
max-width: 20em; max-width: 25em;
margin: auto; margin: auto;
padding: 0;
} }
.shelves .form-group .shelves .form-group
{ {

View File

@ -14,7 +14,7 @@
</div> </div>
<div id="form" class="shelves"> <div id="form" class="shelves">
<div class="box"> <div class="box">
<div class="body"> <div class="form">
<div class="form-group"> <div class="form-group">
<label><t>Configuration</t></label> <label><t>Configuration</t></label>
<htk-combo <htk-combo

View File

@ -35,13 +35,13 @@
form="iter" form="iter"
column="id" column="id"
tip="_AccessAsUser" tip="_AccessAsUser"
image="image/gnome.svg" image="image/incognito.svg"
on-click="onChangeUserClick"/> on-click="onChangeUserClick"/>
<htk-button <htk-button
form="iter" form="iter"
column="id" column="id"
tip="_AccessLog" tip="_AccessLog"
image="image/access-log.svg" image="image/gnome.svg"
on-click="onAccessLogClick"/> on-click="onAccessLogClick"/>
<p class="important"> <p class="important">
<htk-text form="iter" column="Cliente"/> <htk-text form="iter" column="Cliente"/>

View File

@ -3,11 +3,11 @@ Vn.Users = new Class
({ ({
Extends: Vn.Form Extends: Vn.Form
,onAccessLogClick: function (column, value) ,onAccessLogClick: function (button, form)
{ {
this.hash.set ({ this.hash.set ({
'form': 'admin/access-log' 'form': 'admin/access-log'
,'user': value ,'user': form.get ('id')
}); });
} }

View File

@ -5,13 +5,25 @@
} }
.visits .box .visits .box
{ {
max-width: 80em; max-width: 60em;
margin: 0 auto; margin: 0 auto;
} }
.visits .conns-form
{
padding: 1.5em;
font-size: 1.4em;
text-align: right;
}
.visits .form
{
padding: 2em;
max-width: 25em;
}
/* Steps */ /* Steps */
div.step .visits .step
{ {
display: none; display: none;
} }

View File

@ -22,33 +22,19 @@
<div id="form" class="visits"> <div id="form" class="visits">
<div class="box"> <div class="box">
<div class="step" id="sessions-step"> <div class="step" id="sessions-step">
<table class="form"> <div class="conns-form">
<tbody> <htk-text>
<tr> <db-calc-sum
<td class="label"> property="param"
<label><t>ActiveSessions:</t></label> model="sessions"
</td> id="num-sessions"/>
<td> </htk-text>
<htk-label> <t>active sessions</t>
<db-calc-sum model="sessions" id="num-sessions"/> </div>
</htk-label>
</td>
</tr>
<tr>
<td class="label">
<label><t>NewVisitsTotal:</t></label>
</td>
<td>
<htk-label>
<db-calc-sum model="sessions" column-name="is_new"/>
</htk-label>
</td>
</tr>
</tbody>
</table>
<div> <div>
<htk-grid> <htk-grid>
<db-model id="sessions"> <db-model property="model" id="sessions">
<custom>
SELECT s.id, c.Cliente, e.date_time login, is_new, SELECT s.id, c.Cliente, e.date_time login, is_new,
s.date_time last_activity, a.platform, a.browser, a.version s.date_time last_activity, a.platform, a.browser, a.version
FROM user_session s FROM user_session s
@ -59,66 +45,54 @@
JOIN account.user u ON e.user_id = u.id JOIN account.user u ON e.user_id = u.id
JOIN vn2008.Clientes c ON e.user_id = c.Id_cliente JOIN vn2008.Clientes c ON e.user_id = c.Id_cliente
ORDER BY last_activity DESC ORDER BY last_activity DESC
</custom>
</db-model> </db-model>
<htk-column-spin title="_SessionNumber" column="id"/>
<htk-column-text title="_User" column="Cliente"/> <htk-column-text title="_User" column="Cliente"/>
<htk-column-date title="_Login" column="login" format="%a, %T"/> <htk-column-date title="_Login" column="login" format="%a, %T"/>
<htk-column-date title="_LastActivity" column="last_activity" format="%a, %T"/> <htk-column-date title="_LastActivity" column="last_activity" format="%T"/>
<htk-column-text title="_SO" column="platform"/> <htk-column-text title="_SO" column="platform"/>
<htk-column-text title="_Browser" column="browser"/> <htk-column-text title="_Browser" column="browser"/>
<htk-column-text title="_Version" column="version"/> <htk-column-text title="_Version" column="version"/>
<htk-column-check title="_NewVisit" column="is_new"/>
</htk-grid> </htk-grid>
</div> </div>
</div> </div>
<div class="step" id="visits-step"> <div class="step" id="visits-step">
<table class="form"> <div class="form">
<tbody> <div class="form-group">
<tr>
<td class="label">
<label><t>FromDate:</t></label> <label><t>FromDate:</t></label>
</td>
<td>
<htk-date-chooser> <htk-date-chooser>
<vn-param id="date-from"/> <vn-param property="param" id="date-from"/>
</htk-date-chooser> </htk-date-chooser>
</td> </div>
</tr> <div class="form-group">
<tr>
<td class="label">
<label><t>ToDate:</t></label> <label><t>ToDate:</t></label>
</td>
<td>
<htk-date-chooser> <htk-date-chooser>
<vn-param id="date-to"/> <vn-param property="param" id="date-to"/>
</htk-date-chooser> </htk-date-chooser>
</td> </div>
</tr> <div class="form-group">
<tr> <t>VisitsTotal:</t>
<td class="label"> <htk-text>
<label><t>VisitsTotal:</t></label> <db-calc-sum
</td> property="param"
<td> model="visits"
<htk-label> column-name="visits"/>
<db-calc-sum model="visits" column-name="visits"/> </htk-text>
</htk-label> </div>
</td> <div class="form-group">
</tr> <t>NewVisitsTotal:</t>
<tr> <htk-text>
<td class="label"> <db-calc-sum
<label><t>NewVisitsTotal:</t></label> property="param"
</td> model="visits"
<td> column-name="new_visits"/>
<htk-label> </htk-text>
<db-calc-sum model="visits" column-name="new_visits"/> </div>
</htk-label> </div>
</td>
</tr>
</tbody>
</table>
<div> <div>
<htk-grid empty-message="SelectDateInterval"> <htk-grid empty-message="SelectDateInterval">
<db-model id="visits"> <db-model property="model" id="visits">
<custom>
SELECT browser SELECT browser
,MIN(CAST(version AS DECIMAL(4,1))) min_version ,MIN(CAST(version AS DECIMAL(4,1))) min_version
,MAX(CAST(version AS DECIMAL(4,1))) max_version ,MAX(CAST(version AS DECIMAL(4,1))) max_version
@ -131,9 +105,12 @@
JOIN visit v ON a.visit_id = v.id JOIN visit v ON a.visit_id = v.id
WHERE e.date_time BETWEEN TIMESTAMP(#from,'00:00:00') AND TIMESTAMP(#to,'23:59:59') WHERE e.date_time BETWEEN TIMESTAMP(#from,'00:00:00') AND TIMESTAMP(#to,'23:59:59')
GROUP BY browser ORDER BY visits DESC GROUP BY browser ORDER BY visits DESC
</custom>
<sql-batch property="batch"> <sql-batch property="batch">
<custom>
<item name="from" param="date-from"/> <item name="from" param="date-from"/>
<item name="to" param="date-to"/> <item name="to" param="date-to"/>
</custom>
</sql-batch> </sql-batch>
</db-model> </db-model>
<htk-column-text title="_Browser" column="browser"/> <htk-column-text title="_Browser" column="browser"/>

View File

@ -5,19 +5,19 @@
} }
.contact .box .contact .box
{ {
max-width: 40em; max-width: 30em;
padding: 2em;
} }
.contact .body .contact .form
{ {
position: relative; position: relative;
text-align: left; text-align: left;
max-width: 25em; max-width: 25em;
margin: 1em auto; margin: 0 auto;
} }
.contact form .contact form
{ {
margin: 0 auto; margin: 0 auto;
max-width: 25em;
} }
.contact form p .contact form p
{ {

View File

@ -4,7 +4,7 @@
</div> </div>
<div id="form" class="contact"> <div id="form" class="contact">
<div class="box"> <div class="box">
<div class="body"> <div class="form">
<p> <p>
<t>FillFormData</t> <t>FillFormData</t>
</p> </p>

View File

@ -54,6 +54,7 @@
margin-right: 1em; margin-right: 1em;
float: left; float: left;
border-radius: 50%; border-radius: 50%;
height: 3.2em;
} }
.basket-line > p .basket-line > p
{ {

View File

@ -38,7 +38,7 @@
form="iter" form="iter"
column="ticket_id" column="ticket_id"
class="delete" class="delete"
tip="_SeeOrder" tip="_Remove"
image="image/delete.svg" image="image/delete.svg"
on-click="onDeleteClick"/> on-click="onDeleteClick"/>
<htk-image <htk-image
@ -46,7 +46,7 @@
column="Foto" column="Foto"
class="photo" class="photo"
directory="catalog" directory="catalog"
subdir="50x50" subdir="200x200"
show-full="true" show-full="true"
full-dir="900x900"/> full-dir="900x900"/>
<p class="concept"> <p class="concept">

View File

@ -13,9 +13,9 @@ Vn.Orders = new Class
this.hash.set ({'form': 'ecomerce/basket'}); this.hash.set ({'form': 'ecomerce/basket'});
} }
,onShowClick: function (button, form) ,repeaterFunc: function (res, form)
{ {
this.hash.set ({ res.$('link').href = this.hash.make ({
'form': 'ecomerce/ticket', 'form': 'ecomerce/ticket',
'ticket': form.get ('ticket_id') 'ticket': form.get ('ticket_id')
}); });
@ -34,7 +34,7 @@ Vn.Orders = new Class
,onPayButtonClick: function () ,onPayButtonClick: function ()
{ {
var company = 442; var company = 442;
var amount = this.$('debt').value; var amount = -this.$('debt').value;
amount = amount <= 0 ? null : amount; amount = amount <= 0 ? null : amount;

View File

@ -4,7 +4,7 @@
} }
.orders .box .orders .box
{ {
max-width: 30em; max-width: 25em;
} }
/* Balance */ /* Balance */
@ -48,22 +48,22 @@
/* List */ /* List */
.order-box .orders .item
{ {
display: block;
padding: 1em; padding: 1em;
border-bottom: 1px solid #DDD; border-bottom: 1px solid #DDD;
} }
.order-box > p .orders .item:hover
{
background-color: rgba(1, 1, 1, 0.05);
}
.orders .item > p
{ {
margin: .1em 0; margin: .1em 0;
} }
.order-box > p.important .orders .item > p.important
{ {
font-size: 1.2em; font-size: 1.2em;
} }
.order-box > .show-order
{
margin: 1.6em .5em;
float: right;
}

View File

@ -3,7 +3,7 @@
<db-model id="debt-model" result-index="1"> <db-model id="debt-model" result-index="1">
<custom> <custom>
CALL customer_get_debt_by_company (); CALL customer_get_debt_by_company ();
SELECT * FROM t_customer_debt; SELECT -amount amount FROM t_customer_debt;
DROP TEMPORARY TABLE t_customer_debt; DROP TEMPORARY TABLE t_customer_debt;
</custom> </custom>
</db-model> </db-model>
@ -45,21 +45,14 @@
</div> </div>
<div id="form" class="orders"> <div id="form" class="orders">
<div class="box confirmed"> <div class="box confirmed">
<htk-repeater form-id="iter"> <htk-repeater form-id="iter" renderer="repeaterFunc">
<db-model property="model" id="tickets"> <db-model property="model" id="tickets">
<custom> <custom>
CALL ticket_list (); CALL ticket_list ();
</custom> </custom>
</db-model> </db-model>
<custom> <custom>
<div class="order-box"> <a id="link" class="item" title="_SeeOrder">
<htk-button
class="show-order"
form="iter"
column="ticket_id"
tip="_SeeOrder"
image="image/show.svg"
on-click="onShowClick"/>
<p class="important"> <p class="important">
<htk-text form="iter" column="date" format="%A, %e of %B"/> <htk-text form="iter" column="date" format="%A, %e of %B"/>
</p> </p>
@ -73,7 +66,7 @@
<htk-text form="iter" column="total" format="%.2d€"/> <htk-text form="iter" column="total" format="%.2d€"/>
</p> </p>
<div class="clear"/> <div class="clear"/>
</div> </a>
</custom> </custom>
</htk-repeater> </htk-repeater>
</div> </div>

View File

@ -5,15 +5,14 @@
} }
.new .box .new .box
{ {
max-width: 50em; max-width: 35em;
margin: 0 auto; padding: 2em;
} }
/* Form */ /* Form */
.new .form .new .form
{ {
padding: 2em;
} }
.new textarea .new textarea
{ {

View File

@ -11,9 +11,15 @@ Vn.News = new Class
}); });
} }
,onEditClick: function (column, newId) ,onEditClick: function (button, form)
{ {
this.editNew (newId); this.editNew (button.value);
}
,onDeleteClick: function (button, form)
{
if (confirm (_('ReallyDelete')))
form.deleteRow ();
} }
,onAddClick: function () ,onAddClick: function ()

View File

@ -1,10 +1,47 @@
.news .news
{ {
padding: 1em; padding: 1em;
min-width: 35em;
} }
.news .box .news .box
{ {
max-width: 60em; max-width: 35em;
margin: 0 auto; margin: 0 auto;
} }
/* Items */
.news .item
{
padding: 1em;
border-bottom: 1px solid #DDD;
}
.news .item > p
{
margin: .1em 0;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
.news .item > p.important
{
font-size: 1.2em;
}
.news .item > .photo
{
float: left;
margin-right: 1em;
height: 5em;
width: 5em;
}
.news .item > .photo > img
{
display: block;
margin: 0 auto;
max-height: 100%;
max-width: 100%;
border-radius: .3em;
}
.news .item > button
{
float: right;
}

View File

@ -12,15 +12,6 @@
<div id="form" class="news"> <div id="form" class="news">
<div class="box"> <div class="box">
<htk-grid show-header="false"> <htk-grid show-header="false">
<db-model property="model" id="news-model" updatable="true">
<custom>
SELECT n.id, c.Cliente, priority, image,
CONCAT(LEFT(n.title, 25), '...') title
FROM news n
JOIN vn2008.Clientes c ON n.user_id = c.Id_Cliente
ORDER BY priority, n.date_time DESC
</custom>
</db-model>
<htk-column-button <htk-column-button
column="id" column="id"
tip="_EditNew" tip="_EditNew"
@ -36,6 +27,51 @@
<htk-column-text title="_Author" column="Cliente"/> <htk-column-text title="_Author" column="Cliente"/>
<htk-column-spin title="_Priority" column="priority"/> <htk-column-spin title="_Priority" column="priority"/>
</htk-grid> </htk-grid>
<htk-repeater form-id="iter">
<db-model property="model" id="news-model" updatable="true">
<custom>
SELECT n.id, c.Cliente, priority, image, title
FROM news n
JOIN vn2008.Clientes c ON n.user_id = c.Id_Cliente
ORDER BY priority, n.date_time DESC
</custom>
</db-model>
<custom>
<div class="item">
<htk-button
form="iter"
column="id"
tip="_EditNew"
image="image/edit.svg"
on-click="onEditClick"/>
<htk-button
form="iter"
column="id"
tip="_Remove"
image="image/delete.svg"
on-click="onDeleteClick"/>
<div class="photo">
<htk-image
form="iter"
column="image"
class="photo"
directory="news"
subdir="200x200"
editable="true"/>
</div>
<p class="important">
<htk-text form="iter" column="title"/>
</p>
<p>
<htk-text form="iter" column="Cliente"/>
</p>
<p>
<t>Priority</t>
<htk-text form="iter" column="priority"/>
</p>
</div>
</custom>
</htk-repeater>
</div> </div>
</div> </div>
</vn> </vn>

56
web/image/incognito.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

81
web/image/supplant.svg Normal file
View File

@ -0,0 +1,81 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="Capa_1"
x="0px"
y="0px"
width="16"
height="16"
viewBox="0 0 16.000001 16"
xml:space="preserve"
inkscape:version="0.91 r13725"
sodipodi:docname="35140.svg"><metadata
id="metadata41"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs39" /><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1016"
id="namedview37"
showgrid="false"
inkscape:zoom="51.6875"
inkscape:cx="8"
inkscape:cy="8"
inkscape:window-x="1920"
inkscape:window-y="27"
inkscape:window-maximized="1"
inkscape:current-layer="Capa_1" /><g
id="g3"
transform="matrix(0.02428826,0,0,0.02428826,1.0000122,1.0000189)"
style="fill:#666666;fill-opacity:1"><path
d="m 575.391,177.483 c -8.801,10.27 -18.997,9.354 -29.011,5.667 -13.919,-5.126 -27.604,-10.93 -41.223,-16.826 -33.546,-14.523 -68.137,-23.306 -105.074,-20.64 -28.259,2.054 -55.848,7.495 -82.41,17.187 -9.892,3.603 -19.688,5.646 -29.47,6.094 -9.78,-0.447 -19.578,-2.491 -29.468,-6.094 -26.561,-9.687 -54.151,-15.132 -82.413,-17.187 -36.935,-2.671 -71.528,6.116 -105.073,20.64 -13.617,5.9 -27.305,11.699 -41.223,16.826 -10.011,3.687 -20.208,4.603 -29.01,-5.667 -3.37,53.865 1.028,105.223 22.478,154.106 12.553,28.609 30.311,53.35 56.17,71.285 41.837,29.006 87.425,36.068 135.737,19.651 10.669,-3.625 20.249,-10.892 29.81,-17.244 15.117,-10.055 30.311,-17.001 43.44,-17.001 13.128,0 27.408,6.946 42.531,17.001 9.566,6.362 19.144,13.619 29.812,17.244 48.312,16.407 93.907,9.354 135.734,-19.651 25.862,-17.936 43.614,-42.676 56.167,-71.285 21.465,-48.883 25.873,-100.241 22.496,-154.106 z M 110.009,337.49 C 62.675,312.791 52.082,239.538 52.082,239.538 c 0,0 60.829,-23.016 108.158,1.674 47.334,24.699 63.246,87.757 63.246,87.757 0,0 -66.142,33.21 -113.477,8.521 z m 356.399,0 c -47.332,24.688 -113.478,-8.521 -113.478,-8.521 0,0 15.919,-63.058 63.246,-87.757 47.337,-24.689 108.161,-1.674 108.161,-1.674 0,0 -10.598,73.253 -57.929,97.952 z"
id="path5"
inkscape:connector-curvature="0"
style="fill:#666666;fill-opacity:1" /></g><g
id="g7"
transform="translate(0,-560.40906)" /><g
id="g9"
transform="translate(0,-560.40906)" /><g
id="g11"
transform="translate(0,-560.40906)" /><g
id="g13"
transform="translate(0,-560.40906)" /><g
id="g15"
transform="translate(0,-560.40906)" /><g
id="g17"
transform="translate(0,-560.40906)" /><g
id="g19"
transform="translate(0,-560.40906)" /><g
id="g21"
transform="translate(0,-560.40906)" /><g
id="g23"
transform="translate(0,-560.40906)" /><g
id="g25"
transform="translate(0,-560.40906)" /><g
id="g27"
transform="translate(0,-560.40906)" /><g
id="g29"
transform="translate(0,-560.40906)" /><g
id="g31"
transform="translate(0,-560.40906)" /><g
id="g33"
transform="translate(0,-560.40906)" /><g
id="g35"
transform="translate(0,-560.40906)" /></svg>

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

@ -161,6 +161,9 @@
.vn-gui .welcome .vn-gui .welcome
{ {
display: block; display: block;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
} }
.vn-gui .supplant .vn-gui .supplant
{ {
@ -170,6 +173,12 @@
.vn-gui .supplant > span .vn-gui .supplant > span
{ {
font-size: 1.1em; font-size: 1.1em;
max-width: 10em;
display: inline-block;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
} }
.vn-gui .supplant > button .vn-gui .supplant > button
{ {

View File

@ -20,7 +20,7 @@ Vn.Gui = new Class
var sql = 'SELECT default_form, image_dir, image_host FROM config;' var sql = 'SELECT default_form, image_dir, image_host FROM config;'
+'SELECT production_domain, test_domain FROM config;' +'SELECT production_domain, test_domain FROM config;'
+'SELECT name FROM customer_account;' +'SELECT name FROM customer_user;'
+'CALL form_list ();'; +'CALL form_list ();';
this.conn.execQuery (sql, this.onMainQueryDone.bind (this)); this.conn.execQuery (sql, this.onMainQueryDone.bind (this));
}, },
@ -69,6 +69,9 @@ Vn.Gui = new Class
Vn.Cookie.set ('hedera_cookies', true); Vn.Cookie.set ('hedera_cookies', true);
Htk.Toast.showWarning (_('By using this site you accept cookies')); Htk.Toast.showWarning (_('By using this site you accept cookies'));
} }
if (Vn.Cookie.check ('hedera_supplant'))
this.supplantUser (Vn.Cookie.get ('hedera_supplant'));
} }
,show: function () ,show: function ()
@ -294,6 +297,8 @@ Vn.Gui = new Class
this.newVersionBlock = false; this.newVersionBlock = false;
} }
//++++++++++++++++++++++++++++++++++++++++++++++++++++++ Menu
,createMenu: function (res, sectionMap, parent, ul) ,createMenu: function (res, sectionMap, parent, ul)
{ {
var sections = sectionMap[parent]; var sections = sectionMap[parent];
@ -322,16 +327,16 @@ Vn.Gui = new Class
li.appendChild (submenu); li.appendChild (submenu);
li.addEventListener ('mouseover', li.addEventListener ('mouseover',
this.onLiMouseHover.bind (this, submenu, a)); this._onLiMouseHover.bind (this, submenu, a));
li.addEventListener ('mouseout', li.addEventListener ('mouseout',
this.onLiMouseOut.bind (this)); this._onLiMouseOut.bind (this));
this.createMenu (res, sectionMap, formId, submenu); this.createMenu (res, sectionMap, formId, submenu);
} }
} }
} }
,onLiMouseHover: function (submenu, parent) ,_onLiMouseHover: function (submenu, parent)
{ {
if (this.menuShown) if (this.menuShown)
return; return;
@ -345,7 +350,7 @@ Vn.Gui = new Class
submenu.style.top = rect.top +'px'; submenu.style.top = rect.top +'px';
} }
,onLiMouseOut: function () ,_onLiMouseOut: function ()
{ {
this.timeout = setTimeout (this.hideSubmenu.bind (this), 160); this.timeout = setTimeout (this.hideSubmenu.bind (this), 160);
} }
@ -365,6 +370,8 @@ Vn.Gui = new Class
} }
} }
//++++++++++++++++++++++++++++++++++++++++++++++++++++++ Forms
,_onFormChange: function () ,_onFormChange: function ()
{ {
var formPath = this.hashParam.value; var formPath = this.hashParam.value;
@ -460,6 +467,8 @@ Vn.Gui = new Class
} }
} }
//++++++++++++++++++++++++++++++++++++++++++++++++++++++ Reports
,openReport: function (reportName, batch) ,openReport: function (reportName, batch)
{ {
this.loaderPush (); this.loaderPush ();
@ -482,6 +491,8 @@ Vn.Gui = new Class
report.open (batch); report.open (batch);
} }
//++++++++++++++++++++++++++++++++++++++++++++++++++++++ Supplant
,supplantUser: function (userId, callback) ,supplantUser: function (userId, callback)
{ {
var batch = new Sql.Batch (); var batch = new Sql.Batch ();
@ -496,7 +507,7 @@ Vn.Gui = new Class
,_onUserSupplant: function (userId, callback, resultSet) ,_onUserSupplant: function (userId, callback, resultSet)
{ {
this._supplantClear (); this._supplantClear ();
this._supplanted = userId; Vn.Cookie.set ('hedera_supplant', userId);
resultSet.fetchResult (); resultSet.fetchResult ();
var userName = resultSet.fetchValue (); var userName = resultSet.fetchValue ();
@ -510,10 +521,10 @@ Vn.Gui = new Class
,_supplantClear: function () ,_supplantClear: function ()
{ {
if (this._supplanted) if (Vn.Cookie.check ('hedera_supplant'))
{ {
Vn.Node.hide (this.$('supplant')); Vn.Node.hide (this.$('supplant'));
this._supplanted = null; Vn.Cookie.unset ('hedera_supplant');
} }
} }
@ -529,6 +540,8 @@ Vn.Gui = new Class
this._onFormChange (); this._onFormChange ();
} }
//++++++++++++++++++++++++++++++++++++++++++++++++++++++ Destroy
,_destroy: function () ,_destroy: function ()
{ {
this.hide (); this.hide ();

View File

@ -84,6 +84,23 @@ p
margin: 0.8em 0; margin: 0.8em 0;
} }
/* Focus outline */
*:focus
{
outline: 1px solid rgba(1, 1, 1, 0.15);
-moz-outline-radius: .1em;
}
button::-moz-focus-inner
{
border: none;
}
select:focus
{
color: transparent;
text-shadow: 0 0 0 #333;
}
/* Inputs */ /* Inputs */
input[type=text], input[type=text],

View File

@ -346,6 +346,7 @@ Vn.Builder = new Class
,propCompile: function (context, klass, props, node, attribute, value) ,propCompile: function (context, klass, props, node, attribute, value)
{ {
var isLink = false;
var newValue = null; var newValue = null;
var propName = attribute.replace (/-./g, this._replaceFunc); var propName = attribute.replace (/-./g, this._replaceFunc);
var propInfo = klass.Properties[propName]; var propInfo = klass.Properties[propName];
@ -375,18 +376,20 @@ Vn.Builder = new Class
newValue = this._translateValue (value); newValue = this._translateValue (value);
break; break;
case Function: case Function:
newValue = this._getMethod (value).bind (this.signalData); var method = this._getMethod (value);
newValue = method ? method.bind (this.signalData) : null;
break; break;
default: default:
if (propInfo.enumType) if (propInfo.enumType)
newValue = propInfo.enumType[value]; newValue = propInfo.enumType[value];
break; else if (propInfo.type instanceof Function)
isLink = true;
} }
if (newValue !== null && newValue !== undefined) if (isLink)
props[propName] = newValue;
else if (propInfo.type instanceof Function)
this._addLink (context, propName, value); this._addLink (context, propName, value);
else if (newValue !== null && newValue !== undefined)
props[propName] = newValue;
else else
this._showError ('Attribute \'%s\' invalid for tag \'%s\'', this._showError ('Attribute \'%s\' invalid for tag \'%s\'',
attribute, node.tagName); attribute, node.tagName);