diff options
| author | Samuel Johnson <[email protected]> | 2026-03-17 12:26:14 -0400 |
|---|---|---|
| committer | Samuel Johnson <[email protected]> | 2026-03-17 12:26:14 -0400 |
| commit | d2ecf6f3be46cae2948aa7ce8740f3e39a3f04ee (patch) | |
| tree | b569cf3fc8281ca36d2884506f7dd63400198d04 /ui/html/pages | |
| parent | 61ba5dcc29a16bb3727209a76ee75fffff037dee (diff) | |
Add search functionality
Diffstat (limited to 'ui/html/pages')
| -rw-r--r-- | ui/html/pages/index.tmpl.html | 18 | ||||
| -rw-r--r-- | ui/html/pages/login.tmpl.html | 6 |
2 files changed, 19 insertions, 5 deletions
diff --git a/ui/html/pages/index.tmpl.html b/ui/html/pages/index.tmpl.html index fa5a9bb..5c91ab4 100644 --- a/ui/html/pages/index.tmpl.html +++ b/ui/html/pages/index.tmpl.html @@ -14,6 +14,12 @@ <a href="/login" class="nav_tag right">Login</a> {{end}} </div> + <div class="flex_end right_nofloat"> + <form action="/search" method="GET"> + <input type="search" id="search_bar" name="query" placeholder="Search posts..." aria-label="Search for posts"> + <button type="submit" id="search-button">Search</button> + </form> + </div> {{if .IsAuth}} <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/easymde/dist/easymde.min.css"> <script src="https://cdn.jsdelivr.net/npm/easymde/dist/easymde.min.js"></script> @@ -47,10 +53,18 @@ </a> <div class="right"> {{if ne .Offset 0}} - <a href="/?offset={{sub .Offset 10}}" class="nav_tag">Previous</a> + {{if eq .SearchTerm ""}} + <a href="/?offset={{sub .Offset 10}}" class="nav_tag">Previous</a> + {{else}} + <a href="/search?offset={{sub .Offset 10}}&query={{.SearchTerm}}" class="nav_tag">Previous</a> + {{end}} {{end}} {{if .PagePopulated}} - <a href="/?offset={{add .Offset 10}}">Next</a> + {{if eq .SearchTerm ""}} + <a href="/?offset={{add .Offset 10}}">Next</a> + {{else}} + <a href="/search?offset={{add .Offset 10}}&query={{.SearchTerm}}">Next</a> + {{end}} {{end}} </div> </div> diff --git a/ui/html/pages/login.tmpl.html b/ui/html/pages/login.tmpl.html index 01dc804..9751ee8 100644 --- a/ui/html/pages/login.tmpl.html +++ b/ui/html/pages/login.tmpl.html @@ -5,8 +5,8 @@ <div class="topline"> <h2 class="login_header">Log In</h2> </div> - <div class="card"> - <form class="login_form center" action="/login" method="POST"> + <div class="card flex_center"> + <form class="login_form" action="/login" method="POST"> <label for="user">Username:</label> <input type="text" id="user" name="user"> <label for="pass_one">Password:</label> @@ -14,7 +14,7 @@ <label for="pass_two">Password:</label> <input type="text" id="pass_two" name="pass_two"> <br> - <div class="right"> + <div> <input type="submit" value="Submit"> </div> </form> |
