diff --git a/prototype/src/main/java/org/hso/ecommerce/app/RequestController.java b/prototype/src/main/java/org/hso/ecommerce/app/RequestController.java index 0fa38c3..389f8ce 100644 --- a/prototype/src/main/java/org/hso/ecommerce/app/RequestController.java +++ b/prototype/src/main/java/org/hso/ecommerce/app/RequestController.java @@ -31,8 +31,10 @@ public class RequestController { } @GetMapping("/home") - public String home(Model model) { - model.addAttribute(new Customer()); + public String home(@CookieValue(value = "loginToken", defaultValue = "") String loginToken, Model model) { + if (!loginToken.equals("")) { + model.addAttribute(new Customer()); + } return "home"; } @@ -104,6 +106,11 @@ public class RequestController { return "intern/listedArticlesEdit"; } + @GetMapping("/notification") + public String notification() { + return "notification"; + } + @GetMapping("/customer/accountsettings") public String customerAccountSettings(Model model) { Customer customer = new Customer(); diff --git a/prototype/src/main/resources/static/css/notifications.css b/prototype/src/main/resources/static/css/notifications.css new file mode 100644 index 0000000..37c720f --- /dev/null +++ b/prototype/src/main/resources/static/css/notifications.css @@ -0,0 +1,45 @@ +.notifications { + position: relative; +} + +.notifications input[type=checkbox] { + display: none; +} + +.notifications input:checked ~ label { + background-color: var(--c-primary-highlight); +} + +.notifications label img { + width: auto; +} + +.notifications .listbox { + background-color: var(--c-primary-highlight); + border-radius: var(--u-2); + color: var(--c-black); + overflow: hidden; + position: absolute; + right: 0; + transform: translate(0, -50%) scaleY(0); + transition: transform 0.1s ease-in; + width: 500px; +} + +.notifications input:checked ~ .listbox { + transform: none; + transition: transform 0.1s ease-out; +} + +.notifications .listbox li { + background-color: var(--c-base); + border-radius: var(--u-2); + display: block; + margin: var(--u0); + overflow: auto; + padding: var(--u0); +} + +.notifications .listbox li.unread { + font-weight: bold; +} diff --git a/prototype/src/main/resources/static/img/bell.svg b/prototype/src/main/resources/static/img/bell.svg new file mode 100644 index 0000000..1bda892 --- /dev/null +++ b/prototype/src/main/resources/static/img/bell.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/prototype/src/main/resources/templates/fragments/header.html b/prototype/src/main/resources/templates/fragments/header.html index ffd36d7..71b8aac 100644 --- a/prototype/src/main/resources/templates/fragments/header.html +++ b/prototype/src/main/resources/templates/fragments/header.html @@ -13,7 +13,25 @@ - Login + Login +
+ + + +
+ Abmelden diff --git a/prototype/src/main/resources/templates/home.html b/prototype/src/main/resources/templates/home.html index 55194e6..af1a385 100644 --- a/prototype/src/main/resources/templates/home.html +++ b/prototype/src/main/resources/templates/home.html @@ -4,6 +4,7 @@ e-commerce + diff --git a/prototype/src/main/resources/templates/notification.html b/prototype/src/main/resources/templates/notification.html new file mode 100644 index 0000000..126e979 --- /dev/null +++ b/prototype/src/main/resources/templates/notification.html @@ -0,0 +1,29 @@ + + + + + e-commerce + + + + +
+
+

Benachrichtigungen

+

Nachricht vom 17.08.2020, 14:38 Uhr

+

Ihre Bestellung kommt voraussichtlich am Donnerstag, den 20.08.2020

+

+ Vielen Dank für Ihre Bestellung der folgenden Artikel:
+
+ 2x tolle Kamera
+ 1x Bluetooth Kopfhörer
+ 3x USB-Magic Light
+
+ Die Sendung wird Ihnen voraussichtlich am Donnerstag, den 20.08.2020 zugestellt. Den aktuellen Status des Pakets können Sie jederzeit unter der Paketverfolgungsnummer P-586776517 nachvollziehen. +

+
+
+
+ + +