forked from edward/owl-map
Show username for logged in users
This commit is contained in:
parent
4689323583
commit
6cd2bfa6b0
3 changed files with 53 additions and 14 deletions
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue