From 659cfe791e3a6253ba6ba06547a8bffcf68abc27 Mon Sep 17 00:00:00 2001 From: Pekka Helenius Date: Fri, 25 Sep 2020 11:43:10 +0300 Subject: [PATCH] Set fallback message key strings for author & category NULL values Signed-off-by: Pekka Helenius --- bookstore/src/main/resources/messages.properties | 3 +++ bookstore/src/main/resources/templates/bookadd.html | 5 ++++- bookstore/src/main/resources/templates/bookedit.html | 5 ++++- bookstore/src/main/resources/templates/booklist.html | 10 +++++++--- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/bookstore/src/main/resources/messages.properties b/bookstore/src/main/resources/messages.properties index 7f2ffb6..08b4d12 100644 --- a/bookstore/src/main/resources/messages.properties +++ b/bookstore/src/main/resources/messages.properties @@ -39,6 +39,9 @@ book.error.year = Invalid year book.error.price = Invalid price book.error.isbn.exists = ISBN code already exists book.error.id.invalid = Wrong book + +book.null.author = Unknown +book.null.category = None page.title.browser.list = Bookstore page page.title.browser.add = Add book diff --git a/bookstore/src/main/resources/templates/bookadd.html b/bookstore/src/main/resources/templates/bookadd.html index 3e0cd81..37af943 100644 --- a/bookstore/src/main/resources/templates/bookadd.html +++ b/bookstore/src/main/resources/templates/bookadd.html @@ -204,7 +204,10 @@ th:value="${category.id}" th:text="${category.name}" >(obj) category.name - + diff --git a/bookstore/src/main/resources/templates/bookedit.html b/bookstore/src/main/resources/templates/bookedit.html index 680c44c..b514377 100644 --- a/bookstore/src/main/resources/templates/bookedit.html +++ b/bookstore/src/main/resources/templates/bookedit.html @@ -204,7 +204,10 @@ th:value="${category.id}" th:text="${category.name}" >(obj) category.name - + Check if book.null.author exists. If yes, then: + | Get value from book.null.author message key + | else: + | Author is string value 'book.null.author' */--> - (obj) book.author.firstName (obj) book.author.lastName + (obj) book.author.firstName (obj) book.author.lastName (obj) book.title (obj) book.isbn (obj) book.year - (obj) book.category.name + (obj) book.category.name 0.00 page.symbols.currency