correct search

This commit is contained in:
Dmitry Isaenko 2024-01-23 18:22:18 +03:00
parent 4666fa1f0f
commit 5a2d4ebe97
3 changed files with 4 additions and 2 deletions

View file

@ -37,6 +37,8 @@ public class SearchController {
if (search.trim().equals(""))
return "search";
model.addAttribute("searchPattern", search);
if (search.length() < 4){
model.addAttribute("error", "Should be at least 4 chars");
return "search";

View file

@ -63,7 +63,7 @@
<li class="li_header_block">
<form action="/search" method="get">
<div class="wrapper">
<input class="search_line" type="text" name="search">
<input class="search_line" type="text" name="search" th:value="${searchPattern}">
</div>
<div class="wrapper" style="justify-content: space-evenly; align-items: baseline; ">
<div class="search_checkbox">

View file

@ -38,7 +38,7 @@
</div>
<div th:if="${series != null}">
<h3>Series</h3>
<div th:each="book : ${books}">
<div th:each="book : ${series}">
<a th:href="${'/book/' + book.id}">
<span class="book_title" th:text="${book.title}"></span>
</a>