Patch.
This commit is contained in:
parent
98ceec37ea
commit
983ff8d169
2 changed files with 6 additions and 4 deletions
|
@ -22,6 +22,9 @@ from . import util
|
||||||
bp = Blueprint('agora', __name__)
|
bp = Blueprint('agora', __name__)
|
||||||
|
|
||||||
|
|
||||||
|
G = db.G
|
||||||
|
|
||||||
|
|
||||||
# Special
|
# Special
|
||||||
@bp.route('/index')
|
@bp.route('/index')
|
||||||
@bp.route('/')
|
@bp.route('/')
|
||||||
|
@ -138,12 +141,12 @@ def garden(garden):
|
||||||
# Lists
|
# Lists
|
||||||
@bp.route('/nodes')
|
@bp.route('/nodes')
|
||||||
def nodes():
|
def nodes():
|
||||||
return render_template('nodes.html', nodes=db.all_nodes(include_journals=False))
|
return render_template('nodes.html', nodes=G.nodes(include_journals=False))
|
||||||
|
|
||||||
@bp.route('/notes') # alias
|
@bp.route('/notes') # alias
|
||||||
@bp.route('/subnodes')
|
@bp.route('/subnodes')
|
||||||
def subnodes():
|
def subnodes():
|
||||||
return render_template('subnodes.html', subnodes=db.all_subnodes())
|
return render_template('subnodes.html', subnodes=G.subnodes())
|
||||||
|
|
||||||
@bp.route('/users')
|
@bp.route('/users')
|
||||||
def users():
|
def users():
|
||||||
|
|
|
@ -51,7 +51,7 @@ class Graph:
|
||||||
# looks up a node by uri (essentially [[wikilink]]).
|
# looks up a node by uri (essentially [[wikilink]]).
|
||||||
# horrible
|
# horrible
|
||||||
nodes = self.nodes()
|
nodes = self.nodes()
|
||||||
return [node for node in nodes if node.uri == uri][0]
|
return nodes_by_wikilink(uri)[0]
|
||||||
|
|
||||||
def nodes(self, include_journals=True):
|
def nodes(self, include_journals=True):
|
||||||
# returns a list of all nodes
|
# returns a list of all nodes
|
||||||
|
@ -287,7 +287,6 @@ def wikilink_to_node(node):
|
||||||
# We'll handle 404 in the template, as we want to show backlinks to non-existent nodes.
|
# We'll handle 404 in the template, as we want to show backlinks to non-existent nodes.
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def subnodes_by_wikilink(wikilink, fuzzy_matching=True):
|
def subnodes_by_wikilink(wikilink, fuzzy_matching=True):
|
||||||
if fuzzy_matching:
|
if fuzzy_matching:
|
||||||
# TODO
|
# TODO
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue