mirror of
https://gitea.phreedom.club/localhost_frssoft/bloat.git
synced 2025-05-02 10:04:22 +00:00
Add user search page
This commit is contained in:
parent
84cd3bc436
commit
17e55d2a9b
11 changed files with 153 additions and 20 deletions
|
@ -3,22 +3,20 @@
|
|||
{{template "navigation.tmpl" (WithContext .NavbarData $.Ctx)}}
|
||||
<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>
|
||||
<form class="search-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>
|
||||
|
||||
{{if eq .Type "statuses"}}
|
||||
{{range .Statuses}}
|
||||
|
|
|
@ -44,6 +44,9 @@
|
|||
<a href="/following/{{.User.ID}}"> {{.User.FollowingCount}} following </a> -
|
||||
<a href="/followers/{{.User.ID}}"> {{.User.FollowersCount}} followers </a>
|
||||
</div>
|
||||
<div>
|
||||
<a href="/usersearch/{{.User.ID}}"> search statuses </a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="user-profile-decription">
|
||||
{{.User.Note}}
|
||||
|
|
25
templates/usersearch.tmpl
Normal file
25
templates/usersearch.tmpl
Normal file
|
@ -0,0 +1,25 @@
|
|||
{{with .Data}}
|
||||
{{template "header.tmpl" (WithContext .HeaderData $.Ctx)}}
|
||||
{{template "navigation.tmpl" (WithContext .NavbarData $.Ctx)}}
|
||||
<div class="page-title"> Search {{EmojiFilter .User.DisplayName .User.Emojis}}'s statuses </div>
|
||||
|
||||
<form class="search-form" action="/usersearch/{{.User.ID}}" method="GET">
|
||||
<span class="post-form-field>
|
||||
<label for="query"> Query </label>
|
||||
<input id="query" name="q" value="{{.Q}}">
|
||||
</span>
|
||||
<button type="submit"> Search </button>
|
||||
</form>
|
||||
|
||||
{{range .Statuses}}
|
||||
{{template "status.tmpl" (WithContext . $.Ctx)}}
|
||||
{{end}}
|
||||
|
||||
<div class="pagination">
|
||||
{{if .NextLink}}
|
||||
<a href="{{.NextLink}}">next</a>
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
{{template "footer.tmpl"}}
|
||||
{{end}}
|
Loading…
Add table
Add a link
Reference in a new issue