mirror of
https://github.com/flancian/garden.git
synced 2026-08-07 23:16:21 +00:00
Rank nodes by size.
This commit is contained in:
+2
-2
@@ -49,7 +49,7 @@ def latest():
|
||||
@bp.route('/today')
|
||||
def today():
|
||||
today = datetime.datetime.now().date()
|
||||
return redirect("https://anagora.org/node/%s" % today.strftime("%Y-%m-%d"))
|
||||
return redirect("/node/%s" % today.strftime("%Y-%m-%d"))
|
||||
|
||||
@bp.route('/oldsearch', methods=('GET', 'POST'))
|
||||
def oldsearch():
|
||||
@@ -269,7 +269,7 @@ def garden(garden):
|
||||
# Lists
|
||||
@bp.route('/nodes')
|
||||
def nodes():
|
||||
return render_template('nodes.html', nodes=G.nodes(include_journals=False).values())
|
||||
return render_template('nodes.html', nodes=db.top())
|
||||
|
||||
@bp.route('/nodes.json')
|
||||
def nodes_json():
|
||||
|
||||
@@ -548,6 +548,9 @@ def content_to_forward_links(content):
|
||||
def latest():
|
||||
return sorted(G.subnodes(), key=lambda x: -x.mtime)
|
||||
|
||||
def top():
|
||||
return sorted(G.nodes().values(), key=lambda x: -x.size())
|
||||
|
||||
def all_users():
|
||||
# hack hack.
|
||||
users = os.listdir(os.path.join(config.AGORA_PATH, 'garden'))
|
||||
|
||||
Reference in New Issue
Block a user