diff options
Diffstat (limited to 'ui/html/pages/index.tmpl.html')
| -rw-r--r-- | ui/html/pages/index.tmpl.html | 18 |
1 files changed, 16 insertions, 2 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> |
