Rename jump.

This commit is contained in:
Flancian 2021-02-02 01:25:47 +01:00
parent a96cf45bfa
commit 7a4ba30117
3 changed files with 6 additions and 10 deletions

View File

@ -45,8 +45,9 @@ def today():
today = datetime.datetime.now().date()
return redirect("https://anagora.org/node/%s" % today.strftime("%Y-%m-%d"))
@bp.route('/search', methods=('GET', 'POST'))
def search():
@bp.route('/oldsearch', methods=('GET', 'POST'))
def oldsearch():
"""deprecated in favour of jump-like search"""
form = forms.SearchForm()
if form.validate_on_submit():
return render_template('search.html', form=form, subnodes=db.search_subnodes(form.query.data))
@ -133,6 +134,7 @@ def push(node, other):
return Response(pushing)
@bp.route('/search')
@bp.route('/jump')
def jump():
"""Redirects to a context; in "jump" mode, a node *always* exists (nodes map one to one to all possible queries)."""
@ -220,12 +222,6 @@ def users():
def journals():
return render_template('nodes.html', header="Journals", nodes=db.all_journals())
# Searching with GET: potentially useful but probably not a good idea.
# @bp.route('/search/<query>')
# def search(query):
# return render_template('subnodes.html', subnodes=db.search_subnodes(query))
@bp.route('/asset/<user>/<asset>')
def asset(user, asset):
# An asset is a binary in someone's garden/<user>/assets directory.

View File

@ -45,7 +45,7 @@
| <a href="/nodes">nodes</a>
| <a href="/users">@</a>
| <a href="/latest">Δ</a>
| <form action="/jump" method="get" style="display: inline;">jump: <input type="text" name="q"></form>
| <form action="/jump" method="get" style="display: inline;">node: <input type="text" name="q"></form>
| <a href="#" style="text-decoration: none;" class="theme-toggle">🌙</a>
<!-- doesn't fit on mobile right now.
| <a href="/node/agora-help" style="text-decoration: none;" class="help-button"></a>

View File

@ -26,7 +26,7 @@
<div class="listing">
<div class="formwrapper">
<h1>Search</h1>
<form method="POST" action="{{url_for('agora.search')}}">
<form method="POST" action="{{url_for('agora.oldsearch')}}">
<div class="form-field">{{ form.query.label }} {{ form.query(size=20, autofocus=true) }}
{{ form.csrf_token }}
{{ form.submit }}</div>