fix/intern_articles #39
|
@ -83,7 +83,7 @@ public class InternArticleController {
|
||||||
@RequestParam(value = "price_netto", required = true) String pricenetto,
|
@RequestParam(value = "price_netto", required = true) String pricenetto,
|
||||||
@RequestParam(value = "reorderMaxPrice", required = true) String reorderMaxPrice,
|
@RequestParam(value = "reorderMaxPrice", required = true) String reorderMaxPrice,
|
||||||
@RequestParam(value = "autobuy", required = true) Boolean shouldReorder,
|
@RequestParam(value = "autobuy", required = true) Boolean shouldReorder,
|
||||||
@RequestParam(value = "categories", required = true) String categories,
|
@RequestParam(value = "categorie", required = true) String categories,
|
||||||
@RequestParam(value = "img", required = true) MultipartFile imgFile) {
|
@RequestParam(value = "img", required = true) MultipartFile imgFile) {
|
||||||
|
|
||||||
Article tmpArticle = articleRepository.findArticleById(id); // get the old article
|
Article tmpArticle = articleRepository.findArticleById(id); // get the old article
|
||||||
|
@ -93,7 +93,7 @@ public class InternArticleController {
|
||||||
tmpArticle.categories.clear();
|
tmpArticle.categories.clear();
|
||||||
|
|
||||||
// loop through all categories strings and create a new category if a new one;
|
// loop through all categories strings and create a new category if a new one;
|
||||||
// also adds the categorys to the article
|
// also adds the categories to the article
|
||||||
for (String category : separatedCategories) {
|
for (String category : separatedCategories) {
|
||||||
tmpArticle.categories.add(categoryRepository.findCategoryByName(category.trim())
|
tmpArticle.categories.add(categoryRepository.findCategoryByName(category.trim())
|
||||||
.orElseGet(() -> new Category(category.trim())));
|
.orElseGet(() -> new Category(category.trim())));
|
||||||
|
|
|
@ -24,21 +24,21 @@
|
||||||
<form class="detailgrid" action="#" th:action="@{/intern/articles/{id}/saveChanges(id = ${ArticleID.id})}" th:object="${ArticleID}" method="POST" enctype="multipart/form-data">
|
<form class="detailgrid" action="#" th:action="@{/intern/articles/{id}/saveChanges(id = ${ArticleID.id})}" th:object="${ArticleID}" method="POST" enctype="multipart/form-data">
|
||||||
<p class="m">
|
<p class="m">
|
||||||
<label for="title">Titel</label>
|
<label for="title">Titel</label>
|
||||||
<input class=" full-width" type="text" id="title" name="title" required="required" pattern="[A-Za-z0-9]{1,20}" th:value="${ArticleID.title}"/>
|
<input class=" full-width" type="text" id="title" name="title" required="required" pattern=".+" th:value="${ArticleID.title}"/>
|
||||||
</p>
|
</p>
|
||||||
<p class="s">
|
<p class="s">
|
||||||
<label for="ref-article">Refernzierter Artikel</label>
|
<label for="ref_disabled">Refernzierter Artikel</label>
|
||||||
<input class="" type="text" id="ref_disabled" th:value="${ArticleID.offer_id}" disabled/>
|
<input class="" type="text" id="ref_disabled" th:value="${ArticleID.offer_id}" disabled/>
|
||||||
|
|
||||||
<input type="hidden" id="ref_hidden" th:value="${ArticleID.offer_id}" name="ref-article" />
|
<input type="hidden" id="ref_hidden" th:value="${ArticleID.offer_id}" name="ref-article" />
|
||||||
|
|
||||||
<td><a th:href="${'/intern/supplierOffers/#q=' + {ArticleID.id}}">Details</a></td>
|
<a th:href="${'/intern/supplierOffers/#q=' + ArticleID.id}">Details</a>
|
||||||
</p>
|
</p>
|
||||||
<div class="spacer"></div>
|
<div class="spacer"></div>
|
||||||
<div class="m">
|
<div class="m">
|
||||||
<p>
|
<p>
|
||||||
<label for="img">Bild Hochladen</label>
|
<label for="img">Bild Hochladen</label>
|
||||||
<input class="full-width" type="file" id="image" name="img"/>
|
<input class="full-width" type="file" id="img" name="img"/>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<img th:src="@{/shop/articles/{id}/image.jpg(id=${ArticleID.id})}" class="m"/>
|
<img th:src="@{/shop/articles/{id}/image.jpg(id=${ArticleID.id})}" class="m"/>
|
||||||
|
@ -47,14 +47,14 @@
|
||||||
<div class="s">
|
<div class="s">
|
||||||
<p>
|
<p>
|
||||||
<label for="price">Preis (Netto)</label>
|
<label for="price">Preis (Netto)</label>
|
||||||
<input class="" type="number" step="0.01" name="price_netto" th:value="${ArticleID.price_netto}"/> EUR <br/>
|
<input class="" type="number" id="price" step="0.01" name="price_netto" required th:value="${ArticleID.price_netto}"/> EUR <br/>
|
||||||
(19% Mwst.)
|
(19% Mwst.)
|
||||||
<!-- Info von article ref--> <br/>
|
<!-- Info von article ref--> <br/>
|
||||||
= <span th:text="${ArticleID.price}"></span> EUR Brutto
|
= <span th:text="${ArticleID.price}"></span> EUR Brutto
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<label for="max-price-buy">Maximaler Einkaufspreis (Netto)</label>
|
<label for="reorderMaxPrice">Maximaler Einkaufspreis (Netto)</label>
|
||||||
<input class="" type="number" id="reorderMaxPrice" step="0.01" name="reorderMaxPrice" th:value="${ArticleID.reorderMaxPrice}"/> EUR
|
<input class="" type="number" id="reorderMaxPrice" step="0.01" required name="reorderMaxPrice" th:value="${ArticleID.reorderMaxPrice}"/> EUR
|
||||||
</p>
|
</p>
|
||||||
<div>
|
<div>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
|
@ -66,18 +66,18 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="m">
|
<div class="m">
|
||||||
<label for="tags">Kategorien</label>
|
<label for="categorie">Kategorien</label>
|
||||||
<p>
|
<p>
|
||||||
Bitte jede Kategorien in eine eigene Zeile
|
Bitte jede Kategorien in eine eigene Zeile
|
||||||
</p>
|
</p>
|
||||||
<textarea name="categories" id="categories" class="full-width" rows="6"th:inline="text">[[${ArticleID.categorie}]]
|
<textarea name="categorie" id="categorie" class="full-width" required rows="6" th:inline="text" th:field="${ArticleID.categorie}">
|
||||||
|
|
||||||
</textarea>
|
</textarea>
|
||||||
</div>
|
</div>
|
||||||
<div class="s">
|
<div class="s">
|
||||||
<p>
|
<p>
|
||||||
<label for="price">Einheiten pro Lagerplatz</label>
|
<label for="units-per-slot">Einheiten pro Lagerplatz</label>
|
||||||
<input class="" type="number" id="units-per-slot" name="units-per-slot" th:value="${ArticleID.warehouseUnitsPerSlot}"/>
|
<input class="" type="number" id="units-per-slot" required name="units-per-slot" th:value="${ArticleID.warehouseUnitsPerSlot}"/>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<b>Lagerbestand: <span th:text="${ArticleID.stock}"></span></b>
|
<b>Lagerbestand: <span th:text="${ArticleID.stock}"></span></b>
|
||||||
|
@ -88,12 +88,12 @@
|
||||||
<!-- TODO: set link g-->
|
<!-- TODO: set link g-->
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<a href="/todo" class="button smaller">Lagerbuchung</a>
|
<a href="/intern/warehouse/" class="button smaller">Lagerbuchung</a>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<p class="l">
|
<p class="l">
|
||||||
<label for="description">Beschreibung</label>
|
<label for="description">Beschreibung</label>
|
||||||
<textarea name="description" id="description" class="full-width" rows="15" th:inline="text">[[${ArticleID.description}]]
|
<textarea name="description" id="description" class="full-width" required th:field="${ArticleID.description}" rows="15" th:inline="text">
|
||||||
</textarea>
|
</textarea>
|
||||||
</p>
|
</p>
|
||||||
<div class="l">
|
<div class="l">
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<th colspan="9">
|
<th colspan="9">
|
||||||
<input type="text" placeholder="Filtern" class="smaller jsFilterTable full-width"
|
<input type="text" placeholder="Filtern" class="smaller jsFilterTable full-width"
|
||||||
data-target-id="main-table"></input>
|
data-target-id="main-table"/>
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
<thead>
|
<thead>
|
||||||
|
@ -53,10 +53,10 @@
|
||||||
<td><span th:text="${article.price_netto}"></span> €</td>
|
<td><span th:text="${article.price_netto}"></span> €</td>
|
||||||
<td><span th:text="${article.categorie}"></span></td>
|
<td><span th:text="${article.categorie}"></span></td>
|
||||||
<td><span th:text="${article.stock}"></span></td>
|
<td><span th:text="${article.stock}"></span></td>
|
||||||
<td><a th:href="${'/intern/supplierOffers/#q=' + {article.title}}" th:text="${article.offer_id}"></a></td>
|
<td><a th:href="${'/intern/supplierOffers/#q=' + article.title}" th:text="${article.offer_id}"></a></td>
|
||||||
<td><a th:href="@{/intern/articles/{id}(id = ${article.id})}" th:text="${article.id}"></a></td>
|
<td><a th:href="@{/intern/articles/{id}(id = ${article.id})}" th:text="${article.id}"></a></td>
|
||||||
<td>
|
<td>
|
||||||
<form th:action="@{/intern/articles/{id}(id = ${article.id})}"><input type="submit" value="Bearbeiten" /></form>
|
<form th:action="@{/intern/articles/{id}(id = ${article.id})}"><input class="button smaller" type="submit" value="Bearbeiten" /></form>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
|
@ -54,7 +54,7 @@
|
||||||
<!-- ELSE -->
|
<!-- ELSE -->
|
||||||
<div th:unless="${article.offerIsListed}">
|
<div th:unless="${article.offerIsListed}">
|
||||||
<form class="detailgrid" action="#" th:action="@{/intern/articles/addArticle/{id}(id = ${article.offer_id})}" method="POST">
|
<form class="detailgrid" action="#" th:action="@{/intern/articles/addArticle/{id}(id = ${article.offer_id})}" method="POST">
|
||||||
<input type="submit" value="Hinzufügen" />
|
<input class="button smaller" type="submit" value="Hinzufügen" />
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
|
Reference in New Issue