personalweb

Archived
git clone git://git.wimdupont.com/personalweb.git
Log | Files | Refs | README | LICENSE

commit 8d16ef5cf108823d7bf4d1577535fda9eff521f7
parent 4a965e4cd590683d7afca760d3f53d9a5c99c8bb
Author: WimDupont <WimDupont@users.noreply.gitlab.com>
Date:   Sun,  5 Sep 2021 21:57:00 +0200

fix db titles and decimals

Diffstat:
Msrc/main/resources/db/migration/V1_0__db-init.sql | 2+-
Msrc/main/resources/db/migration/repeatable/R__fill_book_table.sql | 22+++++++++++-----------
Msrc/main/resources/templates/books.html | 7++++++-
3 files changed, 18 insertions(+), 13 deletions(-)

diff --git a/src/main/resources/db/migration/V1_0__db-init.sql b/src/main/resources/db/migration/V1_0__db-init.sql @@ -5,5 +5,5 @@ CREATE TABLE book ( isbn VARCHAR(100) UNIQUE NOT NULL, category VARCHAR(100) NOT NULL, series VARCHAR(200), - series_number DECIMAL + series_number DECIMAL(2,1) ) diff --git a/src/main/resources/db/migration/repeatable/R__fill_book_table.sql b/src/main/resources/db/migration/repeatable/R__fill_book_table.sql @@ -36,22 +36,22 @@ INSERT INTO book VALUES (UUID(), "Paperback Oxford English Dictionary", "Oxford University Press", "9780199640942", "Language", null, null), (UUID(), "Warbreaker", "Brandon Sanderson", "9780765360038", "Fantasy", null, null), - (UUID(), "The Way of Kings (The Stormlight Archive #1)", "Brandon Sanderson", "9780765365279", "Fantasy", "The Stormlight Archive", 1), - (UUID(), "Words of Radiance (The Stormlight Archive #2)", "Brandon Sanderson", "9780765365286", "Fantasy", "The Stormlight Archive", 2), - (UUID(), "Edgedancer (The Stormlight Archive #2.5)", "Brandon Sanderson", "9781250166548", "Fantasy", "The Stormlight Archive", 2.5), - (UUID(), "Oathbringer (The Stormlight Archive #3)", "Brandon Sanderson", "9780765365293", "Fantasy", "The Stormlight Archive", 3), - (UUID(), "Rhythm of War (The Stormlight Archive #4)", "Brandon Sanderson", "9781250784261", "Fantasy", "The Stormlight Archive", 4), + (UUID(), "The Way of Kings", "Brandon Sanderson", "9780765365279", "Fantasy", "The Stormlight Archive", 1), + (UUID(), "Words of Radiance", "Brandon Sanderson", "9780765365286", "Fantasy", "The Stormlight Archive", 2), + (UUID(), "Edgedancer", "Brandon Sanderson", "9781250166548", "Fantasy", "The Stormlight Archive", 2.5), + (UUID(), "Oathbringer", "Brandon Sanderson", "9780765365293", "Fantasy", "The Stormlight Archive", 3), + (UUID(), "Rhythm of War", "Brandon Sanderson", "9781250784261", "Fantasy", "The Stormlight Archive", 4), (UUID(), "The Slow Regard of Silent Things", "Patrick Rothfuss", "9781473209336", "Fantasy", null, null), - (UUID(), "The Name of the Wind (The Kingkiller Chronicle: Day 1)", "Patrick Rothfuss", "9780575081406", "Fantasy", "The Kingkiller Chronicle", 1), - (UUID(), "The Wise Mans Fear (The Kingkiller Chronicle: Day 2)", "Patrick Rothfuss", "9780575081437", "Fantasy", "The Kingkiller Chronicle", 2), + (UUID(), "The Name of the Wind", "Patrick Rothfuss", "9780575081406", "Fantasy", "The Kingkiller Chronicle", 1), + (UUID(), "The Wise Mans Fear", "Patrick Rothfuss", "9780575081437", "Fantasy", "The Kingkiller Chronicle", 2), (UUID(), "The Silmarillion", "J.R.R. Tolkien", "9780007523221", "Fantasy", null, null), (UUID(), "The Hobbit", "J.R.R. Tolkien", "9780544445796", "Fantasy", null, null), - (UUID(), "The Fellowship of the Ring (The Lord of the Rings #1)", "J.R.R. Tolkien", "9780544448933", "Fantasy", "The Lord of the Rings", 1), - (UUID(), "The Two Towers (The Lord of the Rings #2)", "J.R.R. Tolkien", "9780544449732", "Fantasy", "The Lord of the Rings", 2), - (UUID(), "The Return of the King (The Lord of the Rings #3)", "J.R.R. Tolkien", "9780544449749", "Fantasy", "The Lord of the Rings", 3), + (UUID(), "The Fellowship of the Ring", "J.R.R. Tolkien", "9780544448933", "Fantasy", "The Lord of the Rings", 1), + (UUID(), "The Two Towers", "J.R.R. Tolkien", "9780544449732", "Fantasy", "The Lord of the Rings", 2), + (UUID(), "The Return of the King", "J.R.R. Tolkien", "9780544449749", "Fantasy", "The Lord of the Rings", 3), (UUID(), "Stardust", "Neil Gaiman", "9780755322824", "Fantasy", null, null), (UUID(), "Good omens", "Terry Pratchett, Neil Gaiman", "9781473200852", "Fantasy", null, null), - (UUID(), "Books of Earthsea (The Earthsea Cycle)", "Ursula K. Le Guin", "9781473223547", "Fantasy", "The Earthsea Cycle", null), + (UUID(), "Books of Earthsea", "Ursula K. Le Guin", "9781473223547", "Fantasy", "The Earthsea Cycle", null), (UUID(), "The Princess Bride", "William Goldman", "9781328948854", "Fantasy", null, null), (UUID(), "To Kill A Mockingbird", "Harper Lee", "9780099549482", "Fiction", null, null), diff --git a/src/main/resources/templates/books.html b/src/main/resources/templates/books.html @@ -20,7 +20,12 @@ </tr> <tr th:each="book : ${books}"> <td><a th:target="_blank" - th:href="@{https://openlibrary.org/isbn/{isbn}(isbn=${book.isbn})}">[[${book.title}]]</a></td> + th:href="@{https://openlibrary.org/isbn/{isbn}(isbn=${book.isbn})}" + th:text="${book.title} + + ( ${book.series} ? ' (' + ${book.series} + + (${book.seriesNumber} ? ' #' + ${#strings.replace(book.seriesNumber, '.0', '')} : '') + + ')' : '' )"/> + </td> <td th:text="${book.author}"/> <td th:text="${book.category}"/> </tr>