Add ubiquituous search.
This commit is contained in:
parent
65d8e6f776
commit
26b8f548c6
3 changed files with 40 additions and 0 deletions
|
@ -118,6 +118,8 @@ def node(node):
|
||||||
n = G.node(node)
|
n = G.node(node)
|
||||||
n.subnodes = util.uprank(n.subnodes, user='flancian')
|
n.subnodes = util.uprank(n.subnodes, user='flancian')
|
||||||
|
|
||||||
|
search_subnodes = db.search_subnodes(node)
|
||||||
|
|
||||||
return render_template(
|
return render_template(
|
||||||
'node_rendered.html',
|
'node_rendered.html',
|
||||||
node=n,
|
node=n,
|
||||||
|
@ -125,6 +127,7 @@ def node(node):
|
||||||
pushlinks=n.push_links() if n else [],
|
pushlinks=n.push_links() if n else [],
|
||||||
pull_nodes=n.pull_nodes() if n else [],
|
pull_nodes=n.pull_nodes() if n else [],
|
||||||
forwardlinks=n.forward_links() if n else [],
|
forwardlinks=n.forward_links() if n else [],
|
||||||
|
search=search_subnodes
|
||||||
)
|
)
|
||||||
|
|
||||||
@bp.route('/subnode/<path:subnode>')
|
@bp.route('/subnode/<path:subnode>')
|
||||||
|
|
|
@ -55,4 +55,6 @@ Try listing all <a href="/nodes">nodes</a> or perhaps <a href="/search">search</
|
||||||
|
|
||||||
{% include "links.html" %}
|
{% include "links.html" %}
|
||||||
|
|
||||||
|
{% include "node_search.html" %}
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
35
app/templates/node_search.html
Normal file
35
app/templates/node_search.html
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
<!--
|
||||||
|
Copyright 2020 Google LLC
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<br />
|
||||||
|
<div class="search"><strong>Search results (this Agora)</strong>
|
||||||
|
<br>
|
||||||
|
{% if search %}
|
||||||
|
{% for subnode in search %}
|
||||||
|
(user: {{subnode.user}}) {{ subnode.uri }}: <a href="{{subnode.url}}">{{subnode.wikilink}}</a><br />
|
||||||
|
{% endfor %}
|
||||||
|
{% else %}
|
||||||
|
No search results.
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<div class="search">
|
||||||
|
Search results (the internet)
|
||||||
|
</div>
|
||||||
|
-->
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue