diff --git a/accounts.py b/accounts.py index e91e956..a3b8228 100644 --- a/accounts.py +++ b/accounts.py @@ -92,6 +92,9 @@ def login(email,password): # Create a cookie token = generate_cookie() user['tokens'].append(token) + # Get the newest 2 tokens + user['tokens'] = user['tokens'][-2:] + # Update user db.update_tokens(user['id'], user['tokens']) return {'success': True, 'message': 'Logged in', 'token': token} \ No newline at end of file diff --git a/main.py b/main.py index d15abcb..38c2f92 100644 --- a/main.py +++ b/main.py @@ -138,9 +138,11 @@ def edit(): fg_colour = data['fg_colour'] if 'text_colour' in data: text_colour = data['text_colour'] + if 'email' in data: + email = data['email'] return render_template('edit.html',account=user['email'],account_link="account",account_link_name="Account",data=html, - hns=hns,btc=btc,eth=eth,hnschat=hnschat,location=location,avatar=avatar, + hns=hns,btc=btc,eth=eth,hnschat=hnschat,email=email,location=location,avatar=avatar, bg_colour=bg_colour,fg_colour=fg_colour,text_colour=text_colour, CITY_DOMAIN=CITY_DOMAIN,domain=user['domain']) @@ -170,6 +172,7 @@ def send_edit(): data['bg_colour'] = request.form['bg_colour'] data['fg_colour'] = request.form['fg_colour'] data['text_colour'] = request.form['text_colour'] + data['email'] = request.form['email'] # Convert to json data = json.dumps(data) diff --git a/sites/website.py b/sites/website.py index 5f0cf6d..aeebead 100644 --- a/sites/website.py +++ b/sites/website.py @@ -26,6 +26,7 @@ def render(data,db_object): avatar = db_object['avatar'] hnschat = db_object['hnschat'] location = db_object['location'] + email = db_object['email'] hns = db_object['HNS'] btc = db_object['BTC'] eth = db_object['ETH'] @@ -37,11 +38,13 @@ def render(data,db_object): btc_icon = "assets/img/BTCW.png" eth_icon = "assets/img/ETHW.png" location_icon = "assets/img/mapw.png" + email_icon = "assets/img/emailw.png" else: hns_icon = "assets/img/HNS.png" btc_icon = "assets/img/BTC.png" eth_icon = "assets/img/ETH.png" location_icon = "assets/img/map.png" + email_icon = "assets/img/email.png" if hns != "": hns = "" + hns @@ -50,9 +53,13 @@ def render(data,db_object): if eth != "": eth = "" + eth if hnschat != "": - hnschat = "" + hnschat + hnschat = "" + hnschat + "" if location != "": location = "" + location + if email != "": + email = "" + email + "" + + @@ -62,7 +69,7 @@ def render(data,db_object): return render_template('city.html',html=html,bg_colour=bg_colour,text_colour=text_colour, fg_colour=fg_colour, avatar=avatar,main_domain=main_domain, - hnschat=hnschat,location=location, hns_icon=hns_icon, + hnschat=hnschat,email=email,location=location, hns_icon=hns_icon, hns=hns,btc=btc,eth=eth, data=html) diff --git a/templates/assets/img/email.png b/templates/assets/img/email.png new file mode 100644 index 0000000..9b1a0eb Binary files /dev/null and b/templates/assets/img/email.png differ diff --git a/templates/assets/img/emailw.png b/templates/assets/img/emailw.png new file mode 100644 index 0000000..53a6964 Binary files /dev/null and b/templates/assets/img/emailw.png differ diff --git a/templates/city.html b/templates/city.html index 05ddd15..5e511a9 100644 --- a/templates/city.html +++ b/templates/city.html @@ -17,84 +17,42 @@
-{{location|safe}}
+{{hnschat|safe}}
+{{email|safe}}
+{{location|safe}}
+{{hnschat|safe}}
-{{location|safe}}
-{{hnschat|safe}}
-{{location|safe}}
-{{data|safe}}