unhide community search option

This commit is contained in:
Ryan Stafford 2024-05-10 11:26:10 -04:00
parent 066d6aaf2c
commit 5d545a7d57

View file

@ -22,7 +22,7 @@
{{ template "menu.html" . }} {{ template "menu.html" . }}
{{ end}} {{ end}}
{{ if or (ne .Query "") .Communities }} {{ if or (ne .SearchType "") (ne .Query "") .Communities }}
<form class="search" method="GET"> <form class="search" method="GET">
<input type="hidden" name="sort" value="{{.Sort}}"> <input type="hidden" name="sort" value="{{.Sort}}">
<input type="hidden" name="listingType" value="{{.Listing}}"> <input type="hidden" name="listingType" value="{{.Listing}}">
@ -31,12 +31,12 @@
<input type="text" name="q" value="{{.Query}}"> <input type="text" name="q" value="{{.Query}}">
<input type="submit" value="search"> <input type="submit" value="search">
</div> </div>
{{ if ne .SearchType "Communities" }}
<div> <div>
<select name="searchtype"> <select name="searchtype">
<option value="All"{{ if eq .SearchType "All" }} selected{{ end }}>all</option> <option value="All"{{ if eq .SearchType "All" }} selected{{ end }}>all</option>
<option value="Posts"{{ if eq .SearchType "Posts" }} selected{{ end }}>posts</option> <option value="Posts"{{ if eq .SearchType "Posts" }} selected{{ end }}>posts</option>
<option value="Comments"{{ if eq .SearchType "Comments" }} selected{{ end }}>comments</option> <option value="Comments"{{ if eq .SearchType "Comments" }} selected{{ end }}>comments</option>
<option value="Communities"{{ if eq .SearchType "Communities" }} selected{{ end }}>communities</option>
<option value="Url"{{ if eq .SearchType "Url" }} selected{{ end }}>url</option> <option value="Url"{{ if eq .SearchType "Url" }} selected{{ end }}>url</option>
</select> </select>
<label>from <label>from
@ -44,9 +44,6 @@
<label>by <label>by
<input type="text" placeholder="anyone" name="username" value="{{.UserName}}"></label> <input type="text" placeholder="anyone" name="username" value="{{.UserName}}"></label>
</div> </div>
{{ else }}
<input type="hidden" name="searchtype" value="Communities">
{{ end }}
</form> </form>
{{ end}} {{ end}}