From 06ade4330416b005039c29d9966e1085ff8eddcd Mon Sep 17 00:00:00 2001 From: CodeSteak Date: Sat, 1 Feb 2020 23:43:44 +0100 Subject: [PATCH] impl listed articles --- .../hso/ecommerce/app/RequestController.java | 8 +- .../main/resources/static/js/filterTable.js | 26 +++- .../resources/templates/fragments/intern.html | 25 ++-- .../templates/intern/articles/index.html | 28 ++--- .../templates/intern/listedArticles/id.html | 116 ++++++++++++++++++ .../intern/listedArticles/index.html | 105 ++++++++++++++++ 6 files changed, 275 insertions(+), 33 deletions(-) diff --git a/prototype/src/main/java/org/hso/ecommerce/app/RequestController.java b/prototype/src/main/java/org/hso/ecommerce/app/RequestController.java index 3ee7466..658a5cf 100644 --- a/prototype/src/main/java/org/hso/ecommerce/app/RequestController.java +++ b/prototype/src/main/java/org/hso/ecommerce/app/RequestController.java @@ -130,7 +130,13 @@ public class RequestController { public String internListedArticles() { return "/intern/listedArticles/index"; } - + + @GetMapping("/intern/listedArticles/{id}") + public String internListedArticlesId() { + return "/intern/listedArticles/id"; + } + + @GetMapping("/intern/articles/") public String internArticles() { return "/intern/articles/index"; diff --git a/prototype/src/main/resources/static/js/filterTable.js b/prototype/src/main/resources/static/js/filterTable.js index f760ffc..bc76afd 100644 --- a/prototype/src/main/resources/static/js/filterTable.js +++ b/prototype/src/main/resources/static/js/filterTable.js @@ -22,12 +22,22 @@ function filterTable(caller) { let valid = matching.length > 0 || tds.length == 0; if (valid) { caller.setCustomValidity(""); - for (let td of matching) { - td.style.display = null; - } + for (let td of notMatching) { td.style.display = "none"; } + + for (let td of matching) { + td.style.display = null; + + if(td.dataset.group) { + for(inner of notMatching) { + if(td.dataset.group == inner.dataset.group) { + inner.style.display = null; + } + } + } + } } else { caller.setCustomValidity("Nothing Matched"); for (let td of tds) { @@ -45,6 +55,14 @@ document.addEventListener("DOMContentLoaded", function(event) { window.setTimeout(function() { filterTable(elm); - }, 10); + }, 1); + } + + for (let elm of elms) { + // get query value + let h = new URLSearchParams(window.location.hash.replace('#', '?', 1)) + if (h.get('q')) { + elm.value = h.get('q'); + } } }); diff --git a/prototype/src/main/resources/templates/fragments/intern.html b/prototype/src/main/resources/templates/fragments/intern.html index bdda80b..e804c6b 100644 --- a/prototype/src/main/resources/templates/fragments/intern.html +++ b/prototype/src/main/resources/templates/fragments/intern.html @@ -8,9 +8,17 @@ diff --git a/prototype/src/main/resources/templates/intern/articles/index.html b/prototype/src/main/resources/templates/intern/articles/index.html index 5dea2bd..f17bccb 100644 --- a/prototype/src/main/resources/templates/intern/articles/index.html +++ b/prototype/src/main/resources/templates/intern/articles/index.html @@ -38,28 +38,28 @@ Status - + Kamera Sonjizu K48431587EX - Gelistet A-44048 + Gelistet 44048 - + Hans Guck GmbH 584,50 € - + Cheap AG 84,54 € X - + Not Cheap AG 184,54 € @@ -69,14 +69,14 @@ - + Earbuds Sonjizu G447#$X - Gelistet A-448 + Gelistet 448 - + Cheap AG 50,54 € @@ -86,14 +86,14 @@ - + Mundschutz Farma Corp Mu-15415 Hinzufügen - + Cheap AG 150,54 € @@ -101,7 +101,7 @@ - + Not Cheap AG 250,54 € @@ -111,14 +111,14 @@ - + Goldbaren Bundesbank G1KG - Inaktiv A4888 + Inaktiv 4888 - + Cheap AG 10000,54 € diff --git a/prototype/src/main/resources/templates/intern/listedArticles/id.html b/prototype/src/main/resources/templates/intern/listedArticles/id.html index e69de29..c4efb2f 100644 --- a/prototype/src/main/resources/templates/intern/listedArticles/id.html +++ b/prototype/src/main/resources/templates/intern/listedArticles/id.html @@ -0,0 +1,116 @@ + + + + + + + + Gelistete Artikel + + + + + + + +
+ +
+

Gelisteter Artikel 8450

+
+

+ + +

+

+ + + Details +

+
+
+

+ + +

+

+ +

+
+
+

+ + EUR
+ (19% Mwst.) +
+ = 105.98 EUR Brutto +

+

+ + EUR +

+
+
+ +
+ +
+
+
+
+ +
+ +

+ Bitte jede Kategorien in eine eigene Zeile +

+ +
+ +
+

+ + +

+

+ Lagerbestand: 12 +

+

+ Der Wert wird nur für zukünftige Lagerbuchungen verwendet. + Bei Problemen kann können Einheiten aus- und wieder eingebucht werden. + +

+

+ Lagerbuchung + +

+
+ +

+ + +

+
+ + +
+
+
+
+ + + + diff --git a/prototype/src/main/resources/templates/intern/listedArticles/index.html b/prototype/src/main/resources/templates/intern/listedArticles/index.html index e69de29..a8bb778 100644 --- a/prototype/src/main/resources/templates/intern/listedArticles/index.html +++ b/prototype/src/main/resources/templates/intern/listedArticles/index.html @@ -0,0 +1,105 @@ + + + + + + + + Gelistete Artikel + + + + + + + +
+ +
+

Artikel Hinzufügen

+

+ Weitere Artikel können über Artikelübersicht gelistet werden. + Jetzt Hinzufügen +

+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
BildNamePreis(Netto)KategorienLagerbestand (Aktiv)ArtikelId (bearbeiten)
Kamera100,50 € (84.45 €) Úberwachung, Elektronik301 5051890
Earbuds63,95 €(53,73 €)Kopfhörer, Elektronik12 84013850
USB-Magic Light11,90 € (10,00 €) Sonstiges, Elektronik384015784
3D Magic Stativ15,99 € (13.44 €) Úberwachung, Elektronik421354564
Ersatzfernbedinung7,95 € (6.68 €) Úberwachung, Elektronik045654566
+

+

+
+ + + +