From 3f867b4027d3c9f80908851905f30dd9785b2155 Mon Sep 17 00:00:00 2001 From: Mattia Succurro Date: Fri, 11 Oct 2019 17:20:24 +0200 Subject: [PATCH] Fixes and style improvements; added a mock of terms, privacy and robots.txt --- app.py | 18 ++++++++++++++++-- robots.txt | 1 + static/style.css | 2 ++ templates/base.html | 2 ++ templates/privacy.html | 7 +++++++ templates/terms.html | 7 +++++++ 6 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 robots.txt create mode 100644 templates/privacy.html create mode 100644 templates/terms.html diff --git a/app.py b/app.py index 73d5d13..e0a484d 100644 --- a/app.py +++ b/app.py @@ -6,7 +6,7 @@ from peewee import * import datetime, time, re, os, sys, string, json from functools import wraps -__version__ = '0.4-dev' +__version__ = '0.4.0' # we want to support Python 3 only. # Python 2 has too many caveats. @@ -311,7 +311,8 @@ def unpush_notification(type, target, **kwargs): (Notification.type == type) & (Notification.target == target) & (Notification.detail == json.dumps(kwargs)) - )) + ) + .execute()) except Exception: sys.excepthook(*sys.exc_info()) @@ -538,6 +539,19 @@ def notifications(): def about(): return render_template('about.html', version=__version__) +# The two following routes are mandatory by law. +@app.route('/terms/') +def terms(): + return render_template('terms.html') + +@app.route('/privacy/') +def privacy(): + return render_template('privacy.html') + +@app.route('/robots.txt') +def robots_txt(): + return send_from_directory(os.getcwd(), 'robots.txt') + @app.route('/uploads/.jpg') def uploads(id, type='jpg'): return send_from_directory(UPLOAD_DIRECTORY, id + '.' + type) diff --git a/robots.txt b/robots.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/robots.txt @@ -0,0 +1 @@ + diff --git a/static/style.css b/static/style.css index 31d761a..ca2d8b8 100644 --- a/static/style.css +++ b/static/style.css @@ -1,3 +1,4 @@ +body,button,input,select,textarea{font-family:'Segoe UI',Arial,Helvetica,sans-serif} body{margin:0} .header{padding:12px;color:white;background-color:#ff3018} .content{padding:12px} @@ -12,5 +13,6 @@ body{margin:0} .follow_button,input[type="submit"]{background-color:#ff3018;color:white;border-radius:3px;border:1px solid #ff3018} .follow_button.following{background-color:transparent;color:#ff3018;border-color:#ff3018} .copyright{font-size:smaller;text-align:center;color:#808080} +.copyright a:link,.copyright a:visited{color:#31559e} .copyright ul{list-style:none;padding:0} .copyright ul > li{padding:0 3px} diff --git a/templates/base.html b/templates/base.html index 9aed770..99e540a 100644 --- a/templates/base.html +++ b/templates/base.html @@ -5,6 +5,8 @@ {{ site_name }} + +
diff --git a/templates/privacy.html b/templates/privacy.html new file mode 100644 index 0000000..8bdfb55 --- /dev/null +++ b/templates/privacy.html @@ -0,0 +1,7 @@ +{% extends "base.html" %} + +{% block body %} +

Privacy Policy

+ + +{% endblock %} diff --git a/templates/terms.html b/templates/terms.html new file mode 100644 index 0000000..203e44e --- /dev/null +++ b/templates/terms.html @@ -0,0 +1,7 @@ +{% extends "base.html" %} + +{% block body %} +

Terms of Service

+ + +{% endblock %}