Jump!
This commit is contained in:
parent
cec60fa344
commit
fdef705efe
3 changed files with 19 additions and 9 deletions
15
app/agora.py
15
app/agora.py
|
@ -13,8 +13,9 @@
|
|||
# limitations under the License.
|
||||
|
||||
import datetime
|
||||
from flask import Blueprint, url_for, render_template, current_app, Response, redirect
|
||||
from flask import Blueprint, url_for, render_template, current_app, Response, redirect, request
|
||||
from markupsafe import escape
|
||||
from slugify import slugify, SLUG_OK
|
||||
from . import config
|
||||
from . import db
|
||||
from . import forms
|
||||
|
@ -97,16 +98,22 @@ def pull(node):
|
|||
Here it "broadcasts": it renders all nodes that pull from a given node.
|
||||
|
||||
Unclear at this point if this should exist at all, or whether it should do something else.
|
||||
|
||||
TODO: probably remove this, [[pull]] changed.
|
||||
"""
|
||||
|
||||
return redirect('/node/{}'.format(node))
|
||||
|
||||
|
||||
@bp.route('/jump')
|
||||
def jump():
|
||||
"""Redirects to the right node."""
|
||||
jump = request.args.get('jump')
|
||||
return redirect(url_for('.node', node=slugify(jump)))
|
||||
|
||||
# Entities
|
||||
@bp.route('/wikilink/<node>')
|
||||
@bp.route('/node/<node>')
|
||||
@bp.route('/wikilink/<node>') # alias for now
|
||||
def wikilink(node):
|
||||
def node(node):
|
||||
|
||||
n = G.node(node)
|
||||
n.subnodes = util.uprank(n.subnodes, user='flancian')
|
||||
|
|
|
@ -43,12 +43,12 @@
|
|||
<nav class="navigation">
|
||||
<a href="/"><img src="/static/img/agora.png" class="logo" style="vertical-align: top" width="19" height="19"></a>
|
||||
| <a href="/nodes">nodes</a>
|
||||
| <a href="/journals">journals</a>
|
||||
| <a href="/users">users</a>
|
||||
| <a href="/latest">latest</a>
|
||||
| <a href="/search">search</a>
|
||||
| <a href="/users">@</a>
|
||||
| <form action="/jump" method="get" style="display: inline;">jump: <input type="text" name="jump"></form>
|
||||
| <a href="#" style="text-decoration: none;" class="theme-toggle">🌙</a>
|
||||
| <a href="/node/agora-help" style="text-decoration: none;" class="help-button">ℹ️</a>
|
||||
<!-- doesn't fit on mobile right now.
|
||||
| <a href="/node/agora-help" style="text-decoration: none;" class="help-button">ℹ️</a>
|
||||
-->
|
||||
</nav>
|
||||
<hr>
|
||||
<div class="content">
|
||||
|
|
|
@ -23,7 +23,10 @@ python-Levenshtein==0.12.0
|
|||
pytz==2020.4
|
||||
regex==2020.11.13
|
||||
six==1.15.0
|
||||
text-unidecode==1.3
|
||||
tzlocal==2.1
|
||||
unicode-slugify==0.1.3
|
||||
Unidecode==1.1.2
|
||||
uWSGI==2.0.19.1
|
||||
webencodings==0.5.1
|
||||
Werkzeug==1.0.1
|
||||
|
|
Loading…
Reference in a new issue