Include layout.html

This commit is contained in:
Mathis Kral 2023-11-13 20:09:39 +01:00 committed by Simon Bruder
parent 38eda35e6c
commit 97a020b59f
Signed by: simon
GPG key ID: 8D3C82F9F309F8EC
18 changed files with 551 additions and 597 deletions

View file

@ -1,90 +1,50 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org/extras/spring-security"
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout">
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{layout.html(title='Katalog')}">
<head>
<meta charset="utf-8">
<link rel="stylesheet" th:href="@{/resources/css/style.css}">
<title th:text="Katalog">Katalog</title>
</head>
<body>
<div class="topnav"> <!-- später für css -->
<a th:href="@{/}" th:text="Home">Home</a>
<a th:href="@{/catalog}" th:text="Katalog">Katalog</a>
<a th:href="@{/event}" th:text="Eventplaner">Eventplaner</a>
<a th:href="@{/orders}" th:text="Aufträge">Aufträge</a>
<!--<a href="#account">Mein Konto</a>-->
</div>
<div>
<h1>Katalog</h1>
</div>
<div>
<table style="width: 100%;">
<tr style="text-align: left;">
<th></th>
<th>Name</th>
<th>Mindestzeitraum</th>
<th>Basisausstattung</th>
<th>Preis ab</th>
</tr>
<tr th:each="catalogEntry : ${catalogEntries}">
<td>
**BILD**
</td>
<td th:text="${catalogEntry.getEventType()}">
<td th:text="${catalogEntry.getMinimumTimePeriod()}">h
<td>
<ul th:each="product : ${catalogEntry.getProducts()}">
<li th:text="${product}"/>
</ul>
</td>
<td th:text="${catalogEntry.getTotalCost()}">
<td>
<form method="post" th:action="@{/catalog/remove}">
<input type="hidden" name="catalogEntryID" th:value="${catalogEntry.getId()}">
<button type="submit">Entfernen</button>
</form>
</td>
</tr>
</table>
</div>
<div>
<form th:action="@{/catalog_editor}">
<button type="submit">Hinzufügen</button>
</form>
</div>
<div>
<form th:action="@{/catalog_editor}">
<button type="submit">Hinzufügen</button>
</form>
</div>
<div>
<form th:action="@{/catalog_editor}">
<button type="submit">Hinzufügen</button>
</form>
</div>
<div>
<form th:action="@{/catalog_editor}">
<button type="submit">Hinzufügen</button>
</form>
</div>
<div>
<button type="button">Hinzufügen</button>
</div>
<section layout:fragment="content">
<div>
<table style="width: 100%;">
<tr style="text-align: left;">
<th></th>
<th>Name</th>
<th>Mindestzeitraum</th>
<th>Basisausstattung</th>
<th>Preis ab</th>
</tr>
<tr th:each="catalogEntry : ${catalogEntries}">
<td>
**BILD**
</td>
<td th:text="${catalogEntry.getEventType()}">
<td th:text="${catalogEntry.getMinimumTimePeriod()}">h
<td>
<ul th:each="product : ${catalogEntry.getProducts()}">
<li th:text="${product}"/>
</ul>
</td>
<td th:text="${catalogEntry.getTotalCost()}">
<td>
<form method="post" th:action="@{/catalog/remove}">
<input type="hidden" name="catalogEntryID" th:value="${catalogEntry.getId()}">
<button type="submit">Entfernen</button>
</form>
</td>
</tr>
</table>
</div>
<div>
<form th:action="@{/catalog_editor}">
<button type="submit">Hinzufügen</button>
</form>
</div>
</section>
</body>
<footer style="bottom: 0; position: absolute;">
<p>© Hannes Wurst @ Mampf GmbH</p>
<p>
<a href="mailto:catering@mampf.com">catering@mampf.com</a>
</p>
</footer>
</html>

View file

@ -1,84 +1,75 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org/extras/spring-security"
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout">
<head>
<title>Basisevent-Konfiguration</title>
</head>
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{layout.html(title='Katalog bearbeiten')}">
<body>
<nav>
<div class="topnav"> <!-- später für css -->
<a th:href="@{/}" th:text="Home">Home</a>
<a th:href="@{/catalog}" th:text="Katalog">Katalog</a>
<a th:href="@{/event}" th:text="Eventplaner">Eventplaner</a>
<a th:href="@{/orders}" th:text="Aufträge">Aufträge</a>
<!--<a href="#account">Mein Konto</a>-->
<section layout:fragment="content">
<input type="hidden" name="addCatalog">
<div class="content">
<h2>Dienstleistung</h2>
<label for="events"></label>
<form th:object="${formCatalogEntry}" method="post" th:action="@{/catalog_editor/chooseEvent}">
<select name="events" id="events">
<option value="event_catering">Eventcatering</option>
<option value="party_service">Partyservice</option>
<option value="mobile_breakfast">Mobile Breakfast</option>
<option value="rent_a_cook">Rent-a-Cook</option>
</select>
<button type="submit">Event auswählen</button>
</form>
Eventbasispreis: 500€
<h2>Mindestzeitraum</h2>
<form th:object="${formCatalogEntry}" method="post" th:action="@{/catalog_editor/add_time}">
<label>Mindestzeitraum:</label>
<input type="hidden" th:field="*{eventType}">
<input th:field="*{minimumTimePeriod}" type="number" min="0" step="1" value="1"/>
<button type="submit">Zum Model hinzufügen</button>
</form>
<h2>Basisausstattung</h2>
<table>
<tr>
<th>Produktname</th>
<th>Menge</th>
<th>Stückpreis</th>
</tr>
<tr th:each="item : ${inventory}">
<td th:text="${item.getName()}">
<td th:text="${item.getAmount()}">
<td th:text="${item.getCost()}">
<td>
<form method="post" th:action="@{/catalog_editor/remove_product}">
<input type="hidden" name="id" th:value="${item.getItemId()}">
<button type="submit">Entfernen</button>
</form>
</td>
</table>
<hr>
<div style="height: 20px;"></div>
<form method="post" th:action="@{/catalog_editor/product_add}">
<label for="name">Produktname</label>
<input type="text" id="name" name="name" required>
<label for="amount">Menge</label>
<input type="number" id="amount" name="amount" min="1" required>
<input type="hidden" name="cost" value="50.0">
<button type="submit">Artikel hinzufügen</button>
</form>hinzufügen
<br>
<h3>Momentane Auswahl</h3>
Eventtyp: <span th:text="${formCatalogEntry.getEventType()}"></span><br>
Mindestzeitraum: <span th:text="${formCatalogEntry.getMinimumTimePeriod()}"></span><br>
<span>Gesamtpreis: 90 €</span>
<form method="post" th:action="@{/catalog_editor/catalog_add}" th:object="${formCatalogEntry}">
<input type="hidden" name="eventType" th:value="${formCatalogEntry.getEventType()}">
<input type="hidden" name="products" th:value="${inventory}">
<input type="hidden" name="minimumTimePeriod" th:value="${formCatalogEntry.getMinimumTimePeriod}">
<input type="hidden" name="totalCost" th:value="${formCatalogEntry.getTotalCost()}">
<button type="submit">Zum Katalog hinzufügen</button>
</form>
</div>
</nav>
<h1>Basisevent konfigurieren</h1>
<input type="hidden" name="addCatalog">
<div class="content">
<h2>Dienstleistung</h2>
<label for="events"></label>
<form th:object="${formCatalogEntry}" method="post" th:action="@{/catalog_editor/chooseEvent}">
<select name="events" id="events">
<option value="event_catering">Eventcatering</option>
<option value="party_service">Partyservice</option>
<option value="mobile_breakfast">Mobile Breakfast</option>
<option value="rent_a_cook">Rent-a-Cook</option>
</select>
<button type="submit">Event auswählen</button>
</form>
Eventbasispreis: 500€
<h2>Mindestzeitraum</h2>
<form th:object="${formCatalogEntry}" method="post" th:action="@{/catalog_editor/add_time}">
<label>Mindestzeitraum:</label>
<input type="hidden" th:field="*{eventType}">
<input th:field="*{minimumTimePeriod}" type="number" min="0" step="1" value="1"/>
<button type="submit">Zum Model hinzufügen</button>
</form>
<h2>Basisausstattung</h2>
<table>
<tr>
<th>Produktname</th>
<th>Menge</th>
<th>Stückpreis</th>
</tr>
<tr th:each="item : ${inventory}">
<td th:text="${item.getName()}">
<td th:text="${item.getAmount()}">
<td th:text="${item.getCost()}">
<td>
<form method="post" th:action="@{/catalog_editor/remove_product}">
<input type="hidden" name="id" th:value="${item.getItemId()}">
<button type="submit">Entfernen</button>
</form>
</td>
</table>
<hr>
<div style="height: 20px;"></div>
<form method="post" th:action="@{/catalog_editor/product_add}">
<label for="name">Produktname</label>
<input type="text" id="name" name="name" required>
<label for="amount">Menge</label>
<input type="number" id="amount" name="amount" min="1" required>
<input type="hidden" name="cost" value="50.0">
<button type="submit">Artikel hinzufügen</button>
</form>hinzufügen
<br>
<h3>Momentane Auswahl</h3>
Eventtyp: <span th:text="${formCatalogEntry.getEventType()}"></span><br>
Mindestzeitraum: <span th:text="${formCatalogEntry.getMinimumTimePeriod()}"></span><br>
<span>Gesamtpreis: 90 €</span>
<form method="post" th:action="@{/catalog_editor/catalog_add}" th:object="${formCatalogEntry}">
<input type="hidden" name="eventType" th:value="${formCatalogEntry.getEventType()}">
<input type="hidden" name="products" th:value="${inventory}">
<input type="hidden" name="minimumTimePeriod" th:value="${formCatalogEntry.getMinimumTimePeriod}">
<input type="hidden" name="totalCost" th:value="${formCatalogEntry.getTotalCost()}">
<button type="submit">Zum Katalog hinzufügen</button>
</form>
</div>
</section>
</body>
</html>

View file

@ -1,43 +1,43 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<link rel="stylesheet" th:href="@{/resources/css/customer/style.css}" />
<title th:text="${title}"></title>
</head>
<html xmlns:th="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org/extras/spring-security"
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{layout.html(title='Kundenverwaltung')}">
<body>
<div class="verwaltung">
<h1>Kundenverwaltung</h1>
<h2>Kundenübersicht</h2>
<table>
<tr>
<th>ID</th>
<th>Nachname</th>
<th>Vorname</th>
<th>Aufträge</th>
</tr>
<tr th:each="customer : ${customers}">
<td th:text="${customer.id}">01</td>
<td th:text="${customer.surname}">Musterkoch</td>
<td th:text="${customer.name}">Max</td>
<td><a>Aufträge</a></td>
<td>
<a th:href="@{'/customer/edit/' + ${customer.id}}" class="button"
>Bearbeiten</a
>
</td>
<td>
<form th:action="@{/customer/remove}" method="post">
<input
type="hidden"
th:name="customerID"
th:value="${customer.id}"
/>
<button type="submit" class="delete-icon">Entfernen</button>
</form>
</td>
</tr>
</table>
</div>
<section layout:fragment="content">
<div class="verwaltung">
<h2>Kundenübersicht</h2>
<table>
<tr>
<th>ID</th>
<th>Nachname</th>
<th>Vorname</th>
<th>Aufträge</th>
</tr>
<tr th:each="customer : ${customers}">
<td th:text="${customer.id}">01</td>
<td th:text="${customer.surname}">Musterkoch</td>
<td th:text="${customer.name}">Max</td>
<td><a>Aufträge</a></td>
<td>
<a th:href="@{'/customer/edit/' + ${customer.id}}" class="button"
>Bearbeiten</a
>
</td>
<td>
<form th:action="@{/customer/remove}" method="post">
<input
type="hidden"
th:name="customerID"
th:value="${customer.id}"
/>
<button type="submit" class="delete-icon">Entfernen</button>
</form>
</td>
</tr>
</table>
</div>
</section>
</body>
</html>

View file

@ -1,5 +1,8 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<html xmlns:th="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org/extras/spring-security"
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{layout.html(title='Kunden bearbeiten')}">
<head>
<meta charset="UTF-8" />
<title>Kunde Bearbeiten</title>
@ -10,24 +13,26 @@
/>
</head>
<body>
<div class="edit-customer-form">
<h2>Kunde Bearbeiten</h2>
<form
th:action="@{/customer/update}"
th:object="${customer}"
method="post"
>
<input type="hidden" th:field="*{id}" />
<section layout:fragment="content">
<div class="edit-customer-form">
<h2>Kunde Bearbeiten</h2>
<form
th:action="@{/customer/update}"
th:object="${customer}"
method="post"
>
<input type="hidden" th:field="*{id}" />
<label for="name">Name:</label>
<input type="text" th:field="*{name}" required />
<label for="name">Name:</label>
<input type="text" th:field="*{name}" required />
<label for="surname">Nachname:</label>
<input type="text" th:field="*{surname}" required />
<label for="surname">Nachname:</label>
<input type="text" th:field="*{surname}" required />
<button type="submit">Save</button>
</form>
<a th:href="@{/customer}" class="button">Cancel</a>
</div>
<button type="submit">Save</button>
</form>
<a th:href="@{/customer}" class="button">Cancel</a>
</div>
</section>
</body>
</html>

View file

@ -1,5 +1,8 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<html xmlns:th="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org/extras/spring-security"
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{layout.html(title='Personal bearbeiten')}">
<head>
<meta charset="UTF-8" />
<title>Personal Bearbeiten</title>
@ -7,23 +10,25 @@
<link rel="stylesheet" th:href="@{/resources/css/staff/edit-style.css}" />
</head>
<body>
<div class="edit-staff-form">
<h2>Personal Bearbeiten</h2>
<form th:action="@{/staff/update}" th:object="${staff}" method="post">
<input type="hidden" th:field="*{id}" />
<section layout:fragment="content">
<div class="edit-staff-form">
<h2>Personal Bearbeiten</h2>
<form th:action="@{/staff/update}" th:object="${staff}" method="post">
<input type="hidden" th:field="*{id}" />
<label for="name">Name:</label>
<input type="text" th:field="*{name}" required />
<label for="name">Name:</label>
<input type="text" th:field="*{name}" required />
<label for="surname">Nachname:</label>
<input type="text" th:field="*{surname}" required />
<label for="surname">Nachname:</label>
<input type="text" th:field="*{surname}" required />
<label for="job">Beruf:</label>
<input type="text" th:field="*{job}" required />
<label for="job">Beruf:</label>
<input type="text" th:field="*{job}" required />
<button type="submit">Save</button>
</form>
<a th:href="@{/staff}" class="button">Cancel</a>
</div>
<button type="submit">Save</button>
</form>
<a th:href="@{/staff}" class="button">Cancel</a>
</div>
</section>
</body>
</html>

View file

@ -1,75 +1,56 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org/extras/spring-security"
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout">
<head>
<meta charset="utf-8">
<link rel="stylesheet" th:href="@{/resources/css/style.css}">
<title th:text="Eventplaner">Katalog</title>
</head>
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{layout.html(title='Event konfigurieren')}">
<body>
<div class="topnav"> <!-- später für css -->
<a th:href="@{/}" th:text="Home">Home</a>
<a th:href="@{/catalog}" th:text="Katalog">Katalog</a>
<a th:href="@{/event}" th:text="Eventplaner">Eventplaner</a>
<a th:href="@{/orders}" th:text="Aufträge">Aufträge</a>
<!--<a href="#account">Mein Konto</a>-->
</div>
<section layout:fragment="content">
<span th:text="'Typ: ' + ${orderType}"/>
<h1>Eventplaner (planen Sie Ihr Event)</h1>
<span th:text="'Typ: ' + ${orderType}"/>
<form th:action="@{/event/changeOrderType}" method="post">
<select name="orderType">
<option disabled="disabled" selected value="NULL" th:text="' -- Wählen Sie eine Option -- '"/>
<option th:value="'SE'" th:text="'Something else'"/>
<option th:value="'RaK'" th:text="Rent-a-Cook"/>
<option th:value="'EK'" th:text="Eventcatering"/>
<option th:value="'SN'" th:text="'Sushi Night'"/>
</select>
<input type="submit" value="Eventtypen ändern"/>
</form>
<table style="width:100%; text-align:left">
<tr>
<th>Produkt</th>
<th>Anzahl</th>
</tr>
<tr th:each="key : ${items.keySet()}">
<td th:text="${key}">Sake Nigiri</td>
<td th:text="${items.get(key)}">200</td>
</tr>
</table>
<h4>Product hinzufügen</h4>
<form th:action="@{/event/addProduct}" th:object="${productForm}" method="post">
<div>
<label>Produkt</label>
<input type="text" th:field="*{product}" placeholder="Produktname" required/>
</div>
<div>
<label>Anzahl</label>
<input type="number" th:field="*{number}" placeholder="Anzahl" min="1" required/>
</div>
<input type="submit" value="Submit"/>
</form>
<div>
<form method="post" th:action="@{/event/checkout}">
<input type="submit" th:value="'Kostenpflichtig bestellen'"/>
<form th:action="@{/event/changeOrderType}" method="post">
<select name="orderType">
<option disabled="disabled" selected value="NULL" th:text="' -- Wählen Sie eine Option -- '"/>
<option th:value="'SE'" th:text="'Something else'"/>
<option th:value="'RaK'" th:text="Rent-a-Cook"/>
<option th:value="'EK'" th:text="Eventcatering"/>
<option th:value="'SN'" th:text="'Sushi Night'"/>
</select>
<input type="submit" value="Eventtypen ändern"/>
</form>
</div>
<table style="width:100%; text-align:left">
<tr>
<th>Produkt</th>
<th>Anzahl</th>
</tr>
<tr th:each="key : ${items.keySet()}">
<td th:text="${key}">Sake Nigiri</td>
<td th:text="${items.get(key)}">200</td>
</tr>
</table>
<h4>Product hinzufügen</h4>
<form th:action="@{/event/addProduct}" th:object="${productForm}" method="post">
<div>
<label>Produkt</label>
<input type="text" th:field="*{product}" placeholder="Produktname" required/>
</div>
<div>
<label>Anzahl</label>
<input type="number" th:field="*{number}" placeholder="Anzahl" min="1" required/>
</div>
<input type="submit" value="Submit"/>
</form>
<div>
<form method="post" th:action="@{/event/checkout}">
<input type="submit" th:value="'Kostenpflichtig bestellen'"/>
</form>
</div>
</section>
</body>
<footer style="bottom: 0; position: absolute;">
<p>© Hannes Wurst @ Mampf GmbH</p>
<p>
<a href="mailto:catering@mampf.com">catering@mampf.com</a>
</p>
</footer>
</html>

View file

@ -1,42 +1,43 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org/extras/spring-security"
<head>
</head>
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{layout.html(title='Lagerverwaltung')}">
<body>
<h1>Lagerverwaltung</h1>
<h2 th:text="${'Produkt ' + (product == null ? 'anlegen' : 'bearbeiten')}"></h2>
<!-- TODO: maybe migrate to th:field (which is a pain) -->
<form method="post">
<div>
<label for="type">Typ</label>
<input type="radio" name="type" th:each="type : ${T(catering.catalog.CatalogDummyType).values()}" th:value="${type}" th:text="${type}" th:checked="${type.name() == product?.type?.name()}" required/>
</div>
<div>
<label for="name">Produktname</label>
<input type="text" name="name" th:value="${product?.name}" required/>
</div>
<div>
<label for="quantity">Menge im Bestand</label>
<input type="number" name="quantity" th:value="${item?.quantity}" required/>
</div>
<div>
<label for="wholesalePrice">Einkaufspreis</label>
<input type="number" name="wholesalePrice" step="0.01" min="0" th:value="${#numbers.formatDecimal(product?.wholesalePrice?.getNumber()?.doubleValueExact(), 1, 2)}" required/>
</div>
<div>
<label for="retailPrice">UVP</label>
<input type="number" name="retailPrice" step="0.01" min="0" th:value="${#numbers.formatDecimal(product?.price?.getNumber()?.doubleValueExact(), 1, 2)}" required/>
</div>
<div>
<!-- FIXME darf nur bei angeboten als teil von partyservice angezeigt werden -->
<label for="promotionPrice">Aktionspreis</label>
<input type="number" name="promotionPrice" step="0.01" min="0" th:value="${#numbers.formatDecimal(product?.promotionPrice?.getNumber()?.doubleValueExact(), 1, 2)}"/>
</div>
<div>
<button type="submit" th:text="${product == null ? 'Hinzufügen' : 'Bearbeiten'}"></button>
</div>
<!-- KANN: Bild und Beschreibungstext -->
</form>
<section layout:fragment="content">
<h2 th:text="${'Produkt ' + (product == null ? 'anlegen' : 'bearbeiten')}"></h2>
<!-- TODO: maybe migrate to th:field (which is a pain) -->
<form method="post">
<div>
<label for="type">Typ</label>
<input type="radio" name="type" th:each="type : ${T(catering.catalog.CatalogDummyType).values()}" th:value="${type}" th:text="${type}" th:checked="${type.name() == product?.type?.name()}" required/>
</div>
<div>
<label for="name">Produktname</label>
<input type="text" name="name" th:value="${product?.name}" required/>
</div>
<div>
<label for="quantity">Menge im Bestand</label>
<input type="number" name="quantity" th:value="${item?.quantity}" required/>
</div>
<div>
<label for="wholesalePrice">Einkaufspreis</label>
<input type="number" name="wholesalePrice" step="0.01" min="0" th:value="${#numbers.formatDecimal(product?.wholesalePrice?.getNumber()?.doubleValueExact(), 1, 2)}" required/>
</div>
<div>
<label for="retailPrice">UVP</label>
<input type="number" name="retailPrice" step="0.01" min="0" th:value="${#numbers.formatDecimal(product?.price?.getNumber()?.doubleValueExact(), 1, 2)}" required/>
</div>
<div>
<!-- FIXME darf nur bei angeboten als teil von partyservice angezeigt werden -->
<label for="promotionPrice">Aktionspreis</label>
<input type="number" name="promotionPrice" step="0.01" min="0" th:value="${#numbers.formatDecimal(product?.promotionPrice?.getNumber()?.doubleValueExact(), 1, 2)}"/>
</div>
<div>
<button type="submit" th:text="${product == null ? 'Hinzufügen' : 'Bearbeiten'}"></button>
</div>
<!-- KANN: Bild und Beschreibungstext -->
</form>
</section>
</body>
</html>

View file

@ -1,44 +1,45 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org/extras/spring-security"
<head>
</head>
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{layout.html(title='Inventar')}">
<body>
<h1>Lagerverwaltung</h1>
<table border>
<thead>
<!-- TODO: i18n? -->
<tr>
<th>ID</th> <!-- FIXME UUIDs are long -->
<th>Produktname</th>
<th>Menge</th>
<th>Einkaufspreis</th>
<th>UVP</th>
<th>Gesamtwert</th>
<th></th> <!-- FIXME: this should be replaced by something more reasonable once CSS comes into play -->
</tr>
</thead>
<tbody>
<tr th:each="item : ${inventory}">
<td th:text="${item.id}"></td>
<td th:text="${item.product.name}"></td>
<td th:text="${item.quantity}"></td>
<td th:text="${item.product.wholesalePrice}"></td>
<td th:if="${item.product.promotionPrice != null}"><del th:text="${item.product.price}"></del> <span th:text="${item.product.promotionPrice}"></span></td>
<td th:if="${item.product.promotionPrice == null}" th:text="${item.product.price}"></td>
<td th:text="${item.product.wholesalePrice.multiply(item.quantity.getAmount())}"></td>
<td><a th:href="@{/inventory/edit/{id}(id=${item.product.id})}"><button></button></a><a th:href="@{/inventory/delete/{id}(id=${item.product.id})}"><button>X</button></a></td>
</tr>
<tr>
<td><a href="/inventory/add"><button></button></a></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td><!-- TODO (optional): add total monetary value of inventory -->
<td></td>
</tr>
</tbody>
</table>
<section layout:fragment="content">
<table border>
<thead>
<!-- TODO: i18n? -->
<tr>
<th>ID</th> <!-- FIXME UUIDs are long -->
<th>Produktname</th>
<th>Menge</th>
<th>Einkaufspreis</th>
<th>UVP</th>
<th>Gesamtwert</th>
<th></th> <!-- FIXME: this should be replaced by something more reasonable once CSS comes into play -->
</tr>
</thead>
<tbody>
<tr th:each="item : ${inventory}">
<td th:text="${item.id}"></td>
<td th:text="${item.product.name}"></td>
<td th:text="${item.quantity}"></td>
<td th:text="${item.product.wholesalePrice}"></td>
<td th:if="${item.product.promotionPrice != null}"><del th:text="${item.product.price}"></del> <span th:text="${item.product.promotionPrice}"></span></td>
<td th:if="${item.product.promotionPrice == null}" th:text="${item.product.price}"></td>
<td th:text="${item.product.wholesalePrice.multiply(item.quantity.getAmount())}"></td>
<td><a th:href="@{/inventory/edit/{id}(id=${item.product.id})}"><button></button></a><a th:href="@{/inventory/delete/{id}(id=${item.product.id})}"><button>X</button></a></td>
</tr>
<tr>
<td><a href="/inventory/add"><button></button></a></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td><!-- TODO (optional): add total monetary value of inventory -->
<td></td>
</tr>
</tbody>
</table>
</section>
</body>
</html>

View file

@ -5,6 +5,7 @@
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<link rel="stylesheet" th:href="@{/resources/css/style.css}">
<!--<link th:href="@{/resources/css/style.css}" rel="stylesheet"-->
<!--href="../static/resources/css/style.css" type="text/css"/>-->
@ -20,4 +21,10 @@
<section layout:fragment="content"></section>
</div>
</body>
<footer style="bottom: 0; position: absolute;">
<p>© Hannes Wurst @ Mampf GmbH</p>
<p>
<a href="mailto:catering@mampf.com">catering@mampf.com</a>
</p>
</footer>
</html>

View file

@ -1,6 +1,8 @@
<!DOCTYPE html>
<html lang="en">
<h1>Login</h1>
<html xmlns:th="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org/extras/spring-security"
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{layout.html(title='Login')}">
<!-- FIXME no inline styles -->
@ -38,32 +40,34 @@
</style>
<form class="ui form" role="form" th:action="@{/login}" method="post">
<section layout:fragment="content">
<form class="ui form" role="form" th:action="@{/login}" method="post">
<div class="field">
<div class="field">
<label for="username">Nutzername</label>
<label for="username">Nutzername</label>
<input class="form-control" type="text" id="username" name="username" autofocus="autofocus" placeholder="Username">
<input class="form-control" type="text" id="username" name="username" autofocus="autofocus" placeholder="Username">
</div>
</div>
<div class="field">
<div class="field">
<label for="password">Passwort</label>
<label for="password">Passwort</label>
<input type="password" id="password" name="password" placeholder="Password">
<input type="password" id="password" name="password" placeholder="Password">
</div>
</div>
<div>
<div>
<button type="submit" class="ui button">Login</button>
<button type="submit" class="ui button">Login</button>
</div>
</div>
</form>
</form>
<p>Haben Sie noch keinen Account? Registrieren Sie sich <a th:href="@{/register}">hier</a>.</p>
<p>Haben Sie noch keinen Account? Registrieren Sie sich <a th:href="@{/register}">hier</a>.</p>
</section>
</html>

View file

@ -6,100 +6,116 @@
<body>
<nav th:fragment="navigation">
<div class="ui menu">
<a
class="item"
href="welcome.html"
th:href="@{/}"
th:text="Startseite"
>
Startseite
</a>
<!--prototype-paul-simon-->
<!--sec:authorize="hasRole('CUSTOMER')"-->
<a
class="item"
href="register.html"
th:href="@{/register}"
sec:authorize="hasRole('CUSTOMER')"
th:text="#{nav.register}"
th:text="Registrierung"
>
Registrierung
</a>
<!--sec:authorize="hasAnyRole('BOSS','CUSTOMER')"-->
<a
class="item"
href="login.html"
th:href="@{/login}"
sec:authorize="hasAnyRole('BOSS','CUSTOMER')"
th:text="#{nav.login}"
th:text="Login"
>
Login
</a>
<!--sec:authorize="hasRole('BOSS')"-->
<a
class="item"
href="inventory.html"
th:href="@{/inventory}"
sec:authorize="hasRole('BOSS')"
th:text="#{nav.inventory}"
th:text="Inventar"
>
Inventar
</a>
<!--prototype-eren-denis-->
<a
class="item"
href="employee.html"
th:href="@{/employee}"
sec:authorize="hasRole('BOSS')"
th:text="#{nav.employee}"
href="catalog.html"
th:href="@{/catalog}"
th:text="Katalog"
>
Katalog
</a>
<!--prototype-eren-denis-->
<!--sec:authorize="hasRole('BOSS')"-->
<a
class="item"
href="staff.html"
th:href="@{/staff}"
th:text="Angestellte"
>
Angestellte
</a>
<!--sec:authorize="hasRole('BOSS')"-->
<a
class="item"
href="customer.html"
th:href="@{/customer}"
sec:authorize="hasRole('BOSS')"
th:text="#{nav.customer}"
th:text="Kunden"
>
Kunden
</a>
<!--sec:authorize="hasAnyRole('BOSS','CUSTOMER')"-->
<a
class="item"
href="profile.html"
th:href="@{/profile}"
sec:authorize="hasAnyRole('BOSS','CUSTOMER')"
th:text="#{nav.profile}"
th:text="Profil"
>
Registrierung
</a>
<!--prototype-eric-mathis-->
<!--sec:authorize="hasAnyRole('BOSS','CUSTOMER')"-->
<a
class="item"
href="orders.html"
th:href="@{/orders}"
sec:authorize="hasAnyRole('BOSS','CUSTOMER')"
th:text="#{nav.orders}"
th:text="Bestellungen"
>
Bestellungen
</a>
<!--sec:authorize="hasAnyRole('BOSS','CUSTOMER')"-->
<a
class="item"
href="event.html"
th:href="@{/event}"
sec:authorize="hasAnyRole('BOSS','CUSTOMER')"
th:text="#{nav.event}"
th:text="'Event planen'"
>
Events
</a>
<!--prototpye-theo-->
<!--sec:authorize="hasRole('BOSS')"-->
<a
class="item"
href="orders.calender.html"
th:href="@{/orders/calender}"
sec:authorize="hasRole('BOSS')"
th:text="#{nav.orders.calender}"
th:text="Kalender"
>
Kalender der Bestellungen
</a>
@ -111,7 +127,7 @@
</form>
</div>
</div>
<br/>
<br/>
</nav>
</body>
</html>

View file

@ -1,83 +1,61 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org/extras/spring-security"
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout">
<head>
<meta charset="utf-8">
<link rel="stylesheet" th:href="@{/resources/css/style.css}">
<title th:text="Aufträge">Aufträge</title>
</head>
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{layout.html(title='Bestellungen')}">
<body>
<div class="topnav"> <!-- später für css -->
<a th:href="@{/}" th:text="Home">Home</a>
<a th:href="@{/catalog}" th:text="Katalog">Katalog</a>
<a th:href="@{/event}" th:text="Eventplaner">Eventplaner</a>
<a th:href="@{/orders}" th:text="Aufträge">Aufträge</a>
<!--<a href="#account">Mein Konto</a>-->
</div>
<div>
<h1>Auftragsliste</h1>
</div>
<div> <!--th:unless"${cart.empty}"-->
<table style="width:100%; text-align:left">
<tr>
<th style="width:10%">Von</th>
<th style="width:10%">Bis</th>
<th style="width:15%">Kunde</th>
<th style="width:30%">Produktdetails</th>
<th style="width:10%">Rechnung</th>
<th>Bezahlt</th>
<th>Preis</th>
<th></th>
</tr>
<tr th:each="order : ${orders}">
<td th:text="${order.getFormattedStart()}">
<td th:text="${order.getFormattedFinish()}">
<td th:text="BeispielKunde"/>
<td>
<div>
<a href="#productDetails" th:text="${order.getOrderType()}"/>
<ul th:each="product : ${order.getFormattedProducts()}">
<li th:text="${product}"/>
</ul>
</div>
</td>
<td>
<div th:if="${order.invoiceAvailable()}">
<a href="#invoice">Rechnung</a>
</div>
<div th:unless="${order.invoiceAvailable()}">
<span>Keine Rechnung verfügbar</span>
</div>
</td>
<td>&#9746</td> <!--von Admin bearbeitbar-->
<td>
<th:block th:text="${order.getTotalCost()}"/>
<th:block th:text="€"/>
</td>
<td>
<form method="post" th:action="@{/orders/remove}">
<input type="hidden" name="orderID" value="0" th:value="${order.getId()}"/>
<input type="submit" value="remove" th:value="Entfernen"/>
</form>
</td>
</tr>
</table>
</div>
<span>
<th:block th:text="Insgesamt "/>
<th:block th:text="${total}"/>
<th:block th:text=" Aufträge"/>
</span>
<section layout:fragment="content">
<div> <!--th:unless"${cart.empty}"-->
<table style="width:100%; text-align:left">
<tr>
<th style="width:10%">Von</th>
<th style="width:10%">Bis</th>
<th style="width:15%">Kunde</th>
<th style="width:30%">Produktdetails</th>
<th style="width:10%">Rechnung</th>
<th>Bezahlt</th>
<th>Preis</th>
<th></th>
</tr>
<tr th:each="order : ${orders}">
<td th:text="${order.getFormattedStart()}">
<td th:text="${order.getFormattedFinish()}">
<td th:text="BeispielKunde"/>
<td>
<div>
<a href="#productDetails" th:text="${order.getOrderType()}"/>
<ul th:each="product : ${order.getFormattedProducts()}">
<li th:text="${product}"/>
</ul>
</div>
</td>
<td>
<div th:if="${order.invoiceAvailable()}">
<a href="#invoice">Rechnung</a>
</div>
<div th:unless="${order.invoiceAvailable()}">
<span>Keine Rechnung verfügbar</span>
</div>
</td>
<td>&#9746</td> <!--von Admin bearbeitbar-->
<td>
<th:block th:text="${order.getTotalCost()}"/>
<th:block th:text="€"/>
</td>
<td>
<form method="post" th:action="@{/orders/remove}">
<input type="hidden" name="orderID" value="0" th:value="${order.getId()}"/>
<input type="submit" value="remove" th:value="Entfernen"/>
</form>
</td>
</tr>
</table>
</div>
<span>
<th:block th:text="Insgesamt "/>
<th:block th:text="${total}"/>
<th:block th:text=" Aufträge"/>
</span>
</section>
</body>
<footer style="bottom: 0; position: absolute;">
<p>© Hannes Wurst @ Mampf GmbH</p>
<p>
<a href="mailto:catering@mampf.com">catering@mampf.com</a>
</p>
</footer>
</html>

View file

@ -2,7 +2,7 @@
<html xmlns:th="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org/extras/spring-security"
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{layout.html(title=calender_of_orders)}">
layout:decorate="~{layout.html(title='Kalender')}">
<head>
<style>
table {

View file

@ -1,40 +1,45 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<html xmlns:th="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org/extras/spring-security"
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{layout.html(title='Profil')}">
<head>
<meta charset="utf-8" />
<link rel="stylesheet" th:href="@{/resources/css/profile/style.css}" />
<title th:text="#{profile.title}" />
</head>
<body>
<form th:action="@{/profile}" method="post" >
<h1 th:text="#{profile.title}"></h1>
<h2 class="settings" th:text="#{profile.authentification}"></h2>
<table>
<tr>
<td th:text="#{profile.username}"></td>
<td><input name="username" th:value="${user.username}" type="text"/></td>
</tr>
<tr>
<td th:text="#{profile.password}"></td>
<td><input name="password" type="password"/></td>
</tr>
</table>
<h2 class="settings" th:text="#{profile.userinformation}"></h2>
<table>
<tr>
<td th:text="#{profile.address}"></td>
<td><input name="address" th:value="${user.address}" type="text"/></td>
</tr>
</table>
<div class="danger_zone">
<h1 class="danger_zone" th:text="#{profile.danger_zone}"></h1>
<div class="horizontal_center">
<button class="danger_zone" th:text="#{profile.edit}" type="submit"></button>
<a th:href="@{/profile/delete}">
<button class="danger_zone" th:text="#{profile.delete}" type="button"></button>
</a>
</div>
</div>
</form>
<section layout:fragment="content">
<form th:action="@{/profile}" method="post" >
<h1 th:text="#{profile.title}"></h1>
<h2 class="settings" th:text="#{profile.authentification}"></h2>
<table>
<tr>
<td th:text="#{profile.username}"></td>
<td><input name="username" th:value="${user.username}" type="text"/></td>
</tr>
<tr>
<td th:text="#{profile.password}"></td>
<td><input name="password" type="password"/></td>
</tr>
</table>
<h2 class="settings" th:text="#{profile.userinformation}"></h2>
<table>
<tr>
<td th:text="#{profile.address}"></td>
<td><input name="address" th:value="${user.address}" type="text"/></td>
</tr>
</table>
<div class="danger_zone">
<h1 class="danger_zone" th:text="#{profile.danger_zone}"></h1>
<div class="horizontal_center">
<button class="danger_zone" th:text="#{profile.edit}" type="submit"></button>
<a th:href="@{/profile/delete}">
<button class="danger_zone" th:text="#{profile.delete}" type="button"></button>
</a>
</div>
</div>
</form>
</section>
</body>
</html>

View file

@ -1,40 +1,43 @@
<!DOCTYPE html>
<html lang="en">
<h1>Registrierung</h1>
<html xmlns:th="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org/extras/spring-security"
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{layout.html(title='Registrierung')}">
<form method="post" role="form" class="ui form" id="form" th:action="@{/register}">
<section layout:fragment="content">
<form method="post" role="form" class="ui form" id="form" th:action="@{/register}">
<div class="field">
<div class="field">
<label for="username">Nutzername</label>
<label for="username">Nutzername</label>
<input id="username" name="username" type="text" required="required">
<input id="username" name="username" type="text" required="required">
</div>
</div>
<div class="field">
<div class="field">
<label for="password">Passwort</label>
<label for="password">Passwort</label>
<input id="password" name="password" type="password"
required="required">
</div>
<input id="password" name="password" type="password"
required="required">
</div>
<div class="field">
<div class="field">
<label for="address">Adresse</label>
<label for="address">Adresse</label>
<input id="address" name="address" type="text"><!-- FIXME: Address should be required!-->
<input id="address" name="address" type="text"><!-- FIXME: Address should be required!-->
</div>
</div>
<div>
<div>
<button type="submit" class="ui button">Registrieren</button>
<button type="submit" class="ui button">Registrieren</button>
</div>
</form>
</div>
</form>
</section>
</html>

View file

@ -1,55 +1,59 @@
<!DOCTYPE html>
<html>
<html xmlns:th="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org/extras/spring-security"
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{layout.html(title='Angestellte')}">
<head>
<meta charset="utf-8" />
<link rel="stylesheet" th:href="@{/resources/css/staff/style.css}" />
<title th:text="${title}"></title>
</head>
<body>
<div class="verwaltung">
<h1>Personalverwaltung</h1>
<h2>Mitarbeiterdetails</h2>
<table>
<tr>
<th>ID</th>
<th>Nachname</th>
<th>Vorname</th>
<th>Beruf</th>
</tr>
<section layout:fragment="content">
<div class="verwaltung">
<h2>Mitarbeiterdetails</h2>
<table>
<tr>
<th>ID</th>
<th>Nachname</th>
<th>Vorname</th>
<th>Beruf</th>
</tr>
<tr th:each="staff : ${staffs}">
<td th:text="${staff.id}">01</td>
<td th:text="${staff.surname}">Musterkoch</td>
<td th:text="${staff.name}">Max</td>
<td th:text="${staff.job}">Koch</td>
<td>
<a th:href="@{'/staff/edit/' + ${staff.id}}" class="button"
>Bearbeiten</a
>
</td>
<td>
<form th:action="@{/staff/remove}" method="post">
<input type="hidden" th:name="staffID" th:value="${staff.id}" />
<button type="submit" class="delete-icon">Entfernen</button>
</form>
</td>
</tr>
</table>
</div>
<div class="add-staff-form">
<h2>Personal Hinzufügen</h2>
<form action="/staff/add" method="post">
<label for="name">Name:</label>
<input type="text" id="name" name="name" required />
<tr th:each="staff : ${staffs}">
<td th:text="${staff.id}">01</td>
<td th:text="${staff.surname}">Musterkoch</td>
<td th:text="${staff.name}">Max</td>
<td th:text="${staff.job}">Koch</td>
<td>
<a th:href="@{'/staff/edit/' + ${staff.id}}" class="button"
>Bearbeiten</a
>
</td>
<td>
<form th:action="@{/staff/remove}" method="post">
<input type="hidden" th:name="staffID" th:value="${staff.id}" />
<button type="submit" class="delete-icon">Entfernen</button>
</form>
</td>
</tr>
</table>
</div>
<div class="add-staff-form">
<h2>Personal Hinzufügen</h2>
<form action="/staff/add" method="post">
<label for="name">Name:</label>
<input type="text" id="name" name="name" required />
<label for="surname">Nachname:</label>
<input type="text" id="surname" name="surname" required />
<label for="surname">Nachname:</label>
<input type="text" id="surname" name="surname" required />
<label for="job">Beruf:</label>
<input type="text" id="job" name="job" required />
<label for="job">Beruf:</label>
<input type="text" id="job" name="job" required />
<button type="submit">Hinzufügen</button>
</form>
</div>
<button type="submit">Hinzufügen</button>
</form>
</div>
</section>
</body>
</html>

View file

@ -1,22 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" th:href="@{/resources/css/style.css}">
<title th:text="#{welcome.title}">Welcome!</title>
</head>
<html xmlns:th="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org/extras/spring-security"
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{layout.html(title='Wilkommen bei Wursts Catering')}">
<body>
<div class="topnav"> <!-- später für css -->
<a th:href="@{/}" th:text="Home">Home</a>
<a th:href="@{/catalog}" th:text="Katalog">Katalog</a>
<a th:href="@{/event}" th:text="Eventplaner">Eventplaner</a>
<a th:href="@{/orders}" th:text="Aufträge">Aufträge</a>
<!--<a href="#account">Mein Konto</a>-->
</div>
<h1 th:text="#{welcome.title}">Welcome!</h1>
<p th:text="#{welcome.text}"></p>
<section layout:fragment="content">
<!--<h1 th:text="#{welcome.title}">Welcome!</h1>-->
<p th:text="'Hier bekommen Sie übrigens nicht nur Wurst.'"></p>
<p th:text="'Test: (äöü)'"
</section>
</body>
<footer style="bottom: 0; position: absolute;">

View file

@ -35,6 +35,6 @@ class WelcomeControllerIntegrationTests {
void showsWelcomeMessage() throws Exception {
mvc.perform(get("/")) //
.andExpect(status().isOk())
.andExpect(content().string(containsString("Welcome back!")));
.andExpect(content().string(containsString("Wilkommen bei Wursts Catering")));
}
}