From be95db18239c2e052a5ff2139d3cc7edb4d5a6cc Mon Sep 17 00:00:00 2001 From: Bernhard Stampfer Date: Thu, 18 Feb 2016 15:18:11 +0100 Subject: [PATCH] - modified web interface: added stylesheet, personal page and divs; --- app/static/style.css | 53 ++++++++++++++++++++++++++++++++++++- app/templates/base.html | 28 +++++++++++--------- app/templates/consume.html | 2 +- app/templates/index.html | 17 ++++++------ app/templates/personal.html | 17 ++++++++++++ app/views.py | 5 ++++ 6 files changed, 100 insertions(+), 22 deletions(-) create mode 100644 app/templates/personal.html diff --git a/app/static/style.css b/app/static/style.css index 9f6da40..437590d 100644 --- a/app/static/style.css +++ b/app/static/style.css @@ -1 +1,52 @@ -static css style sheet +div.tops { background-color:#006699; + color:white; + padding:5px; + padding-left:20px; + overflow:hidden; + border-radius:5px; + border:0px solid black; +} + +div.loggedin { background-color:#009966; + color:white; + padding:5px; + padding-left:20px; + overflow:hidden; + border-radius:5px; + border:0px solid black; +} + +div.mainblock { background-color:white; + color:black; + padding:5px; + padding-left:20px; + overflow:hidden; + border-radius:5px; + border:1px solid black; +} + +div.item { float:left; + margin:3px; + padding:5px; + border:1px solid; + border-color:black; + border-radius:4px; + min-width:80px; + #line-height:25px; + background-color:#0088AA; + color:white; + text-align:center; + text-decoration:none; +} + +div.item:hover { background-color:#00AA88; +} + +div.item:active { background-color:AA8800; +} + +.center { text-align:center; +} + +.right { float:right; +} \ No newline at end of file diff --git a/app/templates/base.html b/app/templates/base.html index 86d5ec2..61c5d7a 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -4,6 +4,7 @@ + {% if title %} {{ title }} - Baroness {% else %} @@ -13,27 +14,30 @@ -

Menu

- + {% if user %} +
Du bist eingeloggt als {{user.longname}} +
{% endif %} +
{% block content %}{% endblock %} - +
diff --git a/app/templates/consume.html b/app/templates/consume.html index 054966c..d7a0f0f 100644 --- a/app/templates/consume.html +++ b/app/templates/consume.html @@ -12,7 +12,7 @@

Möchtest du etwas konsumieren? {% for product in products %} -

{{ product.id }}, {{product.name}} , {{product.price}} €

+

{{ product.id }}, {{product.name}} , {{"%0.2f" % product.price}} €

{% endfor %}

{% endblock %} diff --git a/app/templates/index.html b/app/templates/index.html index e27f357..59f1d3a 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -3,17 +3,18 @@ {% block content %}

TODO:

+ +

Bierkonsum

+ + {% if user %} {% set fils = "total%03d.png" % user.id %} - {% endif %} - - + {% endif %}

Bierliste

- + {% endblock %} diff --git a/app/templates/personal.html b/app/templates/personal.html new file mode 100644 index 0000000..7d80673 --- /dev/null +++ b/app/templates/personal.html @@ -0,0 +1,17 @@ +{% extends "base.html"%} +{% set title = "Personal" %} +{% block content %} +

TODO:

+ +

Statistik

+ +

Bierkonsum

+ + {% if user %} + {% set fils = "total%03d.png" % user.id %} + + {% endif %} + +{% endblock %} diff --git a/app/views.py b/app/views.py index 6d3e1fe..f0fe22f 100644 --- a/app/views.py +++ b/app/views.py @@ -216,6 +216,11 @@ def consume(): plot_list(4) return render_template('consume.html', products=products, message=message, user=get_user_by_name(session.get('name'))) +@app.route('/personal') +@requires_login +def personal(): + return render_template('personal.html', user=get_user_by_name(session.get('name'))) + @app.route('/billing') @requires_baron def billing():