From 57b799472f649b5ad85a3c311a26d5e5acecc694 Mon Sep 17 00:00:00 2001 From: Ville Rantanen Date: Sun, 18 Feb 2018 09:56:31 +0200 Subject: [PATCH] version number and site name --- code/app.py | 4 ++++ code/static/css/styles.css | 8 ++++++-- code/templates/index.html | 2 +- code/templates/layout.html | 2 +- data/config.json.example | 1 + 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/code/app.py b/code/app.py index 99866e8..f856521 100644 --- a/code/app.py +++ b/code/app.py @@ -11,10 +11,12 @@ import hashlib import zipfile from revprox import ReverseProxied +__FLEES_VERSION__ = "20180218.0" app = Flask(__name__) app.config.from_object(__name__) # Read config from json ! config_values = json.load(open(os.getenv('FLEES_CONFIG'),'rt')) +app.config['SITE_NAME'] = config_values['site_name'] app.config['UPLOAD_FOLDER'] = config_values['data_folder'] app.config['SHARES_FILE'] = config_values['shares_file'] app.config['ZIP_FOLDER'] = config_values['zip_folder'] @@ -30,6 +32,8 @@ app.wsgi_app = ReverseProxied(app.wsgi_app) @app.before_request def before_request(): g.shares = json.load(open(app.config['SHARES_FILE'],'rt')) + g.version = __FLEES_VERSION__ + g.site_name = app.config['SITE_NAME'] @app.route("/") def index(): diff --git a/code/static/css/styles.css b/code/static/css/styles.css index 99271f6..df93471 100755 --- a/code/static/css/styles.css +++ b/code/static/css/styles.css @@ -1,9 +1,9 @@ -html{ +html { min-height: 100%; position: relative; } -body{ +body { color: slategray; background-color: ghostwhite; min-height: 600px; @@ -30,6 +30,10 @@ a:link { text-align: center; padding-top: 7px; } +.version_number { + font-size: xx-small; +} + td,th { min-width: 10em; padding-right: 2em; diff --git a/code/templates/index.html b/code/templates/index.html index 59ecd9d..335c2a6 100755 --- a/code/templates/index.html +++ b/code/templates/index.html @@ -1,6 +1,6 @@ {% extends "layout.html" %} {% block body %} -

Flees

+

{{ g.site_name | safe }}

- + diff --git a/data/config.json.example b/data/config.json.example index d0a6412..1a004fc 100644 --- a/data/config.json.example +++ b/data/config.json.example @@ -8,6 +8,7 @@ "app_secret_key: used to encrypt session cookie" ], "public_url": "https://my.server.com/flees", + "site_name": "File sharing", "workers": 8, "timeout": 3600, "uid": 1000,