forked from MarseyWorld/MarseyWorld
make it sleeker
parent
3e218ff317
commit
04fbb2f014
|
@ -53,6 +53,10 @@ def searchparse(text):
|
||||||
def searchposts(v):
|
def searchposts(v):
|
||||||
query = request.values.get("q", '').strip()
|
query = request.values.get("q", '').strip()
|
||||||
|
|
||||||
|
author = request.values.get('author')
|
||||||
|
if author:
|
||||||
|
return redirect(f"/search/posts?q=author:{author} {query}")
|
||||||
|
|
||||||
criteria = searchparse(query)
|
criteria = searchparse(query)
|
||||||
|
|
||||||
if 'post' in criteria:
|
if 'post' in criteria:
|
||||||
|
@ -197,6 +201,10 @@ def searchposts(v):
|
||||||
def searchcomments(v):
|
def searchcomments(v):
|
||||||
query = request.values.get("q", '').strip()
|
query = request.values.get("q", '').strip()
|
||||||
|
|
||||||
|
author = request.values.get('author')
|
||||||
|
if author:
|
||||||
|
return redirect(f"/search/comments?q=author:{author} {query}")
|
||||||
|
|
||||||
page = get_page()
|
page = get_page()
|
||||||
|
|
||||||
sort = request.values.get("sort", "new").lower()
|
sort = request.values.get("sort", "new").lower()
|
||||||
|
|
|
@ -39,8 +39,10 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form id="searchform" class="form-inline search flex-nowrap mt-3" action="/search/{{request.path.split('/')[-1]}}" method="get">
|
{% set kind = request.path.split('/')[-1] %}
|
||||||
<input autocomplete="off" class="form-control w-100" type="search" placeholder="Search" value="author:{{u.username}} " name="q">
|
<form id="searchform" class="form-inline search flex-nowrap mt-3" action="/search/{{kind}}" method="get">
|
||||||
|
<input hidden name="author" value="{{u.username}}">
|
||||||
|
<input autocomplete="off" class="form-control w-100" type="search" placeholder="Search user's {{kind}}" name="q">
|
||||||
<span class="input-group-append">
|
<span class="input-group-append">
|
||||||
<span class="input-group-text border-0 bg-transparent" style="margin-left: -2.5rem">
|
<span class="input-group-text border-0 bg-transparent" style="margin-left: -2.5rem">
|
||||||
<button type="submit" class="fas fa-search text-muted"></button>
|
<button type="submit" class="fas fa-search text-muted"></button>
|
||||||
|
|
Loading…
Reference in New Issue