Fixes
gitea/hedera-web/pipeline/head This commit looks good Details

This commit is contained in:
Juan Ferrer 2022-06-07 10:19:29 +02:00
parent 7669dc0db0
commit d1819118d8
15 changed files with 122 additions and 98 deletions

2
debian/changelog vendored
View File

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

View File

@ -105,6 +105,8 @@ Hedera.Catalog = new Class({
for (const tag of tags) for (const tag of tags)
$[`${tag}s`].lot = this.getFilter(params, tags, tag); $[`${tag}s`].lot = this.getFilter(params, tags, tag);
if (lot) this.hideMenu();
} }
,refreshTitle: function() { ,refreshTitle: function() {

View File

@ -4,6 +4,9 @@
.title ._subtitle { .title ._subtitle {
font-size: .7rem; font-size: .7rem;
color: #bbb; color: #bbb;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
} }
/* Right panel */ /* Right panel */
@ -78,10 +81,10 @@
width: 25%; width: 25%;
padding: .6em; padding: .6em;
box-sizing: border-box; box-sizing: border-box;
border-radius: 50%;
} }
.right-panel .realms a:hover { .right-panel .realms a:hover {
background-color: rgba(1, 1, 1, .05); background-color: rgba(1, 1, 1, .05);
border-radius: .15em;
} }
.right-panel .realms a > img { .right-panel .realms a > img {
display: block; display: block;
@ -98,12 +101,9 @@
display: flex; display: flex;
box-sizing: border-box; box-sizing: border-box;
} }
.item-box > htk-image { .item-box > .htk-image {
flex: none; flex: none;
} }
.item-box > htk-image:hover {
background-color: transparent;
}
.item-box > .item-info { .item-box > .item-info {
flex: auto; flex: auto;
position: relative; position: relative;
@ -212,8 +212,8 @@
background-color: white; background-color: white;
flex-direction: column; flex-direction: column;
width: 240px; width: 260px;
height: 410px; height: 425px;
overflow: hidden; overflow: hidden;
} }
.grid-view .item-box:hover { .grid-view .item-box:hover {
@ -223,8 +223,8 @@
margin: 10px; margin: 10px;
} }
.grid-view .item-box > .htk-image { .grid-view .item-box > .htk-image {
width: 240px; width: 260px;
height: 240px; height: 260px;
} }
.grid-view .item-box > .item-info { .grid-view .item-box > .item-info {
flex: auto; flex: auto;
@ -254,7 +254,7 @@
gap: 10px; gap: 10px;
margin: 0; margin: 0;
padding: 10px; padding: 10px;
height: 120px; height: 130px;
overflow: visible; overflow: visible;
border-bottom: 1px solid #DDD; border-bottom: 1px solid #DDD;
} }
@ -262,15 +262,15 @@
border-bottom: none; border-bottom: none;
} }
.list-view .item-box > .htk-image { .list-view .item-box > .htk-image {
width: 100px; width: 110px;
height: 100px; height: 110px;
border-radius: 50%; border-radius: 50%;
} }
.list-view .item-info { .list-view .item-info {
overflow: hidden; overflow: hidden;
} }
.list-view .item-info > h2 { .list-view .item-info > h2 {
font-size: 1em; font-size: 1rem;
white-space: nowrap; white-space: nowrap;
} }
.list-view .item-info > .color { .list-view .item-info > .color {

View File

@ -49,9 +49,9 @@ $navbar-height: 64px;
flex: auto; flex: auto;
display: flex; display: flex;
align-items: center; align-items: center;
gap: 15px; gap: 12px;
overflow: hidden; overflow: hidden;
padding-left: 15px; padding-left: 12px;
& > .title { & > .title {
overflow: hidden; overflow: hidden;
@ -74,9 +74,9 @@ $navbar-height: 64px;
height: 100%; height: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
padding-right: $spacing-md; padding-right: 12px;
padding-left: $spacing-sm; padding-left: 4px;
gap: .5em; gap: 2px;
& > * { & > * {
float: right; float: right;
@ -84,7 +84,7 @@ $navbar-height: 64px;
} }
button { button {
margin: 0; margin: 0;
padding: 10px 15px; padding: 8px 13px;
&:hover { &:hover {
background-color: rgba(2550, 255, 255, .2); background-color: rgba(2550, 255, 255, .2);
@ -305,7 +305,7 @@ $navbar-height: 64px;
@media (max-width: 960px) { @media (max-width: 960px) {
& > .navbar { & > .navbar {
padding-left: 16px; padding-left: 12px;
left: 0; left: 0;
& > .menu-button { & > .menu-button {
@ -313,7 +313,7 @@ $navbar-height: 64px;
} }
& > .action-bar { & > .action-bar {
button { button {
padding: 10px; padding: 8px;
} }
span.label, span.label,
button > .text { button > .text {

View File

@ -21,9 +21,7 @@ module.exports = new Class({
,month: null ,month: null
,render: function() { ,render: function() {
var len = Vn.Date.WDays.length; this.createRoot('div');
var node = this.createRoot('div');
var table = this.createElement('table'); var table = this.createElement('table');
this.node.appendChild(table); this.node.appendChild(table);
@ -31,6 +29,7 @@ module.exports = new Class({
var colgroup = this.createElement('colgroup'); var colgroup = this.createElement('colgroup');
table.appendChild(colgroup); table.appendChild(colgroup);
var len = Vn.Date.WDays.length;
for (var i = 0; i < len; i++) for (var i = 0; i < len; i++)
colgroup.appendChild(this.createElement('col')); colgroup.appendChild(this.createElement('col'));

View File

@ -11,8 +11,6 @@ td.cell-button {
height: 44px; height: 44px;
width: 44px; width: 44px;
margin: 0 auto; margin: 0 auto;
border-radius: 50%;
padding: 10px;
border: none; border: none;
background-color: transparent; background-color: transparent;
box-sizing: border-box; box-sizing: border-box;

View File

@ -2,8 +2,8 @@ require('./style.scss');
var Component = require('vn/component'); var Component = require('vn/component');
module.exports = new Class({ module.exports = new Class({
Tag: 'htk-loader' Extends: Component
,Extends: Component ,Tag: 'htk-loader'
,Properties: { ,Properties: {
form: { form: {
type: Db.Form type: Db.Form

View File

@ -91,7 +91,7 @@ module.exports = new Class({
bg.addEventListener('mousedown', this._bgMouseDownHandler); bg.addEventListener('mousedown', this._bgMouseDownHandler);
Htk.Toast.pushTop(bg); Htk.Toast.pushTop(bg);
Vn.Node.addClass(this.node, 'modal'); this.node.classList.add('modal');
bg.appendChild(this.node); bg.appendChild(this.node);
this.doc.body.appendChild(bg); this.doc.body.appendChild(bg);
@ -125,26 +125,23 @@ module.exports = new Class({
style.height = ''; style.height = '';
style.width = ''; style.width = '';
var margin = 20; if (!this.isModal()) {
var dblMargin = margin * 2; var margin = 20;
var width = node.offsetWidth; var dblMargin = margin * 2;
var height = node.offsetHeight; var width = node.offsetWidth;
var innerWidth = window.innerWidth; var height = node.offsetHeight;
var innerHeight = window.innerHeight; var innerWidth = window.innerWidth;
var innerHeight = window.innerHeight;
if (width + dblMargin > innerWidth) { if (width + dblMargin > innerWidth) {
width = innerWidth - dblMargin; width = innerWidth - dblMargin;
style.width = width +'px'; style.width = width +'px';
} }
if (height + dblMargin > innerHeight) { if (height + dblMargin > innerHeight) {
height = innerHeight - dblMargin; height = innerHeight - dblMargin;
style.height = height +'px'; style.height = height +'px';
} }
if (this.isModal()) {
style.marginLeft = (-node.offsetWidth / 2) +'px';
style.marginTop = (-node.offsetHeight / 2) +'px';
} else {
var spacing = 4; var spacing = 4;
var rect = this._parent.getBoundingClientRect(); var rect = this._parent.getBoundingClientRect();
var left = rect.left; var left = rect.left;

View File

@ -10,10 +10,10 @@
box-sizing: content-box; box-sizing: content-box;
&.modal { &.modal {
position: absolute; position: relative;
font-size: 1.2em; font-size: 1.2em;
top: 50%; max-width: 100%;
left: 50%; max-height: 100%;
} }
& > * { & > * {
border-radius: 0.1em; border-radius: 0.1em;
@ -21,11 +21,15 @@
} }
.htk-background { .htk-background {
position: fixed; position: fixed;
display: flex;
align-items: center;
justify-content: center;
left: 0; left: 0;
right: 0; right: 0;
top: 0; top: 0;
bottom: 0; bottom: 0;
z-index: 190; z-index: 190;
padding: 20px;
background-color: rgba(1, 1, 1, 0.7); background-color: rgba(1, 1, 1, 0.7);
opacity: 0; opacity: 0;
transition: opacity 200ms ease-in-out; transition: opacity 200ms ease-in-out;

View File

@ -4,51 +4,51 @@
/* Standard */ /* Standard */
@media screen { @media screen {
body { font-size: 10pt; } body { font-size: 14px; }
} }
/* Desktop - Laptop 1360x768 */ /* Desktop - Laptop 1360x768 */
@media (max-resolution: 119dpi) and (min-device-width: 1340px) and (max-device-width: 1899px) { @media (max-resolution: 119dpi) and (min-device-width: 1340px) and (max-device-width: 1899px) {
body { font-size: 10pt; } body { font-size: 14px; }
} }
/* Desktop - FHD 1920x1080 */ /* Desktop - FHD 1920x1080 */
@media (max-resolution: 119dpi) and (min-device-width: 1900px) { @media (max-resolution: 119dpi) and (min-device-width: 1900px) {
body { font-size: 10pt; } body { font-size: 14px; }
} }
/* Mobile - Low DPI */ /* Mobile - Low DPI */
@media @media
(min-resolution: 120dpi), (min-resolution: 120dpi),
(-webkit-min-device-pixel-ratio: 1.5) { (-webkit-min-device-pixel-ratio: 1.5) {
body { font-size: 10pt; } body { font-size: 14px; }
} }
@media @media
(min-resolution: 144dpi), (min-resolution: 144dpi),
(-webkit-min-device-pixel-ratio: 1.5) { (-webkit-min-device-pixel-ratio: 1.5) {
body { font-size: 10pt; } body { font-size: 14px; }
} }
/* Mobile - Normal DPI */ /* Mobile - Normal DPI */
@media @media
(max-device-width: 383px) and (min-resolution: 192dpi), (max-device-width: 383px) and (min-resolution: 192dpi),
(max-device-width: 383px) and (-webkit-min-device-pixel-ratio: 2) { (max-device-width: 383px) and (-webkit-min-device-pixel-ratio: 2) {
body { font-size: 10pt; } body { font-size: 14px; }
} }
@media @media
(min-device-width: 384px) and (min-resolution: 192dpi), (min-device-width: 384px) and (min-resolution: 192dpi),
(min-device-width: 384px) and (-webkit-min-device-pixel-ratio: 2) { (min-device-width: 384px) and (-webkit-min-device-pixel-ratio: 2) {
body { font-size: 10pt; } body { font-size: 14px; }
} }
/* Mobile - High DPI */ /* Mobile - High DPI */
@media @media
(max-device-width: 411px) and (min-resolution: 249dpi), (max-device-width: 411px) and (min-resolution: 249dpi),
(max-device-width: 411px) and (-webkit-min-device-pixel-ratio: 3) { (max-device-width: 411px) and (-webkit-min-device-pixel-ratio: 3) {
body { font-size: 10pt; } body { font-size: 14px; }
} }
@media @media
(min-device-width: 412px) and (min-resolution: 249dpi), (min-device-width: 414px) and (min-resolution: 249dpi),
(min-device-width: 412px) and (-webkit-min-device-pixel-ratio: 3) { (min-device-width: 414px) and (-webkit-min-device-pixel-ratio: 3) {
body { font-size: 10pt; } body { font-size: 14px; }
} }

View File

@ -170,9 +170,8 @@ button,
@extend %clickable; @extend %clickable;
border: none; border: none;
background-color: transparent; background-color: transparent;
padding: 10px; padding: 8px;
border-radius: 22px; border-radius: 22px;
margin: -0.5em;
font-weight: normal; font-weight: normal;
&:disabled { &:disabled {

View File

@ -186,7 +186,7 @@ module.exports = new Class({
return scope; return scope;
} }
,link: function(scope, exprScope) { ,link: function(scope) {
const objects = scope.objects; const objects = scope.objects;
const links = this._links; const links = this._links;
@ -211,30 +211,22 @@ module.exports = new Class({
// Post-link // Post-link
const baseExprScope = [
_,
scope.$
].concat(exprScope);
this.linkExpr(scope, baseExprScope);
const contexts = this._contexts; const contexts = this._contexts;
for (var i = 0; i < contexts.length; i++) { for (var i = 0; i < contexts.length; i++) {
const context = contexts[i]; const context = contexts[i];
const object = objects[i]; const object = objects[i];
if (context.tagName) if (context.tagName)
this.elementLink(context, object, objects, scope, baseExprScope); this.elementLink(context, object, objects, scope);
else if (context.klass) else if (context.klass)
this.objectLink(context, object, objects, scope, baseExprScope); this.objectLink(context, object, objects, scope);
} }
} }
,linkExpr(scope, baseScope, exprScope) { ,digest(scope) {
const contexts = this._contexts; const contexts = this._contexts;
const objects = scope.objects; const objects = scope.objects;
const exprScope = scope.exprScope;
exprScope = baseScope.concat(exprScope);
for (let i = 0; i < contexts.length; i++) { for (let i = 0; i < contexts.length; i++) {
const context = contexts[i]; const context = contexts[i];
@ -242,10 +234,16 @@ module.exports = new Class({
if (context.exprs) { if (context.exprs) {
const values = []; const values = [];
let isEmpty = false;
for (expr of context.exprs) { for (expr of context.exprs) {
let value = undefined; let value = undefined;
try { try {
value = expr.apply(scope.thisArg, exprScope); value = expr.apply(scope.thisArg, exprScope);
if (value == null) {
isEmpty = true;
break;
}
} catch (e) { } catch (e) {
console.warn('Expression error:', e.message); console.warn('Expression error:', e.message);
continue; continue;
@ -253,10 +251,16 @@ module.exports = new Class({
values.push(value); values.push(value);
} }
let k = 0; let text;
const text = context.text.replace(/{{\d+}}/g, function() {
return values[k++]; if (!isEmpty) {
}); let k = 0;
text = context.text.replace(/{{\d+}}/g, function() {
return values[k++];
});
} else
text = '';
object.textContent = text; object.textContent = text;
} else { } else {
const dynProps = context.dynProps; const dynProps = context.dynProps;
@ -524,7 +528,7 @@ module.exports = new Class({
return object; return object;
} }
,objectLink: function(context, object, objects, scope, exprScope) { ,objectLink: function(context, object, objects, scope) {
const objectProps = context.objectProps; const objectProps = context.objectProps;
for (const prop in objectProps) for (const prop in objectProps)
object[prop] = objects[objectProps[prop]]; object[prop] = objects[objectProps[prop]];
@ -546,7 +550,7 @@ module.exports = new Class({
method = method.bind(scope.thisArg); method = method.bind(scope.thisArg);
} else { } else {
method = function() { method = function() {
handler.apply(scope.thisArg, exprScope); handler.apply(scope.thisArg, scope.exprScope);
}; };
} }
@ -566,7 +570,7 @@ module.exports = new Class({
this.showError(`Function '${handler}' not found`); this.showError(`Function '${handler}' not found`);
} else { } else {
listener = function() { listener = function() {
handler.apply(scope.thisArg, exprScope.concat(arguments)); handler.apply(scope.thisArg, scope.exprScope.concat(arguments));
}; };
} }
@ -641,7 +645,7 @@ module.exports = new Class({
return object; return object;
} }
,elementLink: function(context, object, objects, scope, exprScope) { ,elementLink: function(context, object, objects, scope) {
const childs = context.childs; const childs = context.childs;
for (var i = 0; i < childs.length; i++) { for (var i = 0; i < childs.length; i++) {
let child = objects[childs[i]]; let child = objects[childs[i]];
@ -664,7 +668,7 @@ module.exports = new Class({
listener = listener.bind(scope.thisArg); listener = listener.bind(scope.thisArg);
} else { } else {
listener = function(e) { listener = function(e) {
handler.apply(scope.thisArg, exprScope.concat(e)); handler.apply(scope.thisArg, scope.exprScope.concat(e));
}; };
} }

View File

@ -10,12 +10,14 @@ module.exports = new Class({
this.builder = builder; this.builder = builder;
this.objects = objects; this.objects = objects;
this.thisArg = thisArg; this.thisArg = thisArg;
this.parentScope = parent; this.parent = parent;
this.uid = ++scopeUid; this.uid = ++scopeUid;
this.$ = parent ? Object.create(parent.$) : {}; this.$ = parent ? Object.create(parent.$) : {};
if (!thisArg && parent) if (parent) {
this.thisArg = parent.thisArg; parent.on('lot-change', this.onLotChange, this);
if (!thisArg) this.thisArg = parent.thisArg;
}
} }
,link: function(exprScope, extraObjects) { ,link: function(exprScope, extraObjects) {
@ -26,7 +28,22 @@ module.exports = new Class({
for (var id in contextMap) for (var id in contextMap)
this.$[id] = this.objects[contextMap[id]]; this.$[id] = this.objects[contextMap[id]];
this.builder.link(this, exprScope); this.exprScope = [
_,
this.$
].concat(exprScope);
this.builder.link(this);
this.builder.digest(this);
for (const object of this.objects)
if (object.assignLot)
object.on('change', this.onLotChange, this);
}
,onLotChange() {
this.emit('lot-change');
this.builder.digest(this);
} }
,getMain: function() { ,getMain: function() {
@ -47,11 +64,15 @@ module.exports = new Class({
} }
,_destroy: function() { ,_destroy: function() {
var objects = this.objects; for (const object of this.objects)
if (object instanceof VnObject) {
for (var i = 0; i < objects.length; i++) object.disconnectByInstance(this);
if (objects[i] instanceof VnObject) object.unref();
objects[i].unref(); }
if (this.parent) {
this.parent.disconnectByInstance(this);
this.parent.unref();
}
VnObject.prototype._destroy.call(this); VnObject.prototype._destroy.call(this);
} }

View File

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