mirror of
https://github.com/flancian/garden.git
synced 2026-08-08 15:36:19 +00:00
Rank nodes by size.
This commit is contained in:
+2
-2
@@ -49,7 +49,7 @@ def latest():
|
|||||||
@bp.route('/today')
|
@bp.route('/today')
|
||||||
def today():
|
def today():
|
||||||
today = datetime.datetime.now().date()
|
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'))
|
@bp.route('/oldsearch', methods=('GET', 'POST'))
|
||||||
def oldsearch():
|
def oldsearch():
|
||||||
@@ -269,7 +269,7 @@ def garden(garden):
|
|||||||
# Lists
|
# Lists
|
||||||
@bp.route('/nodes')
|
@bp.route('/nodes')
|
||||||
def 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')
|
@bp.route('/nodes.json')
|
||||||
def nodes_json():
|
def nodes_json():
|
||||||
|
|||||||
@@ -548,6 +548,9 @@ def content_to_forward_links(content):
|
|||||||
def latest():
|
def latest():
|
||||||
return sorted(G.subnodes(), key=lambda x: -x.mtime)
|
return sorted(G.subnodes(), key=lambda x: -x.mtime)
|
||||||
|
|
||||||
|
def top():
|
||||||
|
return sorted(G.nodes().values(), key=lambda x: -x.size())
|
||||||
|
|
||||||
def all_users():
|
def all_users():
|
||||||
# hack hack.
|
# hack hack.
|
||||||
users = os.listdir(os.path.join(config.AGORA_PATH, 'garden'))
|
users = os.listdir(os.path.join(config.AGORA_PATH, 'garden'))
|
||||||
|
|||||||
Reference in New Issue
Block a user