diff --git a/gruppenbildungsspiel.py b/gruppenbildungsspiel.py index 0374d09..87fefa7 100644 --- a/gruppenbildungsspiel.py +++ b/gruppenbildungsspiel.py @@ -1,10 +1,17 @@ from flask import Flask, render_template +import uuid +import csv +import os + app = Flask(__name__) app.jinja_env.trim_blocks = True app.jinja_env.lstrip_blocks = True +datafile = "data.csv" + @app.route('/') def index(): + generate_id() return render_template('index.html', title='Test', text='Hallo, Fooboar') @app.route('/form') @@ -27,3 +34,11 @@ def answers(): def solution(): return render_template('solution.html', title='Test', text='Hallo, Lösung') +def generate_id(): + data = list() + new_id = uuid.uuid1().split("-")[0] + + if not os.path.exists(datafile): + open(datafile, "a").close() + + with open(datafile, "r") as f: diff --git a/static/main.css b/static/main.css index 53a8c6c..570a14e 100644 --- a/static/main.css +++ b/static/main.css @@ -6,6 +6,7 @@ html{ /* Header */ header{ display: block; + vertical-align: middle; } /* Navigation bar */ @@ -71,3 +72,14 @@ li a{ .btn-group button:hover { background-color: #3e8e41; } + +/* logo image class */ +.logo { + width: 10%; +} + +/* headline for header */ +header h1 { + display: inline; + vertical-align: center; +} diff --git a/templates/base.html b/templates/base.html index d1b7c66..56c9031 100644 --- a/templates/base.html +++ b/templates/base.html @@ -7,9 +7,9 @@
-
-........
+