impl listed articles

This commit is contained in:
CodeSteak 2020-02-01 23:43:44 +01:00
parent 91b8533c25
commit 06ade43304
6 changed files with 275 additions and 33 deletions

View File

@ -131,6 +131,12 @@ public class RequestController {
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";

View File

@ -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');
}
}
});

View File

@ -8,9 +8,17 @@
<body>
<nav th:fragment="sidebar">
<h1>Kategorien</h1>
<h1>Navigation</h1>
<ul>
<ul>
<li><a th:href="@{/intern/}">Dashboard</a>
</li>
<li><a th:href="@{/intern/listedArticles/}">Gelsistete Artikel</a>
<ul>
<li><a th:href="@{/intern/articles/}">Händlerangebote</a>
</li>
</ul>
</li>
<li><a th:href="@{/intern/accounting/}">Alle Buchungen</a>
<ul>
<li><a th:href="@{/intern/accounting/main}">Hauptbuchungskonto</a></li>
@ -20,24 +28,13 @@
<li><a th:href="@{/intern/accounting/addManual}">Manuell Buchen</a></li>
</ul>
</li>
<li><a th:href="@{/intern/articles/}">Händlerangebote</a>
</li>
<li><a th:href="@{/intern/customers/}">Kunden</a>
<ul>
<li><a th:href="@{/intern/customerOrders/}">Bestellungen</a></li>
</ul>
</li>
<li><a>Lager</a>
<ul>
<li><a>Bestandsbuchungen</a></li>
</ul>
</li>
<li><a>Kunden</a>
<ul>
<li><a>Bestellungen</a></li>
<li><a>Geldbuchungen</a></li>
</ul>
</li>
</ul>
</ul>
</nav>

View File

@ -38,28 +38,28 @@
<th>Status</th>
</tr>
<!--**********************************************************-->
<tr>
<tr data-group="5420">
<td>Kamera</td>
<td>Sonjizu</td>
<td>K48431587EX</td>
<td colspan="3"></td>
<td><a th:href="@{/intern/listedArticles/48670}">Gelistet A-44048</a></td>
<td><a th:href="@{/intern/listedArticles/48670}">Gelistet 44048</a></td>
</tr>
<tr>
<tr data-group="5420">
<td colspan="3"></td>
<td><a th:href="@{/intern/suppliers/48670}">Hans Guck GmbH</a></td>
<td>584,50 €</td>
<td></td>
<td></td>
</tr>
<tr>
<tr data-group="5420">
<td colspan="3"></td>
<td><a th:href="@{/intern/suppliers/48670}">Cheap AG</a></td>
<td>84,54 €</td>
<td>X</td>
<td></td>
</tr>
<tr>
<tr data-group="5420">
<td colspan="3"></td>
<td><a th:href="@{/intern/suppliers/48670}">Not Cheap AG</a></td>
<td>184,54 €</td>
@ -69,14 +69,14 @@
</tr>
<!--**********************************************************-->
<tr>
<tr data-group="1233">
<td>Earbuds</td>
<td>Sonjizu</td>
<td>G447#$X</td>
<td colspan="3"></td>
<td><a th:href="@{/intern/listedArticles/48670}">Gelistet A-448</a></td>
<td><a th:href="@{/intern/listedArticles/48670}">Gelistet 448</a></td>
</tr>
<tr>
<tr data-group="1233">
<td colspan="3"></td>
<td><a th:href="@{/intern/suppliers/48670}">Cheap AG</a></td>
<td>50,54 €</td>
@ -86,14 +86,14 @@
<!--**********************************************************-->
<tr>
<tr data-group="42415">
<td>Mundschutz</td>
<td>Farma Corp</td>
<td>Mu-15415</td>
<td colspan="3"></td>
<td><a class="button smaller" th:href="@{/intern/listedArticles/48670}">Hinzufügen</a></td>
</tr>
<tr>
<tr data-group="42415">
<td colspan="3"></td>
<td><a th:href="@{/intern/suppliers/48670}">Cheap AG</a></td>
<td>150,54 €</td>
@ -101,7 +101,7 @@
<td></td>
</tr>
<tr>
<tr data-group="42415">
<td colspan="3"></td>
<td><a th:href="@{/intern/suppliers/48670}">Not Cheap AG</a></td>
<td>250,54 €</td>
@ -111,14 +111,14 @@
<!--**********************************************************-->
<tr>
<tr data-group="4580">
<td>Goldbaren</td>
<td>Bundesbank</td>
<td>G1KG</td>
<td colspan="3"></td>
<td><a th:href="@{/intern/listedArticles/48670}">Inaktiv A4888</a></td>
<td><a th:href="@{/intern/listedArticles/48670}">Inaktiv 4888</a></td>
</tr>
<tr>
<tr data-group="4580">
<td colspan="3"></td>
<td><a th:href="@{/intern/suppliers/48670}">Cheap AG</a></td>
<td>10000,54 €</td>

View File

@ -0,0 +1,116 @@
<!DOCTYPE html>
<html lang="de" dir="ltr" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=0.75, user-scalable=no">
<title>Gelistete Artikel</title>
<script th:src="@{/js/filterTable.js}"></script>
<link rel="stylesheet" th:href="@{/css/ecom.css}" />
</head>
<body>
<nav th:replace="/fragments/header :: header">Header</nav>
<div class="sidebar-layout content-width">
<nav></nav>
<div>
<h1>Gelisteter Artikel 8450</h1>
</div>
</div>
<main class="sidebar-layout content-width">
<nav th:replace="/fragments/intern :: sidebar"></nav>
<div class="content-width">
<h2>Gelisteter Artikel 8450</h2>
<form class="detailgrid">
<p class="m">
<label for="title">Titel</label>
<input class=" full-width" type="text" name="title" value="Kamera" />
</p>
<p class="s">
<label for="ref-article">Refernzierter Artikel</label>
<input class="" type="text" name="ref-article" value="8405" disabled />
<td><a th:href="@{/intern/articles/#q=%2044048}">Details</a></td>
</p>
<div class="spacer"></div>
<div class="m">
<p>
<label for="img">Bild Hochladen</label>
<input class="full-width" type="file" name="img" />
</p>
<p>
<img th:src="@{/img/product-1.jpg}" class="m" />
</p>
</div>
<div class="s">
<p>
<label for="price">Preis (Netto)</label>
<input class="" type="number" step="0.01" name="price" value="84.45" /> EUR <br />
(19% Mwst.)
<!-- Info von article ref--> <br />
= 105.98 EUR Brutto
</p>
<p>
<label for="max-price-buy">Maximaler Einkaufspreis (Netto)</label>
<input class="" type="number" step="0.01" name="price" value="80.98" /> EUR
</p>
<div>
<fieldset>
<input type="radio" name="autobuy" value="true" id="autobuy-yes" checked required>
<label for="autobuy-yes"> Automatisch nachbestellen.</label> <br />
<input type="radio" name="autobuy" value="false" id="autobuy-no" required>
<label for="autobuy-no"> Nicht mehr nachkaufen.</label> <br />
</fieldset>
</div>
</div>
<div class="m">
<label for="tags">Kategorien</label>
<p>
Bitte jede Kategorien in eine eigene Zeile
</p>
<textarea name="tags" class="full-width" rows="6">
Überwachung
Elektronik
</textarea>
</div>
<div class="s">
<p>
<label for="price">Einheiten pro Lagherplatz</label>
<input class="" type="number" name="units-per-slot" value="20" />
</p>
<p>
<b>Lagerbestand: 12</b>
</p>
<p>
Der Wert wird nur für zukünftige Lagerbuchungen verwendet.
Bei Problemen kann können Einheiten aus- und wieder eingebucht werden.
<!-- TODO: set link g-->
</p>
<p>
<a href="/todo" class="button smaller">Lagerbuchung</a>
</p>
</div>
<p class="l">
<label for="description">Beschreibung</label>
<textarea name="description" class="full-width" rows="15">
Eine TOLLE Kamera
Jaja du denkst jetzt bestimmt: "Bei dem Preis kann sie gar nich sooo TOLL sein".
Aber glaub mir, sie is echt echt TOLL!
Indianerehrenwort!
</textarea>
</p>
<div class="l">
<button type="submit">Änderungen speichern</button>
<button type="reset">Zurücksetzen</button>
</div>
</form>
</div>
</main>
<footer th:replace="/fragments/footer :: footer"></footer>
</body>
</html>

View File

@ -0,0 +1,105 @@
<!DOCTYPE html>
<html lang="de" dir="ltr" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=0.75, user-scalable=no">
<title>Gelistete Artikel</title>
<script th:src="@{/js/filterTable.js}"></script>
<link rel="stylesheet" th:href="@{/css/ecom.css}" />
</head>
<body>
<nav th:replace="/fragments/header :: header">Header</nav>
<div class="sidebar-layout content-width">
<nav></nav>
<div>
<h1>Gelistete Artikel</h1>
</div>
</div>
<main class="sidebar-layout content-width">
<nav th:replace="/fragments/intern :: sidebar"></nav>
<div class="content-width">
<h2>Artikel Hinzufügen</h2>
<p>
Weitere Artikel können über Artikelübersicht gelistet werden.
<a class="button smaller" th:href="@{/intern/articles/}"> Jetzt Hinzufügen </a>
</p>
<p>
<table id="main-table">
<tr>
<th colspan="8">
<input type="text" placeholder="Filtern" class="smaller jsFilterTable full-width" data-target-id="main-table"></input>
</th>
</tr>
<tr>
<th>Bild</th>
<th>Name</th>
<th>Preis</th>
<th>(Netto)</th>
<th>Kategorien</th>
<th>Lagerbestand (Aktiv)</th>
<th>Artikel</th>
<th>Id (bearbeiten)</th>
</tr>
<tr>
<td><img th:src="@{/img/product-1.jpg}" class="s" /></td>
<td>Kamera</td>
<td>100,50 €</td>
<td> (84.45 €) </td>
<td>Úberwachung, Elektronik</td>
<td>301 <span class="checked"></span></td>
<td><a th:href="@{/intern/articles/#q=%2044048}">5051</a></td>
<td><a th:href="@{/intern/listedArticles/45015}">890</a></td>
</tr>
<tr>
<td><img th:src="@{/img/product-2.jpg}" class="s" /></td>
<td>Earbuds</td>
<td>63,95 €</td>
<td>(53,73 €)</td>
<td>Kopfhörer, Elektronik</td>
<td>12 <span class="checked"></span></td>
<td><a th:href="@{/intern/articles/#q=%2044048}">840</a></td>
<td><a th:href="@{/intern/listedArticles/45015}">13850</a></td>
</tr>
<tr>
<td><img th:src="@{/img/product-3.jpg}" class="s" /></td>
<td>USB-Magic Light</td>
<td>11,90 €</td>
<td> (10,00 €) </td>
<td>Sonstiges, Elektronik</td>
<td>3<span class="unchecked"></span></td>
<td><a th:href="@{/intern/articles/#q=%2044048}">8401</a></td>
<td><a th:href="@{/intern/listedArticles/45015}">5784</a></td>
</tr>
<tr>
<td><img th:src="@{/img/product-4.jpg}" class="s" /></td>
<td>3D Magic Stativ</td>
<td>15,99 €</td>
<td> (13.44 €) </td>
<td>Úberwachung, Elektronik</td>
<td>4<span class="checked"></span></td>
<td><a th:href="@{/intern/articles/#q=%2044048}">2135</a></td>
<td><a th:href="@{/intern/listedArticles/45015}">4564</a></td>
</tr>
<tr>
<td><img th:src="@{/img/product-5.jpg}" class="s" /></td>
<td>Ersatzfernbedinung</td>
<td>7,95 €</td>
<td> (6.68 €) </td>
<td>Úberwachung, Elektronik</td>
<td>0<span class="checked"></span></td>
<td><a th:href="@{/intern/articles/#q=%2044048}">4565</a></td>
<td><a th:href="@{/intern/listedArticles/45015}">4566</a></td>
</tr>
</table>
<p>
</div>
</main>
<footer th:replace="/fragments/footer :: footer"></footer>
</body>
</html>