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 @@+ Weitere Artikel können über Artikelübersicht gelistet werden. + Jetzt Hinzufügen +
+ ++
+ + | +|||||||
---|---|---|---|---|---|---|---|
Bild | +Name | +Preis | +(Netto) | +Kategorien | +Lagerbestand (Aktiv) | +Artikel | +Id (bearbeiten) | +
Kamera | +100,50 € | +(84.45 €) | +Úberwachung, Elektronik | +301 | +5051 | +890 | +|
Earbuds | +63,95 € | +(53,73 €) | +Kopfhörer, Elektronik | +12 | +840 | +13850 | +|
USB-Magic Light | +11,90 € | +(10,00 €) | +Sonstiges, Elektronik | +3 | +8401 | +5784 | +|
3D Magic Stativ | +15,99 € | +(13.44 €) | +Úberwachung, Elektronik | +4 | +2135 | +4564 | +|
Ersatzfernbedinung | +7,95 € | +(6.68 €) | +Úberwachung, Elektronik | +0 | +4565 | +4566 | +
+