mirror of
https://github.com/flancian/garden.git
synced 2026-08-11 17:21:44 +00:00
search, cosmetic
This commit is contained in:
+4
-1
@@ -144,10 +144,13 @@ def push(node, other):
|
|||||||
@bp.route('/search')
|
@bp.route('/search')
|
||||||
@bp.route('/jump')
|
@bp.route('/jump')
|
||||||
def 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')
|
q = request.args.get('q')
|
||||||
tokens = q.split(" ")
|
tokens = q.split(" ")
|
||||||
# hack hack
|
# hack hack
|
||||||
|
# [[push]] [[2021-02-28]] in case I don't get to it today.
|
||||||
if tokens[0] == 'go' and len(tokens) > 1:
|
if tokens[0] == 'go' and len(tokens) > 1:
|
||||||
return redirect(url_for('.go', node=slugify(q[3:])))
|
return redirect(url_for('.go', node=slugify(q[3:])))
|
||||||
return redirect(url_for('.node', node=slugify(q)))
|
return redirect(url_for('.node', node=slugify(q)))
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ You can try searching or listing <a href="/nodes">all nodes</a>.<br /><br />
|
|||||||
|
|
||||||
{% if node.subnodes %}
|
{% if node.subnodes %}
|
||||||
<div class="node">
|
<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 %}
|
{% for subnode in node.subnodes %}
|
||||||
<div class="subnode">
|
<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 %}
|
{% for node in pull_nodes %}
|
||||||
<div class="node">
|
<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 %}
|
{% if node.subnodes %}
|
||||||
{% for subnode in 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>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% else %}
|
{% else %}
|
||||||
not found. <br />
|
empty. <br />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
Reference in New Issue
Block a user