correct search
This commit is contained in:
parent
4666fa1f0f
commit
5a2d4ebe97
3 changed files with 4 additions and 2 deletions
|
@ -37,6 +37,8 @@ public class SearchController {
|
||||||
if (search.trim().equals(""))
|
if (search.trim().equals(""))
|
||||||
return "search";
|
return "search";
|
||||||
|
|
||||||
|
model.addAttribute("searchPattern", search);
|
||||||
|
|
||||||
if (search.length() < 4){
|
if (search.length() < 4){
|
||||||
model.addAttribute("error", "Should be at least 4 chars");
|
model.addAttribute("error", "Should be at least 4 chars");
|
||||||
return "search";
|
return "search";
|
||||||
|
|
|
@ -63,7 +63,7 @@
|
||||||
<li class="li_header_block">
|
<li class="li_header_block">
|
||||||
<form action="/search" method="get">
|
<form action="/search" method="get">
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<input class="search_line" type="text" name="search">
|
<input class="search_line" type="text" name="search" th:value="${searchPattern}">
|
||||||
</div>
|
</div>
|
||||||
<div class="wrapper" style="justify-content: space-evenly; align-items: baseline; ">
|
<div class="wrapper" style="justify-content: space-evenly; align-items: baseline; ">
|
||||||
<div class="search_checkbox">
|
<div class="search_checkbox">
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div th:if="${series != null}">
|
<div th:if="${series != null}">
|
||||||
<h3>Series</h3>
|
<h3>Series</h3>
|
||||||
<div th:each="book : ${books}">
|
<div th:each="book : ${series}">
|
||||||
<a th:href="${'/book/' + book.id}">
|
<a th:href="${'/book/' + book.id}">
|
||||||
<span class="book_title" th:text="${book.title}"></span>
|
<span class="book_title" th:text="${book.title}"></span>
|
||||||
</a>
|
</a>
|
||||||
|
|
Loading…
Reference in a new issue