diff --git a/src/main/java/ru/redrise/marinesco/library/web/AuthorController.java b/src/main/java/ru/redrise/marinesco/library/web/AuthorController.java index 44c39a6..67cb5eb 100644 --- a/src/main/java/ru/redrise/marinesco/library/web/AuthorController.java +++ b/src/main/java/ru/redrise/marinesco/library/web/AuthorController.java @@ -1,9 +1,12 @@ package ru.redrise.marinesco.library.web; +import java.util.Collections; +import java.util.Comparator; import java.util.List; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; +import org.springframework.util.comparator.Comparators; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; @@ -32,6 +35,8 @@ public class AuthorController { List books = author.getBooks(); + Collections.sort(books, (a, b) -> a.getSeries().compareTo(b.getSeries())); + model.addAttribute("author", author); model.addAttribute("books", books); diff --git a/src/main/resources/static/styles/styles.css b/src/main/resources/static/styles/styles.css index bad83d7..a10c96b 100644 --- a/src/main/resources/static/styles/styles.css +++ b/src/main/resources/static/styles/styles.css @@ -277,6 +277,19 @@ button:hover { font-weight: bold; } +.wrapper{ + display: flex; + flex-wrap: wrap; +} +.horizontal_el_left{ + flex:1; + padding-right: 2px; +} +.horizontal_el_right{ + flex:1; + padding-left: 2px; +} + .wrapper_centred{ display: flex; flex-wrap: wrap; diff --git a/src/main/resources/templates/author.html b/src/main/resources/templates/author.html index 75e8615..447b100 100644 --- a/src/main/resources/templates/author.html +++ b/src/main/resources/templates/author.html @@ -18,13 +18,20 @@

- -
-
-
-
- +
+
+ +
+
+ +
+
+
+
+ +
+