Small refactor into backend & frontend
This commit is contained in:
parent
db4559383f
commit
5a2ce71f3c
@ -2,7 +2,7 @@ FROM alpine
|
|||||||
|
|
||||||
RUN apk --no-cache add python3 inkscape bash imagemagick
|
RUN apk --no-cache add python3 inkscape bash imagemagick
|
||||||
|
|
||||||
ADD . /root/zetikettes
|
ADD backend /root/zetikettes
|
||||||
|
|
||||||
RUN apk --no-cache add ttf-opensans && cp /root/zetikettes/fonts/*.ttf /usr/share/fonts/TTF/ && fc-cache -fv
|
RUN apk --no-cache add ttf-opensans && cp /root/zetikettes/fonts/*.ttf /usr/share/fonts/TTF/ && fc-cache -fv
|
||||||
|
|
||||||
|
1
backend/data/tikettes.json
Normal file
1
backend/data/tikettes.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
[]
|
Before Width: | Height: | Size: 896 B After Width: | Height: | Size: 896 B |
1
frontend/config.js
Normal file
1
frontend/config.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
const backend_api = 'http://localhost:8001/'
|
@ -1,8 +1,3 @@
|
|||||||
const backend_api = {
|
|
||||||
'prod': '/zetikettes/srv/',
|
|
||||||
'dev': '/zetikettes.dev/srv/',
|
|
||||||
}[config];
|
|
||||||
|
|
||||||
const params = [
|
const params = [
|
||||||
['dluo', 'DLUO', true],
|
['dluo', 'DLUO', true],
|
||||||
['lot', 'Nº de lot', true],
|
['lot', 'Nº de lot', true],
|
||||||
@ -65,7 +60,7 @@ $(document).ready(async () => {
|
|||||||
<input type="checkbox" name="landscape"><span>landscape</span></label>`));
|
<input type="checkbox" name="landscape"><span>landscape</span></label>`));
|
||||||
const subst = $('<div class="section"><label class="active">Substitutions</label><p></p>');
|
const subst = $('<div class="section"><label class="active">Substitutions</label><p></p>');
|
||||||
for (let param of params) {
|
for (let param of params) {
|
||||||
subst.append($(`<div><label class="active"><input type="checkbox" name="${param}" ${param[2] ? 'checked': ''}>
|
subst.append($(`<div><label class="active"><input type="checkbox" name="${param[0]}" ${param[2] ? 'checked': ''}>
|
||||||
<span>\${${param[0]}}: ${param[1]}</span></label>`));
|
<span>\${${param[0]}}: ${param[1]}</span></label>`));
|
||||||
}
|
}
|
||||||
block.append(subst);
|
block.append(subst);
|
@ -1,8 +1,3 @@
|
|||||||
const backend_api = {
|
|
||||||
'prod': '/zetikettes/srv/',
|
|
||||||
'dev': '/zetikettes.dev/srv/',
|
|
||||||
}[config];
|
|
||||||
|
|
||||||
const params = {
|
const params = {
|
||||||
'dluo': 'DLUO',
|
'dluo': 'DLUO',
|
||||||
'lot': 'Nº de lot',
|
'lot': 'Nº de lot',
|
||||||
@ -62,6 +57,23 @@ function loadAll(zetikettes) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$('.collapsible').collapsible();
|
$('.collapsible').collapsible();
|
||||||
|
|
||||||
|
konami();
|
||||||
|
}
|
||||||
|
|
||||||
|
function konami() {
|
||||||
|
var k = [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
|
||||||
|
n = 0;
|
||||||
|
$(document).keydown(function (e) {
|
||||||
|
if (e.keyCode === k[n++]) {
|
||||||
|
if (n === k.length) {
|
||||||
|
document.location.href = 'newtikette.html';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
n = 0;
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).ready(async () => {
|
$(document).ready(async () => {
|
@ -1,2 +0,0 @@
|
|||||||
config = 'prod'
|
|
||||||
// config = 'dev'
|
|
@ -1 +0,0 @@
|
|||||||
[{"title":"Aromate herbes de Provence","sticker":"Aromate - Herbes de Provence.svg","subs":{"dluo":"germinal 9999","lot":"0000-0","qty":"40"},"landscape":false},{"title":"Aromate herbes de Provence avec romarin","sticker":"Aromate - Herbes de Provence avec romarin.svg","subs":{"dluo":"germinal 9999","lot":"0000-0","qty":"40"},"landscape":false},{"title":"Aromate thym","sticker":"Aromate - Thym.svg","subs":{"dluo":"germinal 9999","lot":"0000-0","qty":"40"},"landscape":false},{"title":"Chocolat lavande","sticker":"Chocolat - Lavande.svg","subs":{"dluo":"germinal 9999","lot":"0000-0","qty":"100"},"landscape":false},{"title":"Confiture de Mirabelle - non bio","sticker":"Confiture - Mirabelle.svg","subs":{"dluo":"germinal 9999","fruit":"80","teneur":"50","lot":"0000-0","qty":"370"},"landscape":true},{"title":"Gelée Extra de groseille","sticker":"Gelée Extra - Groseille.svg","subs":{"dluo":"germinal 9999","fruit":"80","teneur":"50","lot":"0000-0","qty":"370"},"landscape":true},{"title":"Gelée Extra de groseille au basilic","sticker":"Gelée Extra - Groseille Basilic.svg","subs":{"dluo":"germinal 9999","fruit":"80","teneur":"50","lot":"0000-0","qty":"370"},"landscape":true},{"title":"Gelée Extra de cassis","sticker":"Gelée Extra - Cassis.svg","subs":{"dluo":"germinal 9999","fruit":"80","teneur":"50","lot":"0000-0","qty":"370"},"landscape":true},{"title":"Pesto ail des ours","sticker":"Pesto - Ail des Ours - 100% Olive.svg","subs":{"dluo":"germinal 9999","lot":"0000-0","qty":"150"},"landscape":true},{"title":"Sel grillade et légumes","sticker":"Sel - Grillade.svg","subs":{"dluo":"germinal 9999","lot":"0000-0","qty":"40"},"landscape":true},{"title":"Sel herbes de Provence","sticker":"Sel - Herbes de Provence.svg","subs":{"dluo":"germinal 9999","lot":"0000-0","qty":"40"},"landscape":true},{"title":"Sel viande blanche et poisson","sticker":"Sel - Poisson et Viande Blanche.svg","subs":{"dluo":"germinal 9999","lot":"0000-0","qty":"40"},"landscape":true},{"title":"Sel salade","sticker":"Sel - Salade.svg","subs":{"dluo":"germinal 9999","lot":"0000-0","qty":"40"},"landscape":true},{"title":"Sel salade sans basilic","sticker":"Sel - Salade - Sans Basilic.svg","subs":{"dluo":"germinal 9999","lot":"0000-0","qty":"40"},"landscape":true},{"title":"Sirop de sureau","sticker":"Sirop - Sureau.svg","subs":{"dluo":"germinal 9999","lot":"0000-0","qty":"75"}},{"title":"Sirop de lavande","sticker":"Sirop - Lavande.svg","subs":{"dluo":"germinal 9999","lot":"0000-0","qty":"75"}},{"title":"Sirop de cassis","sticker":"Sirop - Cassis.svg","subs":{"dluo":"germinal 9999","lot":"0000-0","qty":"75"},"landscape":false},{"title":"Sirop de thym","sticker":"Sirop - Thym.svg","subs":{"dluo":"germinal 9999","lot":"0000-0","qty":"75"},"landscape":false},{"title":"Sirop de mélisse","sticker":"Sirop - Melisse.svg","subs":{"dluo":"germinal 9999","lot":"0000-0","qty":"75"},"landscape":false},{"title":"Sirop de menthe verte","sticker":"Sirop - Menthe Verte.svg","subs":{"dluo":"germinal 9999","lot":"0000-0","qty":"75"},"landscape":false},{"title":"Tisane Hiver","sticker":"Tisane - Hiver.svg","subs":{"dluo":"germinal 9999","lot":"0000-0","qty":"25"},"landscape":false},{"title":"Tisane Joie de Vivre","sticker":"Tisane - Joie de Vivre.svg","subs":{"dluo":"germinal 9999","lot":"0000-0","qty":"25"},"landscape":false},{"title":"Tisane Réconfort de la Gorge (Origan, Thym, Agastache, Mauve)","sticker":"Tisane - Reconfort de la Gorge - Origan Thym Agastache Mauve.svg","subs":{"dluo":"germinal 9999","lot":"0000-0","qty":"25"},"landscape":false},{"title":"Tisane Nuit Étoilée (Mélisse, Lavande, Aubépine)","sticker":"Tisane - Nuit Etoilee - Melisse Lavande Aubepine.svg","subs":{"dluo":"germinal 9999","lot":"0000-0","qty":"25"},"landscape":false},{"title":"Tisane Détox (Menthe, Sarriette, Basilic, Souci)","sticker":"Tisane - Detox - Menthe Sarriette Basilic Souci.svg","subs":{"dluo":"germinal 9999","lot":"0000-0","qty":"25"},"landscape":false},{"title":"Tisane digestion","sticker":"Tisane - Digestion.svg","subs":{"dluo":"germinal 9999","lot":"0000-0","qty":"25"},"landscape":false}]
|
|
Loading…
Reference in New Issue
Block a user