- modified web interface: added stylesheet, personal page and divs;
This commit is contained in:
@@ -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;
|
||||
}
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" type="text/css" href="/static/style.css">
|
||||
{% if title %}
|
||||
<title> {{ title }} - Baroness </title>
|
||||
{% else %}
|
||||
@@ -13,27 +14,30 @@
|
||||
|
||||
<body>
|
||||
<!-- Menu -->
|
||||
<h1> Menu </h1>
|
||||
<ul>
|
||||
<li><a href="/index">Home</a></li>
|
||||
<div class="tops">
|
||||
<h1> {{ title }} - Baroness</h1>
|
||||
<a href="/index"><div class="item">Home</div></a>
|
||||
{% if user %}
|
||||
<li><a href="/logout">Logout</a></li>
|
||||
<li><a href="/consume"> Konsumieren</a></li>
|
||||
<li><a href="/personal">Personal</a></li>
|
||||
<a href="/logout"><div class="item">Logout</div></a>
|
||||
<a href="/consume"><div class="item">Konsumieren</div></a>
|
||||
<a href="/personal"><div class="item">Personal</div></a>
|
||||
{% if user.isbaron %}
|
||||
<li><a href="/billing">Billing</a></li>
|
||||
<li><a href="/manage_beverages">Konsumatverwaltung</a></li>
|
||||
<li><a href="/manage_users">Konsumentenverwaltung</a></li>
|
||||
<a href="/billing"><div class="item">Billing</div></a>
|
||||
<a href="/manage_beverages"><div class="item">Konsumatverwaltung</div></a>
|
||||
<a href="/manage_users"><div class="item">Konsumentenverwaltung</div></a>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<li><a href="/login">Login</a></li>
|
||||
<a href="/login"><div class="item right">Login</div></a>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
{% if user %}
|
||||
<div class="loggedin">
|
||||
Du bist eingeloggt als {{user.longname}}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="mainblock">
|
||||
{% block content %}{% endblock %}
|
||||
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<p>
|
||||
Möchtest du etwas konsumieren?
|
||||
{% for product in products %}
|
||||
<div><p> {{ product.id }}, <a href="/consume?prodid={{product.id}}"> {{product.name}} </a>, {{product.price}} € </p> </div>
|
||||
<div><p> {{ product.id }}, <a href="/consume?prodid={{product.id}}"> {{product.name}} </a>, {{"%0.2f" % product.price}} € </p> </div>
|
||||
{% endfor %}
|
||||
</p>
|
||||
{% endblock %}
|
||||
|
||||
@@ -3,17 +3,18 @@
|
||||
{% block content %}
|
||||
<h3>TODO: </h3>
|
||||
<ul>
|
||||
<li> graphical beer list</li>
|
||||
<img src="{{ url_for('static', filename='total.png') }}">
|
||||
{% if user %}
|
||||
<li>generate new plots if .png missing</li>
|
||||
</ul>
|
||||
|
||||
<h1> Bierkonsum </h1>
|
||||
<img src="{{ url_for('static', filename='total.png') }}">
|
||||
{% if user %}
|
||||
{% set fils = "total%03d.png" % user.id %}
|
||||
<img src="{{ url_for('static', filename=fils) }}">
|
||||
{% endif %}
|
||||
|
||||
</ul>
|
||||
{% endif %}
|
||||
<h1> Bierliste </h1>
|
||||
<img src="{{ url_for('static', filename='bierliste_small.png') }}">
|
||||
<table>
|
||||
<!-- <table>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Produkt Nummer</th>
|
||||
@@ -30,5 +31,5 @@
|
||||
<td>{{consumption.time}}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</table> -->
|
||||
{% endblock %}
|
||||
|
||||
17
app/templates/personal.html
Normal file
17
app/templates/personal.html
Normal file
@@ -0,0 +1,17 @@
|
||||
{% extends "base.html"%}
|
||||
{% set title = "Personal" %}
|
||||
{% block content %}
|
||||
<h3>TODO: </h3>
|
||||
<ul>
|
||||
<li>add money owed</li>
|
||||
</ul>
|
||||
<h1> Statistik </h1>
|
||||
|
||||
<h2> Bierkonsum </h2>
|
||||
<img src="{{ url_for('static', filename='total.png') }}">
|
||||
{% if user %}
|
||||
{% set fils = "total%03d.png" % user.id %}
|
||||
<img src="{{ url_for('static', filename=fils) }}">
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
@@ -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():
|
||||
|
||||
Reference in New Issue
Block a user