Show username for logged in users

This commit is contained in:
Edward Betts 2021-06-17 19:12:07 +02:00
parent 4689323583
commit 6cd2bfa6b0
3 changed files with 53 additions and 14 deletions

View file

@ -299,16 +299,20 @@ def old_map_location(zoom, lat, lng):
def map_start_page():
location = get_user_location()
lat, lon = location
return redirect(url_for(
'map_location',
zoom=16,
lat=f'{lat:.5f}',
lon=f'{lon:.5f}'
lon=f'{lon:.5f}',
))
@app.route("/map/<int:zoom>/<float(signed=True):lat>/<float(signed=True):lon>")
def map_location(zoom, lat, lon):
return render_template("map.html", zoom=zoom, lat=lat, lon=lon)
user = flask_login.current_user
username = user.username if user.is_authenticated else None
return render_template("map.html", zoom=zoom, lat=lat, lon=lon, username=username)
@app.route("/old_map")