search, cosmetic

This commit is contained in:
2021-02-27 17:03:55 +01:00
parent 205612ff61
commit 4908f763e5
2 changed files with 7 additions and 4 deletions
+4 -1
View File
@@ -144,10 +144,13 @@ def push(node, other):
@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)."""
"""Redirects to an appropriate context.
Originally called "jump" because in the [[agora]] nodes *always* exist, as they map 1:1 to all possible queries. Thus [[agora search]].
"""
q = request.args.get('q')
tokens = q.split(" ")
# hack hack
# [[push]] [[2021-02-28]] in case I don't get to it today.
if tokens[0] == 'go' and len(tokens) > 1:
return redirect(url_for('.go', node=slugify(q[3:])))
return redirect(url_for('.node', node=slugify(q)))
+3 -3
View File
@@ -30,7 +30,7 @@ You can try searching or listing <a href="/nodes">all nodes</a>.<br /><br />
{% if node.subnodes %}
<div class="node">
<span class="node-header"><strong>Node</strong> <a href="/node/{{node.uri}}">[[{{node.uri}}]]</a></span>
<span class="node-header"><strong>Node</strong> <a href="/node/{{node.uri}}">[[{{node.uri}}]]</a></span>:
{% for subnode in node.subnodes %}
<div class="subnode">
@@ -61,7 +61,7 @@ You can try searching or listing <a href="/nodes">all nodes</a>.<br /><br />
{% for node in pull_nodes %}
<div class="node">
<span class="node-header"><strong>Pulled node</strong> <a href="/node/{{node.uri}}">[[{{node.uri}}]]</a></span>
<span class="node-header"><strong>Pulled node</strong> <a href="/node/{{node.uri}}">[[{{node.uri}}]]</a></span>:
{% if node.subnodes %}
{% for subnode in node.subnodes %}
@@ -74,7 +74,7 @@ You can try searching or listing <a href="/nodes">all nodes</a>.<br /><br />
</div>
{% endfor %}
{% else %}
not found. <br />
empty. <br />
{% endif %}
</div>
{% endfor %}