mirror of
https://gitea.phreedom.club/localhost_frssoft/bloat.git
synced 2025-05-02 10:04:22 +00:00
Add search page
This commit is contained in:
parent
591360f2a8
commit
14bb18fbc7
10 changed files with 157 additions and 14 deletions
|
@ -16,6 +16,7 @@
|
|||
<a class="nav-link" href="/notifications">notifications{{if gt .NotificationCount 0}}({{.NotificationCount}}){{end}}</a>
|
||||
<a class="nav-link" href="/timeline/local">local</a>
|
||||
<a class="nav-link" href="/timeline/twkn">twkn</a>
|
||||
<a class="nav-link" href="/search">search</a>
|
||||
<a class="nav-link" href="/about">about</a>
|
||||
</div>
|
||||
<div>
|
||||
|
|
37
templates/search.tmpl
Normal file
37
templates/search.tmpl
Normal file
|
@ -0,0 +1,37 @@
|
|||
{{template "header.tmpl" .HeaderData}}
|
||||
{{template "navigation.tmpl" .NavbarData}}
|
||||
<div class="page-title"> Search </div>
|
||||
|
||||
<div>
|
||||
<form action="/search" method="GET">
|
||||
<span class="post-form-field>
|
||||
<label for="query"> Query </label>
|
||||
<input id="query" name="q" value="{{.Q}}">
|
||||
</span>
|
||||
<span class="post-form-field>
|
||||
<label for="type"> Type </label>
|
||||
<select id="type" name="type">
|
||||
<option value="statuses" {{if eq .Type "statuses"}}selected{{end}}>Statuses</option>
|
||||
<option value="accounts" {{if eq .Type "accounts"}}selected{{end}}>Accounts</option>
|
||||
</select>
|
||||
</span>
|
||||
<button type="submit"> Search </button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{{if eq .Type "statuses"}}
|
||||
{{range .Statuses}}
|
||||
{{template "status.tmpl" .}}
|
||||
{{end}}
|
||||
|
||||
{{end}}
|
||||
{{if eq .Type "accounts"}}
|
||||
{{template "userlist.tmpl" .Users}}
|
||||
{{end}}
|
||||
|
||||
<div class="pagination">
|
||||
{{if .HasNext}}
|
||||
<a href="{{.NextLink}}">next</a>
|
||||
{{end}}
|
||||
</div>
|
||||
{{template "footer.tmpl"}}
|
Loading…
Add table
Add a link
Reference in a new issue