WIP feature/listedArticles #15

Merged
Seil0 merged 33 commits from feature/listedArticles into master 2020-05-15 19:48:22 +02:00
4 changed files with 28 additions and 11 deletions
Showing only changes of commit 09c85fe8cb - Show all commits

View File

@ -170,7 +170,7 @@ public class RequestController {
} }
*/ */
/*
@GetMapping("/intern/articles/") @GetMapping("/intern/articles/")
public String internArticles() { public String internArticles() {
return "intern/articles/index"; return "intern/articles/index";
@ -180,6 +180,7 @@ public class RequestController {
public String internArticlesId() { public String internArticlesId() {
return "intern/articles/id"; return "intern/articles/id";
} }
*/
@GetMapping("/intern/customers/") @GetMapping("/intern/customers/")
public String internCustomers() { public String internCustomers() {

View File

@ -12,7 +12,7 @@ import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@Controller @Controller
@RequestMapping("intern/listedArticles") @RequestMapping("intern/articles")
public class InternArticleController { public class InternArticleController {
@Autowired @Autowired
private final ArticleRepository articleRepository = null; private final ArticleRepository articleRepository = null;
@ -49,6 +49,26 @@ public class InternArticleController {
return "intern/listedArticles/id"; return "intern/listedArticles/id";
} }
@PostMapping("/{id}")
public String newEmployee( Model model, @PathVariable String id) {
System.out.println("\n------ POST -----\n");
int articleid = Integer.parseInt(id);
ListedArticlesListIdTotal total = new ListedArticlesListIdTotal();
total.addArticle(articleRepository.findArticleById(articleid),
warehouseEntryRepository.getArticleStock(articleid).orElse(0));
model.addAttribute("ArticleID", total);
return "intern/listedArticles/id";
}
public static class ListedArticlesListTotals { public static class ListedArticlesListTotals {
Outdated
Review

String[] separatedCategories

String[] separatedCategories
Review

fixed with a98782bc01

fixed with https://git.mosad.xyz/localhorst/e-commerce/commit/a98782bc01fcdd03b746a9030539fc2bdf9301c4

View File

@ -13,11 +13,7 @@
<ul> <ul>
<li><a th:href="@{/intern/}">Dashboard</a> <li><a th:href="@{/intern/}">Dashboard</a>
</li> </li>
<li><a th:href="@{/intern/listedArticles/}">Gelistete Artikel</a> <li><a th:href="@{/intern/articles/}">Gelistete Artikel</a>
<ul>
<li><a th:href="@{/intern/articles/}">Händlerangebote</a>
</li>
</ul>
</li> </li>
<li><a th:href="@{/intern/accounting/}">Alle Buchungen</a> <li><a th:href="@{/intern/accounting/}">Alle Buchungen</a>
<ul> <ul>
@ -38,7 +34,7 @@
<li><a th:href="@{/intern/suppliers/}">Lieferanten</a> <li><a th:href="@{/intern/suppliers/}">Lieferanten</a>
<ul> <ul>
<li><a th:href="@{/intern/supplierOrders/}">Bestellungen</a></li> <li><a th:href="@{/intern/supplierOrders/}">Bestellungen</a></li>
<li><a th:href="@{/intern/articles/}">&gt; Händlerangebote</a></li> <li><a th:href="@{/intern/suppliers/articles/}">&gt; Händlerangebote</a></li>
</ul> </ul>
</li> </li>

View File

@ -52,14 +52,14 @@
</thead> </thead>
<tbody> <tbody>
<tr th:each="article : ${ListedArticles}"> <tr th:each="article : ${ListedArticles}">
<td><img th:src="${article.imgPath}" class="s"/></td> <td><img th:src="@{/shop/articles/{id}/image.jpg(id=${article.id})}" class="s"/></td>
<td><span th:text="${article.title}"></span></td> <td><span th:text="${article.title}"></span></td>
<td><span th:text="${article.price}"></span></td> <td><span th:text="${article.price}"></span></td>
<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/articles/{id}(id = ${article.offer_id})}" th:text="${article.offer_id}"></a></td> <td><a th:href="@{/intern/suppliers/articles/{id}(id = ${article.offer_id})}" th:text="${article.offer_id}"></a></td>
<td><a th:href="@{/intern/listedArticles/{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>
</tr> </tr>
</tbody> </tbody>
</table> </table>