- 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:
1
docs/test.htm
Normal file
1
docs/test.htm
Normal 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
44879
docs/test.js
File diff suppressed because one or more lines are too long
BIN
public/upload/scheda/PrimaPagina.png
Normal file
BIN
public/upload/scheda/PrimaPagina.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.9 MiB |
@@ -334,6 +334,37 @@ MyElemSchema.statics.findAllIdApp = async function (idapp) {
|
|||||||
return await MyElem.find(myfind).sort({ order: 1 });
|
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);
|
const MyElem = mongoose.model('MyElem', MyElemSchema);
|
||||||
|
|
||||||
MyElem.createIndexes((err) => {
|
MyElem.createIndexes((err) => {
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ const ISize = new Schema({
|
|||||||
width: { type: String },
|
width: { type: String },
|
||||||
height: { type: String },
|
height: { type: String },
|
||||||
fit: { type: String },
|
fit: { type: String },
|
||||||
|
gap: { type: String },
|
||||||
});
|
});
|
||||||
const IFont = new Schema({
|
const IFont = new Schema({
|
||||||
name: { type: String },
|
name: { type: String },
|
||||||
@@ -66,6 +67,7 @@ const IBarCode = new Schema(
|
|||||||
format: Number,
|
format: Number,
|
||||||
size: ISize,
|
size: ISize,
|
||||||
font: IFont,
|
font: IFont,
|
||||||
|
widthlines: Number,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,6 @@ const { Contribtype } = require('../models/contribtype');
|
|||||||
const { PaymentType } = require('../models/paymenttype');
|
const { PaymentType } = require('../models/paymenttype');
|
||||||
const { Discipline } = require('../models/discipline');
|
const { Discipline } = require('../models/discipline');
|
||||||
const { MyElem } = require('../models/myelem');
|
const { MyElem } = require('../models/myelem');
|
||||||
const { MySCheda } = require('../models/myscheda');
|
|
||||||
const { Skill } = require('../models/skill');
|
const { Skill } = require('../models/skill');
|
||||||
const { Good } = require('../models/good');
|
const { Good } = require('../models/good');
|
||||||
const { StatusSkill } = require('../models/statusSkill');
|
const { StatusSkill } = require('../models/statusSkill');
|
||||||
@@ -1543,6 +1542,7 @@ function load(req, res, version) {
|
|||||||
const paymenttype = PaymentType.findAllIdApp(idapp);
|
const paymenttype = PaymentType.findAllIdApp(idapp);
|
||||||
const disciplines = Discipline.findAllIdApp(idapp);
|
const disciplines = Discipline.findAllIdApp(idapp);
|
||||||
const myelems = MyElem.findAllIdApp(idapp);
|
const myelems = MyElem.findAllIdApp(idapp);
|
||||||
|
const myschedas = MyElem.findallSchedeTemplate(idapp);
|
||||||
const settings = Settings.findAllIdApp(idapp, false, false);
|
const settings = Settings.findAllIdApp(idapp, false, false);
|
||||||
|
|
||||||
const permissions = Permission.findAllIdApp();
|
const permissions = Permission.findAllIdApp();
|
||||||
@@ -1684,6 +1684,7 @@ function load(req, res, version) {
|
|||||||
catAI,
|
catAI,
|
||||||
authors,
|
authors,
|
||||||
publishers,
|
publishers,
|
||||||
|
myschedas,
|
||||||
]).then((arrdata) => {
|
]).then((arrdata) => {
|
||||||
// console.table(arrdata);
|
// console.table(arrdata);
|
||||||
let myuser = req.user;
|
let myuser = req.user;
|
||||||
@@ -1778,6 +1779,7 @@ function load(req, res, version) {
|
|||||||
code: req.code,
|
code: req.code,
|
||||||
authors: arrdata[49],
|
authors: arrdata[49],
|
||||||
publishers: arrdata[50],
|
publishers: arrdata[50],
|
||||||
|
myschedas: arrdata[51],
|
||||||
});
|
});
|
||||||
|
|
||||||
const prova = 1;
|
const prova = 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user