New longName/tags system, bigger images on zoom

This commit is contained in:
Juan 2018-07-20 16:30:29 +02:00
parent 1395532b6c
commit acd0a0025e
9 changed files with 167 additions and 149 deletions

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
hedera-web (1.406.13) stable; urgency=low hedera-web (1.406.14) stable; urgency=low
* Initial Release. * Initial Release.

View File

@ -15,11 +15,11 @@
<htk-repeater form-id="iter" empty-message="_Enter a search term"> <htk-repeater form-id="iter" empty-message="_Enter a search term">
<db-model property="model"> <db-model property="model">
<custom> <custom>
SELECT Id_Article, Article, Medida, Categoria, Foto SELECT id, longName, size, category, image
FROM vn2008.Articles FROM vn.item
WHERE Article LIKE CONCAT('%', #filter, '%') WHERE longName LIKE CONCAT('%', #filter, '%')
OR Id_Article = #filter OR id = #filter
ORDER BY Article LIMIT 50 ORDER BY longName LIMIT 50
</custom> </custom>
<sql-batch property="batch"> <sql-batch property="batch">
<custom> <custom>
@ -31,23 +31,23 @@
<div class="row"> <div class="row">
<htk-image <htk-image
form="iter" form="iter"
column="Foto" column="image"
class="photo" class="photo"
directory="catalog" directory="catalog"
subdir="200x200" subdir="200x200"
full-dir="900x900" full-dir="1600x900"
editable="true" editable="true"
conn="conn"/> conn="conn"/>
<p class="concept"> <p class="concept">
<htk-text form="iter" column="Article"/> <htk-text form="iter" column="longName"/>
<htk-text form="iter" column="Medida"/> <htk-text form="iter" column="size"/>
<htk-text form="iter" column="Categoria"/> <htk-text form="iter" column="category"/>
</p> </p>
<p> <p>
<htk-text form="iter" column="Id_Article"/> <htk-text form="iter" column="id"/>
</p> </p>
<p> <p>
<htk-text form="iter" column="Foto"/> <htk-text form="iter" column="image"/>
</p> </p>
<div class="clear"/> <div class="clear"/>
</div> </div>

View File

@ -29,11 +29,10 @@
<div class="lines"> <div class="lines">
<htk-repeater form-id="iter" renderer="repeaterFunc"> <htk-repeater form-id="iter" renderer="repeaterFunc">
<db-model id="items" property="model" updatable="true"> <db-model id="items" property="model" updatable="true">
SELECT bi.id, bi.amount, bi.price, i.name item, i.image, SELECT bi.id, bi.amount, bi.price, i.longName item, i.image,
t.tag1, t.val1, t.tag2, t.val2, t.tag3, t.val3 i.tag5, i.value5, i.tag6, i.value6, i.tag7, i.value7
FROM myBasketItem bi FROM myBasketItem bi
JOIN vn.item i ON i.id = bi.itemFk JOIN vn.item i ON i.id = bi.itemFk
LEFT JOIN vn.itemTagArranged t ON t.itemFk = i.id
</db-model> </db-model>
<custom> <custom>
<div class="line"> <div class="line">
@ -50,18 +49,18 @@
class="photo" class="photo"
directory="catalog" directory="catalog"
subdir="200x200" subdir="200x200"
full-dir="900x900"/> full-dir="1600x900"/>
<div class="info"> <div class="info">
<h2> <h2>
<htk-text form="iter" column="item"/> <htk-text form="iter" column="item"/>
</h2> </h2>
<p class="tags"> <p class="tags">
<htk-text form="iter" column="tag1"/> <htk-text form="iter" column="tag5"/>
<htk-text form="iter" column="val1"/>, <htk-text form="iter" column="value5"/>,
<htk-text form="iter" column="tag2"/> <htk-text form="iter" column="tag6"/>
<htk-text form="iter" column="val2"/>, <htk-text form="iter" column="value6"/>,
<htk-text form="iter" column="tag3"/> <htk-text form="iter" column="tag7"/>
<htk-text form="iter" column="val3"/> <htk-text form="iter" column="value7"/>
</p> </p>
<p class="amount"> <p class="amount">
<htk-text form="iter" column="amount"/> x <htk-text form="iter" column="amount"/> x

View File

@ -188,7 +188,7 @@
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
} }
.item-info .producer .item-info .sub-name
{ {
text-transform: uppercase; text-transform: uppercase;
font-weight: bold; font-weight: bold;
@ -201,95 +201,26 @@
position: absolute; position: absolute;
bottom: 0; bottom: 0;
} }
.catalog .item-info > .htk-button .item-info > .htk-button
{ {
margin: -0.3em; margin: -0.3em;
padding: .3em; padding: .3em;
} }
.catalog .item-info > .htk-button > img .item-info > .htk-button > img
{ {
vertical-align: middle; vertical-align: middle;
} }
.tags
/* Card */
.card-popup
{ {
overflow: auto; font-size: .8em;
} display: table;
.item-card color: #333;
{
font-size: .9em;
width: 20em;
}
.item-card .top
{
padding: 1em;
}
.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: 0;
margin-top: 1em; width: auto;
font-size: .9em;
} }
.item-card .tags .tags td:first-child {
{ color: #999;
font-size: .9em; padding-right: .6em;
color: #777;
margin: 0;
padding-top: .5em;
}
.item-card .tags p
{
margin: 0;
}
.item-card .lots-grid
{
border-top: 1px solid #DDD;
}
.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 */ /* List view */
@ -353,6 +284,10 @@
{ {
margin-right: 0; margin-right: 0;
} }
.list-view .item-info .tags .extra
{
display: none;
}
/* Grid view */ /* Grid view */
@ -404,6 +339,86 @@
{ {
float: right; float: right;
} }
.grid-view .item-info .tags
{
position: absolute;
top: 4em;
}
.grid-view .item-info .tags td {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
max-width: 6em;
width: 6em;
}
/* Card */
.card-popup
{
overflow: auto;
}
.item-card
{
font-size: .9em;
width: 20em;
}
.item-card .top
{
padding: 1em;
}
.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-top: 1em 0;
font-size: .9em;
}
.item-card .lots-grid
{
border-top: 1px solid #DDD;
}
.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;
}
/* Mobile */ /* Mobile */

View File

@ -20,7 +20,7 @@
<sql-value id="type-value"/> <sql-value id="type-value"/>
</sql-filter-item> </sql-filter-item>
<sql-filter-item type="LIKE" id="op-name"> <sql-filter-item type="LIKE" id="op-name">
<sql-field target="i" name="name"/> <sql-field target="i" name="longName"/>
<sql-search-tags param="search"/> <sql-search-tags param="search"/>
</sql-filter-item> </sql-filter-item>
<sql-filter-item type="EQUAL" id="op-color"> <sql-filter-item type="EQUAL" id="op-color">
@ -60,16 +60,11 @@
JOIN vn.itemType t ON t.id = i.typeFk JOIN vn.itemType t ON t.id = i.typeFk
WHERE #filter; WHERE #filter;
CALL bionic_calc; CALL bionic_calc;
SELECT i.id, i.description, i.image, i.name item, i.category, i.size, SELECT i.id, i.description, i.image, i.longName item,
b.producer, b.available, b.price, i.subName, i.tag5, i.value5, i.tag6, i.value6, i.tag7, i.value7,
IF(i.stems > 1, i.stems, NULL) stems, c.name color, o.name origin, b.available, b.price
t.tag1, t.val1, t.tag2, t.val2, t.tag3, t.val3
FROM tmp.bionic_item b FROM tmp.bionic_item b
JOIN vn.item i ON i.id = b.item_id JOIN vn.item i ON i.id = b.item_id
LEFT JOIN vn.itemTagArranged t ON t.itemFk = i.id
LEFT JOIN vn.producer p ON p.id = i.producerFk
LEFT JOIN vn.inkL10n c ON c.id = i.inkFk
LEFT JOIN vn.originL10n o ON o.id = i.originFk
WHERE b.available > 0 WHERE b.available > 0
ORDER BY i.relevancy DESC, i.name, i.size ORDER BY i.relevancy DESC, i.name, i.size
LIMIT 400; LIMIT 400;
@ -118,7 +113,7 @@
subdir="200x200" subdir="200x200"
form="item" form="item"
column="image" column="image"
full-dir="900x900"/> full-dir="1600x900"/>
<div class="item-info"> <div class="item-info">
<htk-button <htk-button
form="item" form="item"
@ -130,19 +125,23 @@
<h2> <h2>
<htk-text form="item" column="item"/> <htk-text form="item" column="item"/>
</h2> </h2>
<p class="producer"> <p class="sub-name">
<htk-text form="item" column="producer"/> <htk-text form="item" column="subName"/>
</p>
<p>
<htk-text form="item" column="tag1"/> <htk-text form="item" column="val1"/>,
<htk-text form="item" column="tag2"/> <htk-text form="item" column="val2"/>
</p>
<p class="color">
<htk-text form="item" column="tag3"/> <htk-text form="item" column="val3"/>
</p>
<p class="color">
<htk-text form="item" column="stems" format="_%.0d Units"/>
</p> </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>
<div class="aval-price"> <div class="aval-price">
<htk-text form="item" column="available"/> <htk-text form="item" column="available"/>
<span class="from"> <span class="from">
@ -386,15 +385,15 @@
subdir="200x200" subdir="200x200"
form="card" form="card"
column="image" column="image"
full-dir="900x900" full-dir="1600x900"
conn="conn" conn="conn"
editable="true"/> editable="true"/>
<div class="item-info"> <div class="item-info">
<h2> <h2>
<htk-text form="card" column="item"/> <htk-text form="card" column="item"/>
</h2> </h2>
<p class="producer"> <p class="sub-name">
<htk-text form="card" column="producer"/> <htk-text form="card" column="subName"/>
</p> </p>
<p> <p>
@<htk-text form="card" column="id"/> @<htk-text form="card" column="id"/>
@ -416,12 +415,14 @@
JOIN vn.tag t ON t.id = it.tagFk JOIN vn.tag t ON t.id = it.tagFk
JOIN vn.tagL10n l ON l.id = t.id JOIN vn.tagL10n l ON l.id = t.id
WHERE it.itemFk = #item WHERE it.itemFk = #item
AND priority >= 0
ORDER BY it.priority ORDER BY it.priority
</db-model> </db-model>
<custom> <custom>
<p> <tr>
<htk-text form="tag" column="name"/> <htk-text form="tag" column="value"/> <td><htk-text form="tag" column="name"/></td>
</p> <td><htk-text form="tag" column="value"/></td>
</tr>
</custom> </custom>
</htk-repeater> </htk-repeater>
</div> </div>

View File

@ -78,18 +78,18 @@
class="photo" class="photo"
directory="catalog" directory="catalog"
subdir="200x200" subdir="200x200"
full-dir="900x900"/> full-dir="1600x900"/>
<div class="info"> <div class="info">
<h2> <h2>
<htk-text form="iter" column="concept"/> <htk-text form="iter" column="concept"/>
</h2> </h2>
<p class="tags"> <p class="tags">
<htk-text form="iter" column="tag1"/> <htk-text form="iter" column="tag5"/>
<htk-text form="iter" column="val1"/>, <htk-text form="iter" column="value5"/>,
<htk-text form="iter" column="tag2"/> <htk-text form="iter" column="tag6"/>
<htk-text form="iter" column="val2"/>, <htk-text form="iter" column="value6"/>,
<htk-text form="iter" column="tag3"/> <htk-text form="iter" column="tag7"/>
<htk-text form="iter" column="val3"/> <htk-text form="iter" column="value7"/>
</p> </p>
<p class="amount"> <p class="amount">
<htk-text form="iter" column="quantity"/> x <htk-text form="iter" column="quantity"/> x
@ -118,7 +118,7 @@
class="photo" class="photo"
directory="catalog" directory="catalog"
subdir="200x200" subdir="200x200"
full-dir="900x900"/> full-dir="1600x900"/>
<p class="subtotal"> <p class="subtotal">
<htk-text form="iter" column="quantity"/> <htk-text form="iter" column="quantity"/>
</p> </p>

View File

@ -1,6 +1,6 @@
{ {
"name": "hedera-web", "name": "hedera-web",
"version": "1.406.13", "version": "1.406.14",
"description": "Verdnatura web page", "description": "Verdnatura web page",
"license": "GPL-3.0", "license": "GPL-3.0",
"repository": { "repository": {

View File

@ -1,6 +1,6 @@
<?php <?php
require_once(__DIR__.'/lib.php'); require_once(__DIR__.'/image.php');
/** /**
* Resizes all images allocated in a directory. * Resizes all images allocated in a directory.
@ -22,11 +22,8 @@ class Resize extends Vn\Lib\Method {
,'symbolic' ,'symbolic'
]; ];
function run() { function run($db) {
$options = getopt('', $params); $options = getopt('', self::PARAMS);
if (!$this->checkParams($options, self::PARAMS))
$this->usage();
$srcDir = $options['srcDir']; $srcDir = $options['srcDir'];
$dstDir = $options['dstDir']; $dstDir = $options['dstDir'];
@ -35,6 +32,7 @@ class Resize extends Vn\Lib\Method {
$rewrite = isset($options['rewrite']); $rewrite = isset($options['rewrite']);
$crop = isset($options['crop']); $crop = isset($options['crop']);
$symbolic = isset($options['symbolic']); $symbolic = isset($options['symbolic']);
$verbose = isset($options['verbose']);
set_time_limit(0); set_time_limit(0);
@ -49,7 +47,12 @@ class Resize extends Vn\Lib\Method {
if (!file_exists($dstFile) || $rewrite) if (!file_exists($dstFile) || $rewrite)
try { try {
$symbolicSrc =($symbolic) ? $srcFile : NULL; $symbolicSrc = $symbolic ? $srcFile : NULL;
if ($verbose) {
echo "SRC: $srcFile\n";
echo "DST: $dstFile\n";
}
$image = Image::create($srcFile); $image = Image::create($srcFile);
Image::resizeSave($image, $dstFile, $maxHeight, $maxWidth, $crop, $symbolicSrc); Image::resizeSave($image, $dstFile, $maxHeight, $maxWidth, $crop, $symbolicSrc);

View File

@ -31,7 +31,7 @@ class Sync extends Vn\Lib\Method {
if ($dir) if ($dir)
while ($schema = readdir($dir)) while ($schema = readdir($dir))
if (!in_array($schema, ['.', '..'])) { if (!in_array($schema, ['.', '..'])) {
$info = $this->loadInfo($schema); $info = $this->util->loadInfo($schema);
$schemaPath = "{$this->dataDir}/$schema"; $schemaPath = "{$this->dataDir}/$schema";
// Deletes unreferenced schemas. // Deletes unreferenced schemas.
@ -105,7 +105,7 @@ class Sync extends Vn\Lib\Method {
* @param string $file The file to move to the trash * @param string $file The file to move to the trash
*/ */
function moveTrash($file) { function moveTrash($file) {
$trashBasedir = "{$this->dataDir}/.trash/". $this->$trashSubdir; $trashBasedir = "{$this->dataDir}/.trash/". $this->trashSubdir;
$trashdir = "$trashBasedir/". dirname($file); $trashdir = "$trashBasedir/". dirname($file);
if (!is_dir($trashdir)) if (!is_dir($trashdir))