0
1
Fork 0

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.

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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