From 3cbe299f1c4c069fbabab5f404fe0f5ddb94da30 Mon Sep 17 00:00:00 2001 From: Pekka Helenius Date: Tue, 6 Oct 2020 12:31:30 +0300 Subject: [PATCH] Un-hardcode more messages; update web forms Signed-off-by: Pekka Helenius --- .../src/main/resources/messages.properties | 14 ++++- .../templates/fragments/bookfields.html | 51 ++++++++++++++----- .../templates/fragments/loginout.html | 43 +++++++++++++++- 3 files changed, 93 insertions(+), 15 deletions(-) diff --git a/bookstore/src/main/resources/messages.properties b/bookstore/src/main/resources/messages.properties index 46fc3d8..4f95392 100644 --- a/bookstore/src/main/resources/messages.properties +++ b/bookstore/src/main/resources/messages.properties @@ -45,7 +45,14 @@ book.error.id.invalid = Wrong book book.null.author = Unknown book.null.category = None - + +book.placeholder.title = Book title +book.placeholder.author.firstname = Book author first name +book.placeholder.author.lastname = Book author last name +book.placeholder.isbn = Book ISBN code +book.placeholder.year = Book publication year \(\YYYY\) +book.placeholder.price = 0.00 + page.title.browser.list = Bookstore page page.title.browser.add = Add book page.title.browser.edit = Update book @@ -98,6 +105,11 @@ page.text.apiref.link = Link page.text.error = Error while processing your request +page.auth.failure = Authentication failure\! + +auth.field.placeholder.username = User name +auth.field.placeholder.password = Password + button.book.add = Add book button.book.edit = Update book diff --git a/bookstore/src/main/resources/templates/fragments/bookfields.html b/bookstore/src/main/resources/templates/fragments/bookfields.html index 97acb72..d67713b 100644 --- a/bookstore/src/main/resources/templates/fragments/bookfields.html +++ b/bookstore/src/main/resources/templates/fragments/bookfields.html @@ -22,7 +22,10 @@ th:text="${#messages.msgOrNull('book.author.firstName')} ?: 'book.author.firstName'"> book.author.firstName - + @@ -40,7 +43,9 @@
Invalid author first name value
+ th:errors="*{author.firstName}"> + Invalid author first name value +
@@ -48,7 +53,10 @@ th:text="${#messages.msgOrNull('book.author.lastName')} ?: 'book.author.lastName'"> book.author.lastName - + @@ -66,7 +74,9 @@
Invalid author last name value
+ th:errors="*{author.lastName}"> + Invalid author last name value +
@@ -76,7 +86,10 @@ th:text="${#messages.msgOrNull('book.title')} ?: 'book.title'"> book.title - + @@ -94,7 +107,9 @@
Invalid title value
+ th:errors="*{title}"> + Invalid title value +
@@ -102,7 +117,9 @@ th:text="${#messages.msgOrNull('book.isbn')} ?: 'book.isbn'"> book.isbn - + @@ -120,7 +137,9 @@
Invalid ISBN code
+ th:errors="*{isbn}"> + Invalid ISBN code +
@@ -128,7 +147,9 @@ th:text="${#messages.msgOrNull('book.year')} ?: 'book.year'"> book.year - + @@ -146,7 +167,9 @@
Invalid year value
+ th:errors="*{year}"> + Invalid year value +
@@ -162,7 +185,9 @@ page.symbols.currency
- + @@ -180,7 +205,9 @@
Invalid price value
+ th:errors="*{price}"> + Invalid price value +
diff --git a/bookstore/src/main/resources/templates/fragments/loginout.html b/bookstore/src/main/resources/templates/fragments/loginout.html index cb4b2a8..fd9ca23 100644 --- a/bookstore/src/main/resources/templates/fragments/loginout.html +++ b/bookstore/src/main/resources/templates/fragments/loginout.html @@ -8,6 +8,12 @@
+ +
@@ -23,15 +29,44 @@ page.text.list.authenticated httpServletRequest.remoteUser

+ + +
- + + - + + +

@@ -44,6 +79,10 @@
+ +