Fixes and style improvements; added a mock of terms, privacy and robots.txt

This commit is contained in:
Yusur 2019-10-11 17:20:24 +02:00
parent bbbc7655a0
commit 3f867b4027
6 changed files with 35 additions and 2 deletions

18
app.py
View file

@ -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/<id>.jpg')
def uploads(id, type='jpg'):
return send_from_directory(UPLOAD_DIRECTORY, id + '.' + type)

1
robots.txt Normal file
View file

@ -0,0 +1 @@

View file

@ -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}

View file

@ -5,6 +5,8 @@
<title>{{ site_name }}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="/static/style.css">
<meta name="og:title" content="Cori+">
<meta name="og:description" content="A simple social network. Post text statuses, optionally with image.">
</head>
<body>
<div class="header">

7
templates/privacy.html Normal file
View file

@ -0,0 +1,7 @@
{% extends "base.html" %}
{% block body %}
<h1>Privacy Policy</h1>
{% endblock %}

7
templates/terms.html Normal file
View file

@ -0,0 +1,7 @@
{% extends "base.html" %}
{% block body %}
<h1>Terms of Service</h1>
{% endblock %}