#3894 Display minimal grouping, php8.1 compatibility fixes
gitea/hedera-web/pipeline/head This commit looks good Details

This commit is contained in:
Juan Ferrer 2022-04-13 13:31:52 +02:00
parent 2fe78cfc0e
commit 188181b114
16 changed files with 83 additions and 52 deletions

View File

@ -31,7 +31,7 @@ RUN apt-get update \
&& apt-get install -y --no-install-recommends \
php-image-text \
php-text-captcha \
php-apcu-bc \
php-apcu \
php-zip \
hedera-web \
cron

2
debian/changelog vendored
View File

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

4
debian/control vendored
View File

@ -9,8 +9,8 @@ Vcs-Git: https://git.verdnatura.es/hedera-web
Package: hedera-web
Architecture: all
Depends: apache2 | httpd, nodejs, php-cli, php-vn-lib, php-apcu, php-ldap, php-ssh2, php-imap, php-soap, libphp-phpmailer, php-gd, php-pear
Suggests: php-text-captcha, cron
Depends: apache2 | httpd, nodejs, php-cli, php-vn-lib, php-apcu, php-imap, php-soap, libphp-phpmailer, php-gd, php-pear
Suggests: php-text-captcha, php-zip, cron
Section: misc
Priority: optional
Description: Verdnatura's web page

1
debian/postinst vendored
View File

@ -10,7 +10,6 @@ then
. /usr/share/apache2/apache2-maintscript-helper
apache2_invoke enmod rewrite
apache2_invoke enmod headers
apache2_invoke enmod authnz_ldap
apache2_invoke enconf hedera-web.conf
fi

View File

@ -227,14 +227,20 @@ Hedera.Catalog = new Class({
this.hash.set({'form': 'ecomerce/checkout'});
}
,onAddItemClick: function(button, form) {
if (this.isGuest())
return;
,repeaterFunc: function(res, form) {
res.$('item-box').addEventListener('click',
this.onAddItemClick.bind(this, form));
}
,onAddItemClick: function(form, event) {
if (event.defaultPrevented) return;
event.preventDefault();
if (this.isGuest()) return;
this.onEraseClick();
this.$('card').row = form.row;
this.$('card-item').value = form.get('id');
this.$('card-popup').show(button.node);
this.$('card-popup').show(event.currentTarget);
}
,onAddLotClick: function(column, value, row) {

View File

@ -43,3 +43,6 @@ Confirm: Confirmar
IndicativePhotos: '* Les fotos són orientatives'
Added%dOf%s: Afegits %d de %s
NoMoreAmountAvailable: No hi ha més quantitat disponible
MinimalGrouping: Empaquetat mínim
Available: Disponible
GroupingPrice: Preu per grup

View File

@ -43,3 +43,6 @@ Confirm: Confirm
IndicativePhotos: '* Photos are indicative'
Added%dOf%s: Added %d of %s
NoMoreAmountAvailable: No more amount available
MinimalGrouping: Minimal packing
Available: Available
GroupingPrice: Price per group

View File

@ -43,3 +43,6 @@ Confirm: Confirmar
IndicativePhotos: '* Las fotos son orientativas'
Added%dOf%s: Añadidos %d de %s
NoMoreAmountAvailable: No hay más cantidad disponible
MinimalGrouping: Empaquetado mínimo
Available: Disponible
GroupingPrice: Precio per grupo

View File

@ -43,3 +43,6 @@ Confirm: Confirmer
IndicativePhotos: '* Photos sont indicatifs'
Added%dOf%s: Ajouté %d %s
NoMoreAmountAvailable: Pas plus disponible
MinimalGrouping: Emballage minimal
Available: Disponible
GroupingPrice: Prix par groupe

View File

@ -43,3 +43,6 @@ Confirm: Confirmar
IndicativePhotos: '* As Fotos São Orientativas'
Added%dOf%s: Adicionados %d de %s
NoMoreAmountAvailable: Não há mais quantidade disponível
MinimalGrouping: Embalagem mínima
Available: Disponível
GroupingPrice: Preço por grupo

View File

@ -140,6 +140,15 @@
/* Items */
.item-box
{
transition: background-color 200ms ease-in;
}
.item-box:hover
{
cursor: pointer;
background-color: #eee;
}
.item-info
{
position: relative;
@ -193,16 +202,34 @@
.item-info .available-price
{
white-space: nowrap;
font-size: .95em;
text-align: right;
align-items: middle;
column-gap: .2em;
display: flex;
}
.item-info .price-label
.item-info .available-price > *
{
font-size: .8em;
font-style: italic;
border-radius: .2em;
padding: .3em;
border: .1em transparent solid;
}
.item-info .grouping
{
width: 2em;
background-color: #ddd;
}
.item-info .available
{
width: 3.3em;
border-color: #bbb;
color: #777;
}
.item-info .price
{
color: green;
font-size: 1.1em;
width: 4em;
border-color: #9cbc28;
color: #748c1e;
}
.tags
{
@ -275,7 +302,7 @@
{
clear: both;
float: right;
padding-top: 1.2em;
padding-top: 2.2em;
}
.list-view .item-info .tags
{
@ -334,26 +361,11 @@
bottom: 0;
margin: .6em;
}
.grid-view .item-info .add-button
{
position: absolute;
bottom: 0;
right: 0;
}
.grid-view .item-info .available-price
{
position: absolute;
bottom: 0;
right: 2em;
}
.grid-view .item-info .available
{
display: inline-block;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
max-width: 4em;
vertical-align: bottom;
right: 0;
}
.grid-view .item-info .tags td {
overflow: hidden;

View File

@ -64,7 +64,8 @@
i.tag5, i.value5, i.tag6, i.value6, i.tag7, i.value7,
i.relevancy, i.size, i.category,
k.name ink, p.name producer, o.name origin,
b.available, b.price, i.image, im.updated
b.available, b.price, b.`grouping`,
i.image, im.updated
FROM tmp.ticketCalculateItem b
JOIN vn.item i ON i.id = b.itemFk
LEFT JOIN vn.ink k ON k.id = i.inkFk
@ -113,9 +114,13 @@
id="grid-view"
empty-message="_Choose filter from right menu"
form-id="item"
model="items-model">
model="items-model"
renderer="repeaterFunc">
<custom>
<div class="box item-box">
<div
id="item-box"
class="box item-box"
title="_AddToBasket">
<htk-image
directory="catalog"
subdir="200x200"
@ -124,21 +129,14 @@
stamp-column="updated"
full-dir="1600x900"/>
<div class="item-info">
<htk-button
form="item"
column="id"
tip="_AddToBasket"
icon="add"
on-click="onAddItemClick"
class="add-button"/>
<div class="available-price">
<span class="available">
<span class="grouping" title="_MinimalGrouping">
<htk-text form="item" column="grouping" format="x%.0d"/>
</span>
<span class="available" title="Available">
<htk-text form="item" column="available"/>
</span>
<span class="price-label">
<t>por</t>
</span>
<span class="price">
<span class="price" title="_GroupingPrice">
<htk-text form="item" column="price" format="%.2d€"/>
</span>
</div>

View File

@ -161,10 +161,11 @@ module.exports = new Class({
this._error = true;
}
,_onClick: function() {
,_onClick: function(event) {
if (!this._fullDir || !this._value || this._error)
return;
event.preventDefault();
(new Htk.FullImage()).show(this._makeSrc(this._fullDir));
}

View File

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

View File

@ -32,7 +32,7 @@ class JsonService extends RestService {
echo json_encode($reply);
}
function errorHandler($errno, $message, $file, $line, $context) {
function errorHandler($errno, $message, $file, $line, $context = null) {
$eUserWarn =
E_USER_NOTICE
| E_USER_WARNING

View File

@ -279,7 +279,7 @@ abstract class Service {
*/
function getVersion() {
$appName = $this->app->getName();
$version = apc_fetch("$appName.version", $success);
$version = apcu_fetch("$appName.version", $success);
if (!$success) {
if (file_exists('package.json')) {
@ -288,7 +288,7 @@ abstract class Service {
} else
$version = '0.0.0';
apc_store("$appName.version", $version);
apcu_store("$appName.version", $version);
}
return $version;