mirror of
https://gitlab.com/brutaldon/brutaldon.git
synced 2024-12-04 14:46:24 -05:00
Merge branch 'master' of github.com:jfmcbrayer/brutaldon
This commit is contained in:
commit
5bdd29f12e
@ -45,5 +45,7 @@ urlpatterns = [
|
||||
path('fav/<int:id>', views.fav, name='fav'),
|
||||
path('boost/<int:id>', views.boost, name='boost'),
|
||||
path('delete/<int:id>', views.delete, name='delete'),
|
||||
path('search', views.search, name='search'),
|
||||
path('search_results', views.search_results, name='search_results'),
|
||||
path('', views.home),
|
||||
]
|
||||
|
@ -418,6 +418,24 @@ def delete(request, id):
|
||||
{"toot": toot, 'confirm_page': True,
|
||||
"fullbrutalism": fullbrutalism_p(request)})
|
||||
|
||||
|
||||
def search(request):
|
||||
return render(request, 'search.html',
|
||||
{"fullbrutalism": fullbrutalism_p(request)})
|
||||
|
||||
def search_results(request):
|
||||
if request.method == 'GET':
|
||||
query = request.GET.get('q', '')
|
||||
elif request.method == 'POST':
|
||||
query = request.POST.get('q', '')
|
||||
else:
|
||||
query = ''
|
||||
mastodon = get_mastodon(request)
|
||||
results = mastodon.search(query)
|
||||
return render(request, 'search_results.html',
|
||||
{"results": results,
|
||||
"fullbrutalism": fullbrutalism_p(request)})
|
||||
|
||||
def about(request):
|
||||
return render(request, 'about.html',
|
||||
{"fullbrutalism": fullbrutalism_p(request)})
|
||||
|
Loading…
Reference in New Issue
Block a user