- Impostato i Font giusti e la corretta disposizione del testo e dei suoi margini.

- L'immagine del libro, se è piccolo, viene adattato alla dimensione fissa (vedere se va bene).
This commit is contained in:
Surya Paolo
2024-11-24 14:40:21 +01:00
parent 479934a8fb
commit a42c365052
6 changed files with 37 additions and 44880 deletions

1
docs/test.htm Normal file
View File

@@ -0,0 +1 @@
<div class="row align-start" style="gap:0px;flex-direction:column;flex:1;display:flex;justify-content:space-between;"><!-- Parte superiore --><div class="justify-start" style="flex-grow:0"><span style="font-size:calc(12 * var(--scalecatalog) * 1px)" class="book-author">{autore}</span><div style="font-size:calc(16 * var(--scalecatalog) * 1px);font-weight:bold;" class="book-title">{titolo}</div><span class="book-descr">{descrizione}</span></div><!-- Parte inferiore (book-details e barcode) --><div style="margin-top:auto;width:100%"><div class="justify-end book-details" style="flex-grow:0;font-size:calc(10 * var(--scalecatalog) * 1px);">Pagine: <b>{pagine}</b><br />Formato: <b>{misure}</b><br />Prezzo: <b>{prezzo} €</b><br /></div></div></div>

44879
docs/test.js

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

View File

@@ -334,6 +334,37 @@ MyElemSchema.statics.findAllIdApp = async function (idapp) {
return await MyElem.find(myfind).sort({ order: 1 });
};
MyElemSchema.statics.findallSchedeTemplate = async function (idapp) {
const MyElem = this;
try {
const ris = await MyElem.find({ idapp });
// Estrai le schede che hanno isTemplate = true
const schedeTemplate = ris.flatMap(elem =>
elem.catalogo && elem.catalogo.arrSchede ? elem.catalogo.arrSchede.filter(scheda => scheda.scheda.isTemplate) : []
);
/*
// Trova tutti i documenti in cui idapp corrisponde e contiene schede con isTemplate = true
const ris = await MyElem.find(
{ idapp },
{ 'catalogo.arrSchede': { $elemMatch: { isTemplate: true } } }
).populate('catalogo.arrSchede');
// Estrai solo le schede che hanno isTemplate = true
const schedeTemplate = ris.flatMap(elem =>
elem.catalogo.arrSchede.filter(scheda => scheda.isTemplate)
);
*/
return schedeTemplate;
} catch (e) {
console.error('Err', e);
}
};
const MyElem = mongoose.model('MyElem', MyElemSchema);
MyElem.createIndexes((err) => {

View File

@@ -17,6 +17,7 @@ const ISize = new Schema({
width: { type: String },
height: { type: String },
fit: { type: String },
gap: { type: String },
});
const IFont = new Schema({
name: { type: String },
@@ -66,6 +67,7 @@ const IBarCode = new Schema(
format: Number,
size: ISize,
font: IFont,
widthlines: Number,
}
);

View File

@@ -44,7 +44,6 @@ const { Contribtype } = require('../models/contribtype');
const { PaymentType } = require('../models/paymenttype');
const { Discipline } = require('../models/discipline');
const { MyElem } = require('../models/myelem');
const { MySCheda } = require('../models/myscheda');
const { Skill } = require('../models/skill');
const { Good } = require('../models/good');
const { StatusSkill } = require('../models/statusSkill');
@@ -1543,6 +1542,7 @@ function load(req, res, version) {
const paymenttype = PaymentType.findAllIdApp(idapp);
const disciplines = Discipline.findAllIdApp(idapp);
const myelems = MyElem.findAllIdApp(idapp);
const myschedas = MyElem.findallSchedeTemplate(idapp);
const settings = Settings.findAllIdApp(idapp, false, false);
const permissions = Permission.findAllIdApp();
@@ -1684,6 +1684,7 @@ function load(req, res, version) {
catAI,
authors,
publishers,
myschedas,
]).then((arrdata) => {
// console.table(arrdata);
let myuser = req.user;
@@ -1778,6 +1779,7 @@ function load(req, res, version) {
code: req.code,
authors: arrdata[49],
publishers: arrdata[50],
myschedas: arrdata[51],
});
const prova = 1;