fixed route for /intern/articles and /intern/suppliers/articles
This commit is contained in:
parent
22d2744c8c
commit
09c85fe8cb
|
@ -170,7 +170,7 @@ public class RequestController {
|
|||
}
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
@GetMapping("/intern/articles/")
|
||||
public String internArticles() {
|
||||
return "intern/articles/index";
|
||||
|
@ -180,6 +180,7 @@ public class RequestController {
|
|||
public String internArticlesId() {
|
||||
return "intern/articles/id";
|
||||
}
|
||||
*/
|
||||
|
||||
@GetMapping("/intern/customers/")
|
||||
public String internCustomers() {
|
||||
|
|
|
@ -12,7 +12,7 @@ import org.springframework.ui.Model;
|
|||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("intern/listedArticles")
|
||||
@RequestMapping("intern/articles")
|
||||
public class InternArticleController {
|
||||
@Autowired
|
||||
private final ArticleRepository articleRepository = null;
|
||||
|
@ -49,6 +49,26 @@ public class InternArticleController {
|
|||
|
||||
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 {
|
||||
|
||||
|
|
|
@ -13,11 +13,7 @@
|
|||
<ul>
|
||||
<li><a th:href="@{/intern/}">Dashboard</a>
|
||||
</li>
|
||||
<li><a th:href="@{/intern/listedArticles/}">Gelistete Artikel</a>
|
||||
<ul>
|
||||
<li><a th:href="@{/intern/articles/}">Händlerangebote</a>
|
||||
</li>
|
||||
</ul>
|
||||
<li><a th:href="@{/intern/articles/}">Gelistete Artikel</a>
|
||||
</li>
|
||||
<li><a th:href="@{/intern/accounting/}">Alle Buchungen</a>
|
||||
<ul>
|
||||
|
@ -38,7 +34,7 @@
|
|||
<li><a th:href="@{/intern/suppliers/}">Lieferanten</a>
|
||||
<ul>
|
||||
<li><a th:href="@{/intern/supplierOrders/}">Bestellungen</a></li>
|
||||
<li><a th:href="@{/intern/articles/}">> Händlerangebote</a></li>
|
||||
<li><a th:href="@{/intern/suppliers/articles/}">> Händlerangebote</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
|
|
@ -52,14 +52,14 @@
|
|||
</thead>
|
||||
<tbody>
|
||||
<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.price}"></span></td>
|
||||
<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/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/suppliers/articles/{id}(id = ${article.offer_id})}" th:text="${article.offer_id}"></a></td>
|
||||
<td><a th:href="@{/intern/articles/{id}(id = ${article.id})}" th:text="${article.id}"></a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
Reference in New Issue