Revert "UImodel for offeredArticle page, html cleanup"

This reverts commit e0f638f0bd.
This commit is contained in:
Hendrik Schutter 2020-05-16 22:46:42 +02:00
parent 3c69f38367
commit 0840eda369
4 changed files with 326 additions and 336 deletions

View File

@ -1,8 +1,5 @@
package org.hso.ecommerce.controller.intern.suppliers; package org.hso.ecommerce.controller.intern.suppliers;
import java.util.ArrayList;
import java.util.List;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.Model; import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
@ -15,118 +12,14 @@ public class SupplierOfferController {
@GetMapping("supplierOffers") @GetMapping("supplierOffers")
public String internListedArticles(Model model) { public String internListedArticles(Model model) {
List<UImodelOfferedArticle> totals = new ArrayList<UImodelOfferedArticle>();
/*
* for (Article article : articleRepository.findAll()) { UImodelArticles tmp =
* new UImodelArticles(); tmp.addListedArticle(article,
* warehouseEntryRepository.getArticleStock(article.id).orElse(0));
* totals.add(tmp); }
*/
UImodelOfferedArticle tmp01 = new UImodelOfferedArticle();
UImodelOfferedArticle tmp02 = new UImodelOfferedArticle();
UImodelOfferedArticle tmp03 = new UImodelOfferedArticle();
tmp01.addData("Title01", "manufacturer01", "articlenumber01", "supplierName01", 4884, "42,42 €", "ads01", 5);
tmp02.addData("Title02", "manufacturer02", "articlenumber02", "supplierName02", 4884, "42,42 €", "ads02", 6);
tmp03.addData("Title03", "manufacturer03", "articlenumber03", "supplierName03", 4884, "42,42 €", "ads03", 7);
totals.add(tmp01);
totals.add(tmp02);
totals.add(tmp03);
model.addAttribute("OfferedArticles", totals);
return "intern/offeredArticles/index"; return "intern/offeredArticles/index";
}
public class UImodelOfferedArticle {
String title;
String manufacturer;
String articlenumber;
String supplierName;
int supplierId;
String price;
String ads;
int listedArticleId;
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getManufacturer() {
return manufacturer;
}
public void setManufacturer(String manufacturer) {
this.manufacturer = manufacturer;
}
public String getArticlenumber() {
return articlenumber;
}
public void setArticlenumber(String articlenumber) {
this.articlenumber = articlenumber;
}
public String getSupplierName() {
return supplierName;
}
public void setSupplierName(String supplierName) {
this.supplierName = supplierName;
}
public int getSupplierId() {
return supplierId;
}
public void setSupplierId(int supplierId) {
this.supplierId = supplierId;
}
public String getPrice() {
return price;
}
public void setPrice(String price) {
this.price = price;
}
public String getAds() {
return ads;
}
public void setAds(String ads) {
this.ads = ads;
}
public int getListedArticleId() {
return listedArticleId;
}
public void setListedArticleId(int listedArticleId) {
this.listedArticleId = listedArticleId;
}
public void addData(String title, String manufacturer, String articlenumber, String supplierName,
int supplierId, String price, String ads, int listedArticleId) {
this.title = title;
this.manufacturer = manufacturer;
this.articlenumber = articlenumber;
this.supplierName = supplierName;
this.supplierId = supplierId;
this.price = price;
this.ads = ads;
this.listedArticleId = listedArticleId;
}
} }

View File

@ -1,106 +1,118 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="de" dir="ltr" xmlns:th="http://www.thymeleaf.org"> <html lang="de" dir="ltr" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8"> <head>
<meta name="viewport" content="width=device-width, initial-scale=0.75, user-scalable=no"> <meta charset="utf-8">
<title>Bearbeiten: Artikel</title> <meta name="viewport" content="width=device-width, initial-scale=0.75, user-scalable=no">
<script th:src="@{/js/filterTable.js}"></script>
<link rel="stylesheet" th:href="@{/css/ecom.css}"/> <title>Bearbeiten: Artikel</title>
</head> <script th:src="@{/js/filterTable.js}"></script>
<body> <link rel="stylesheet" th:href="@{/css/ecom.css}"/>
<nav th:replace="fragments/header :: header">Header</nav> </head>
<div class="sidebar-layout content-width">
<nav></nav> <body>
<div> <nav th:replace="fragments/header :: header">Header</nav>
<h1>Artikel bearbeiten</h1> <div class="sidebar-layout content-width">
<script th:src="@{/js/back.js}"></script> <nav></nav>
<div class="back" data-group="intern" data-insert="true"></div> <div>
</div> <h1>Artikel bearbeiten</h1>
</div>
<main class="sidebar-layout content-width"> <script th:src="@{/js/back.js}"></script>
<nav th:replace="fragments/intern :: sidebar"></nav> <div class="back" data-group="intern" data-insert="true"></div>
<div class="content-width"> </div>
<h2>Gelisteter Artikel ID <span th:text="${ArticleID.id}"></span></h2> </div>
<form class="detailgrid" action="#" th:action="@{/intern/articles/{id}/saveChanges(id = ${ArticleID.id})}" th:object="${ArticleID}" method="POST" enctype="multipart/form-data"> <main class="sidebar-layout content-width">
<p class="m"> <nav th:replace="fragments/intern :: sidebar"></nav>
<label for="title">Titel</label> <div class="content-width">
<input class=" full-width" type="text" name="title" th:value="${ArticleID.title}"/> <h2>Gelisteter Artikel ID <span th:text="${ArticleID.id}"></span></h2>
</p>
<p class="s">
<label for="ref-article">Refernzierter Artikel</label> <form class="detailgrid" action="#" th:action="@{/intern/articles/{id}/saveChanges(id = ${ArticleID.id})}" th:object="${ArticleID}" method="POST" enctype="multipart/form-data">
<input class="" type="text" name="ref-article" th:value="${ArticleID.offer_id}" disabled/>
<td><a th:href="@{/intern/suppliers/articles/{id}(id = ${ArticleID.offer_id})}">Details</a></td> <p class="m">
</p> <label for="title">Titel</label>
<div class="spacer"></div> <input class=" full-width" type="text" name="title" th:value="${ArticleID.title}"/>
<div class="m"> </p>
<p> <p class="s">
<label for="img">Bild Hochladen</label> <label for="ref-article">Refernzierter Artikel</label>
<input class="full-width" type="file" name="img"/> <input class="" type="text" name="ref-article" th:value="${ArticleID.offer_id}" disabled/>
</p> <td><a th:href="@{/intern/suppliers/articles/{id}(id = ${ArticleID.offer_id})}">Details</a></td>
<p> </p>
<img th:src="@{/shop/articles/{id}/image.jpg(id=${ArticleID.id})}" class="m"/> <div class="spacer"></div>
</p> <div class="m">
</div> <p>
<div class="s"> <label for="img">Bild Hochladen</label>
<p> <input class="full-width" type="file" name="img"/>
<label for="price">Preis (Netto)</label> </p>
<input class="" type="number" step="0.01" name="price_netto" th:value="${ArticleID.price_netto}"/>&nbsp;EUR <br/> <p>
(19% Mwst.) <img th:src="@{/shop/articles/{id}/image.jpg(id=${ArticleID.id})}" class="m"/>
<!-- Info von article ref--> <br/> </p>
= <span th:text="${ArticleID.price}"></span>&nbsp;EUR Brutto </div>
</p> <div class="s">
<p> <p>
<label for="max-price-buy">Maximaler Einkaufspreis (Netto)</label> <label for="price">Preis (Netto)</label>
<input class="" type="number" step="0.01" name="reorderMaxPrice" th:value="${ArticleID.reorderMaxPrice}"/>&nbsp;EUR <input class="" type="number" step="0.01" name="price_netto" th:value="${ArticleID.price_netto}"/>&nbsp;EUR <br/>
</p> (19% Mwst.)
<div> <!-- Info von article ref--> <br/>
<fieldset> = <span th:text="${ArticleID.price}"></span>&nbsp;EUR Brutto
</p>
<p>
<label for="max-price-buy">Maximaler Einkaufspreis (Netto)</label>
<input class="" type="number" step="0.01" name="reorderMaxPrice" th:value="${ArticleID.reorderMaxPrice}"/>&nbsp;EUR
</p>
<div>
<fieldset>
<input type="radio" name="autobuy" value="true" id="autobuy-yes" th:checked="${ArticleID.shouldReorder}" required> <input type="radio" name="autobuy" value="true" id="autobuy-yes" th:checked="${ArticleID.shouldReorder}" required>
<label for="autobuy-yes"> Automatisch nachbestellen.</label> <br/> <label for="autobuy-yes"> Automatisch nachbestellen.</label> <br/>
<input type="radio" name="autobuy" value="false" id="autobuy-no" th:checked="${!ArticleID.shouldReorder}" required> <input type="radio" name="autobuy" value="false" id="autobuy-no" th:checked="${!ArticleID.shouldReorder}" required>
<label for="autobuy-no"> Nicht mehr nachkaufen.</label> <br/> <label for="autobuy-no"> Nicht mehr nachkaufen.</label> <br/>
</fieldset> </fieldset>
</div> </div>
</div> </div>
<div class="m">
<label for="tags">Kategorien</label> <div class="m">
<p> <label for="tags">Kategorien</label>
Bitte jede Kategorien in eine eigene Zeile <p>
</p> Bitte jede Kategorien in eine eigene Zeile
<textarea name="categories" class="full-width" rows="6"th:inline="text">[[${ArticleID.categorie}]] </p>
<textarea name="categories" class="full-width" rows="6"th:inline="text">[[${ArticleID.categorie}]]
</textarea> </textarea>
</div> </div>
<div class="s">
<p> <div class="s">
<label for="price">Einheiten pro Lagerplatz</label> <p>
<input class="" type="number" name="units-per-slot" th:value="${ArticleID.warehouseUnitsPerSlot}"/> <label for="price">Einheiten pro Lagerplatz</label>
</p> <input class="" type="number" name="units-per-slot" th:value="${ArticleID.warehouseUnitsPerSlot}"/>
<p> </p>
<b>Lagerbestand: <span th:text="${ArticleID.stock}"></span></b> <p>
</p> <b>Lagerbestand: <span th:text="${ArticleID.stock}"></span></b>
<p> </p>
Der Wert wird nur für zukünftige Lagerbuchungen verwendet. <p>
Bei Problemen kann können Einheiten aus- und wieder eingebucht werden. Der Wert wird nur für zukünftige Lagerbuchungen verwendet.
<!-- TODO: set link g--> Bei Problemen kann können Einheiten aus- und wieder eingebucht werden.
</p> <!-- TODO: set link g-->
<p> </p>
<a href="/todo" class="button smaller">Lagerbuchung</a> <p>
</p> <a href="/todo" class="button smaller">Lagerbuchung</a>
</div>
<p class="l"> </p>
<label for="description">Beschreibung</label> </div>
<textarea name="description" class="full-width" rows="15" th:inline="text">[[${ArticleID.description}]]
</textarea> <p class="l">
</p> <label for="description">Beschreibung</label>
<div class="l"> <textarea name="description" class="full-width" rows="15" th:inline="text">[[${ArticleID.description}]]
<button type="submit">Änderungen speichern</button> </textarea>
<button type="reset">Zurücksetzen</button> </p>
<button onclick="history.back()">Änderungen verwerfen</button> <div class="l">
</div> <button type="submit">Änderungen speichern</button>
</form> <button type="reset">Zurücksetzen</button>
</div> <button onclick="history.back()">Änderungen verwerfen</button>
</main> </div>
<footer th:replace="fragments/footer :: footer"></footer> </form>
</body> </div>
</html> </main>
<footer th:replace="fragments/footer :: footer"></footer>
</body>
</html>

View File

@ -1,69 +1,73 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="de" dir="ltr" xmlns:th="http://www.thymeleaf.org"> <html lang="de" dir="ltr" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8"> <head>
<meta name="viewport" content="width=device-width, initial-scale=0.75, user-scalable=no"> <meta charset="utf-8">
<title>Gelistete Artikel</title> <meta name="viewport" content="width=device-width, initial-scale=0.75, user-scalable=no">
<script th:src="@{/js/filterTable.js}"></script>
<link rel="stylesheet" th:href="@{/css/ecom.css}"/> <title>Gelistete Artikel</title>
</head> <script th:src="@{/js/filterTable.js}"></script>
<body> <link rel="stylesheet" th:href="@{/css/ecom.css}"/>
<nav th:replace="fragments/header :: header">Header</nav> </head>
<div class="sidebar-layout content-width">
<nav></nav> <body>
<div> <nav th:replace="fragments/header :: header">Header</nav>
<h1>Gelistete Artikel</h1> <div class="sidebar-layout content-width">
<script th:src="@{/js/back.js}"></script> <nav></nav>
<div class="back" data-group="intern" data-name="Zurück zu den gelisteten Artikeln." data-insert="false"></div> <div>
</div> <h1>Gelistete Artikel</h1>
</div>
<main class="sidebar-layout content-width"> <script th:src="@{/js/back.js}"></script>
<nav th:replace="fragments/intern :: sidebar"></nav> <div class="back" data-group="intern" data-name="Zurück zu den gelisteten Artikeln." data-insert="false"></div>
<div class="content-width"> </div>
<p> </div>
Weitere Artikel können über Artikelübersicht der Lieferanten hinzugefügt werden. <main class="sidebar-layout content-width">
<a class="button smaller" th:href="@{/intern/supplierOffers}"> Jetzt Hinzufügen </a> <nav th:replace="fragments/intern :: sidebar"></nav>
</p> <div class="content-width">
<p> <p>
<table id="main-table"> Weitere Artikel können über Artikelübersicht der Lieferanten hinzugefügt werden.
<tr> <a class="button smaller" th:href="@{/intern/supplierOffers}"> Jetzt Hinzufügen </a>
<th colspan="9"> </p>
<input type="text" placeholder="Filtern" class="smaller jsFilterTable full-width"
data-target-id="main-table"></input> <p>
</th> <table id="main-table">
</tr> <tr>
<thead> <th colspan="9">
<tr> <input type="text" placeholder="Filtern" class="smaller jsFilterTable full-width"
<th>Bild</th> data-target-id="main-table"></input>
<th>Name</th> </th>
<th>Preis</th> </tr>
<th>(Netto)</th> <thead>
<th>Kategorien</th> <tr>
<th>Lagerbestand</th> <th>Bild</th>
<th>Angebots ID</th> <th>Name</th>
<th>Artikel ID</th> <th>Preis</th>
<th>Aktion</th> <th>(Netto)</th>
</tr> <th>Kategorien</th>
</thead> <th>Lagerbestand</th>
<tbody> <th>Angebots ID</th>
<tr th:each="article : ${ListedArticles}"> <th>Artikel ID</th>
<td><img th:src="@{/shop/articles/{id}/image.jpg(id=${article.id})}" class="s"/></td> <th>Aktion</th>
<td><span th:text="${article.title}"></span></td> </tr>
<td><span th:text="${article.price}"></span></td> </thead>
<td><span th:text="${article.price_netto}"></span></td> <tbody>
<td><span th:text="${article.categorie}"></span></td> <tr th:each="article : ${ListedArticles}">
<td><span th:text="${article.stock}"></span></td> <td><img th:src="@{/shop/articles/{id}/image.jpg(id=${article.id})}" class="s"/></td>
<td><a th:href="@{/intern/supplierOffered/{id}(id = ${article.offer_id})}" th:text="${article.offer_id}"></a></td> <td><span th:text="${article.title}"></span></td>
<td><a th:href="@{/intern/articles/{id}(id = ${article.id})}" th:text="${article.id}"></a></td> <td><span th:text="${article.price}"></span></td>
<td> <td><span th:text="${article.price_netto}"></span></td>
<form th:action="@{/intern/articles/{id}(id = ${article.id})}"><input type="submit" value="Bearbeiten" /></form> <td><span th:text="${article.categorie}"></span></td>
</td> <td><span th:text="${article.stock}"></span></td>
</tr> <td><a th:href="@{/intern/suppliers/articles/{id}(id = ${article.offer_id})}" th:text="${article.offer_id}"></a></td>
</tbody> <td><a th:href="@{/intern/articles/{id}(id = ${article.id})}" th:text="${article.id}"></a></td>
</table> <td><form th:action="@{/intern/articles/{id}(id = ${article.id})}"><input type="submit" value="Bearbeiten" /></form></td>
<p> </tr>
</div> </tbody>
</main> </table>
<footer th:replace="fragments/footer :: footer"></footer> <p>
</body> </div>
</html> </main>
<footer th:replace="fragments/footer :: footer"></footer>
</body>
</html>

View File

@ -1,59 +1,140 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="de" dir="ltr" xmlns:th="http://www.thymeleaf.org"> <html lang="de" dir="ltr" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8"> <head>
<meta name="viewport" content="width=device-width, initial-scale=0.75, user-scalable=no"> <meta charset="utf-8">
<title>Händlerangebote</title> <meta name="viewport" content="width=device-width, initial-scale=0.75, user-scalable=no">
<script th:src="@{/js/filterTable.js}"></script>
<link rel="stylesheet" th:href="@{/css/ecom.css}"/> <title>Händlerangebote</title>
</head> <script th:src="@{/js/filterTable.js}"></script>
<body> <link rel="stylesheet" th:href="@{/css/ecom.css}"/>
<nav th:replace="fragments/header :: header">Header</nav> </head>
<div class="sidebar-layout content-width">
<nav></nav> <body>
<div> <nav th:replace="fragments/header :: header">Header</nav>
<h1>Übersicht der Angebote von Lieferanten</h1> <div class="sidebar-layout content-width">
<script th:src="@{/js/back.js}"></script> <nav></nav>
<div class="back" data-group="intern" data-name="Zurück zur Übersicht der von Lieferanten angebotenen Artikel." <div>
data-insert="false"></div> <h1>Übersicht der Angebote von Lieferanten</h1>
</div>
</div> <script th:src="@{/js/back.js}"></script>
<main class="sidebar-layout content-width"> <div class="back" data-group="intern" data-name="Zurück zur Übersicht der von Lieferanten angebotenen Artikel."
<nav th:replace="fragments/intern :: sidebar"></nav> data-insert="false"></div>
<div class="content-width"> </div>
<p> </div>
<table id="main-table"> <main class="sidebar-layout content-width">
<tr> <nav th:replace="fragments/intern :: sidebar"></nav>
<th colspan="7"> <div class="content-width">
<input type="text" placeholder="Filtern" class="smaller jsFilterTable full-width" data-target-id="main-table"></input> <p>
</th> <table id="main-table">
</tr> <tr>
<thead> <th colspan="7">
<tr> <input type="text" placeholder="Filtern" class="smaller jsFilterTable full-width"
<th>Name</th> data-target-id="main-table"></input>
<th>Hersteller</th> </th>
<th>Artikelnummer</th> </tr>
<th>Lieferant</th> <tr>
<th>Kaufpreis (Netto)</th> <th>Name</th>
<th>Werbungs-<br/>anfrage</th> <th>Hersteller</th>
<th>Status</th> <th>Artikelnummer</th>
</tr> <th>Lieferant</th>
</thead> <th>Kaufpreis (Netto)</th>
<tbody> <th>Werbungs-<br/>anfrage</th>
<tr th:each="article : ${OfferedArticles}"> <th>Status</th>
<td><span th:text="${article.title}"></span></td> </tr>
<td><span th:text="${article.manufacturer}"></span></td> <!--**********************************************************-->
<td><span th:text="${article.articlenumber}"></span></td> <tr data-group="5420">
<td><a th:href="@{/intern/suppliers/{id}(id = ${article.supplierId})}" th:text="${article.supplierName}"></a></td> <td>Kamera</td>
<td><span th:text="${article.price}"></span></td> <td>Sonjizu</td>
<td><span th:text="${article.ads}"></span></td> <td>K48431587EX</td>
<td><a th:href="@{/intern/articles/{id}(id = ${article.listedArticleId})}" th:text="${article.listedArticleId}"></a></td> <td colspan="3"></td>
</tr> <td><a th:href="@{/intern/listedArticles/48670}">Gelistet 44048</a></td>
</tbody> </tr>
</table> <tr data-group="5420">
</p> <td colspan="3"></td>
</div> <td><a th:href="@{/intern/suppliers/48670}">Hans Guck GmbH</a></td>
</main> <td>584,50&nbsp;EUR</td>
<footer th:replace="fragments/footer :: footer"></footer> <td></td>
</body> <td></td>
</html> </tr>
<tr data-group="5420">
<td colspan="3"></td>
<td><a th:href="@{/intern/suppliers/48670}">Cheap AG</a></td>
<td>84,54&nbsp;EUR</td>
<td>X</td>
<td></td>
</tr>
<tr data-group="5420">
<td colspan="3"></td>
<td><a th:href="@{/intern/suppliers/48670}">Not Cheap AG</a></td>
<td>184,54&nbsp;EUR</td>
<td></td>
<td></td>
</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 448</a></td>
</tr>
<tr data-group="1233">
<td colspan="3"></td>
<td><a th:href="@{/intern/suppliers/48670}">Cheap AG</a></td>
<td>50,54&nbsp;EUR</td>
<td>X</td>
<td></td>
</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 data-group="42415">
<td colspan="3"></td>
<td><a th:href="@{/intern/suppliers/48670}">Cheap AG</a></td>
<td>150,54&nbsp;EUR</td>
<td></td>
<td></td>
</tr>
<tr data-group="42415">
<td colspan="3"></td>
<td><a th:href="@{/intern/suppliers/48670}">Not Cheap AG</a></td>
<td>250,54&nbsp;EUR</td>
<td></td>
<td></td>
</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 4888</a></td>
</tr>
<tr data-group="4580">
<td colspan="3"></td>
<td><a th:href="@{/intern/suppliers/48670}">Cheap AG</a></td>
<td>10000,54&nbsp;EUR</td>
<td>X</td>
<td></td>
</tr>
</table>
</p>
</div>
</main>
<footer th:replace="fragments/footer :: footer"></footer>
</body>
</html>