Merge pull request 'fix/intern_articles' (#39) from fix/intern_articles into master
Reviewed-by: Jannik Seiler <seil0@mosad.xyz>
This commit is contained in:
commit
e9a3cb51ba
@ -83,7 +83,7 @@ public class InternArticleController {
|
||||
@RequestParam(value = "price_netto", required = true) String pricenetto,
|
||||
@RequestParam(value = "reorderMaxPrice", required = true) String reorderMaxPrice,
|
||||
@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) {
|
||||
|
||||
Article tmpArticle = articleRepository.findArticleById(id); // get the old article
|
||||
@ -93,7 +93,7 @@ public class InternArticleController {
|
||||
tmpArticle.categories.clear();
|
||||
|
||||
// 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) {
|
||||
tmpArticle.categories.add(categoryRepository.findCategoryByName(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">
|
||||
<p class="m">
|
||||
<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 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 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>
|
||||
<div class="spacer"></div>
|
||||
<div class="m">
|
||||
<p>
|
||||
<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>
|
||||
<img th:src="@{/shop/articles/{id}/image.jpg(id=${ArticleID.id})}" class="m"/>
|
||||
@ -47,14 +47,14 @@
|
||||
<div class="s">
|
||||
<p>
|
||||
<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.)
|
||||
<!-- Info von article ref--> <br/>
|
||||
= <span th:text="${ArticleID.price}"></span> EUR Brutto
|
||||
</p>
|
||||
<p>
|
||||
<label for="max-price-buy">Maximaler Einkaufspreis (Netto)</label>
|
||||
<input class="" type="number" id="reorderMaxPrice" step="0.01" name="reorderMaxPrice" th:value="${ArticleID.reorderMaxPrice}"/> EUR
|
||||
<label for="reorderMaxPrice">Maximaler Einkaufspreis (Netto)</label>
|
||||
<input class="" type="number" id="reorderMaxPrice" step="0.01" required name="reorderMaxPrice" th:value="${ArticleID.reorderMaxPrice}"/> EUR
|
||||
</p>
|
||||
<div>
|
||||
<fieldset>
|
||||
@ -66,18 +66,18 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="m">
|
||||
<label for="tags">Kategorien</label>
|
||||
<label for="categorie">Kategorien</label>
|
||||
<p>
|
||||
Bitte jede Kategorien in eine eigene Zeile
|
||||
</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 class="s">
|
||||
<p>
|
||||
<label for="price">Einheiten pro Lagerplatz</label>
|
||||
<input class="" type="number" id="units-per-slot" name="units-per-slot" th:value="${ArticleID.warehouseUnitsPerSlot}"/>
|
||||
<label for="units-per-slot">Einheiten pro Lagerplatz</label>
|
||||
<input class="" type="number" id="units-per-slot" required name="units-per-slot" th:value="${ArticleID.warehouseUnitsPerSlot}"/>
|
||||
</p>
|
||||
<p>
|
||||
<b>Lagerbestand: <span th:text="${ArticleID.stock}"></span></b>
|
||||
@ -88,12 +88,12 @@
|
||||
<!-- TODO: set link g-->
|
||||
</p>
|
||||
<p>
|
||||
<a href="/todo" class="button smaller">Lagerbuchung</a>
|
||||
<a href="/intern/warehouse/" class="button smaller">Lagerbuchung</a>
|
||||
</p>
|
||||
</div>
|
||||
<p class="l">
|
||||
<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>
|
||||
</p>
|
||||
<div class="l">
|
||||
|
@ -29,7 +29,7 @@
|
||||
<tr>
|
||||
<th colspan="9">
|
||||
<input type="text" placeholder="Filtern" class="smaller jsFilterTable full-width"
|
||||
data-target-id="main-table"></input>
|
||||
data-target-id="main-table"/>
|
||||
</th>
|
||||
</tr>
|
||||
<thead>
|
||||
@ -53,10 +53,10 @@
|
||||
<td><span th:text="${article.price_netto}"></span> €</td>
|
||||
<td><span th:text="${article.categorie}"></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>
|
||||
<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>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -54,7 +54,7 @@
|
||||
<!-- ELSE -->
|
||||
<div th:unless="${article.offerIsListed}">
|
||||
<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>
|
||||
</div>
|
||||
</td>
|
||||
|
Reference in New Issue
Block a user