inital commit

This commit is contained in:
Ulrich Knechtelsdorfer
2016-02-13 16:18:48 +01:00
commit c84212e151
37 changed files with 1511 additions and 0 deletions

39
app/templates/base.html Normal file
View File

@@ -0,0 +1,39 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
{% if title %}
<title> {{ title }} - Baroness </title>
{% else %}
<title> Des Bierbarons Helferin - Baroness </title>
{% endif %}
</head>
<body>
<!-- Menu -->
<ul>
<li><a href="/index">Home</a></li>
{% if user %}
<li><a href="/logout">Logout</a></li>
<li><a href="/consume"> Konsumieren</a></li>
<li><a href="/personal">Personal</a></li>
{% 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>
{% endif %}
{% else %}
<li><a href="/login">Login</a></li>
{% endif %}
</ul>
{% if user %}
Du bist eingeloggt als {{user.longname}}.
{% endif %}
{% block content %}{% endblock %}
</body>
</html>

View File

@@ -0,0 +1,10 @@
{% extends "base.html"%}
{% set title = "Konsumatverwaltung" %}
{% block content %}
<h3>TODO: </h3>
<ul>
<li>everything</li>
</ul>
<h1>Abrechnung</h1>
{% endblock %}

View File

@@ -0,0 +1,18 @@
{% extends "base.html"%}
{% set title = "Konsumieren" %}
{% block content %}
<h3>TODO: </h3>
<ul>
<li>add photos for products, add photos in database</li>
</ul>
<h1> Konsumieren </h1>
{% if message %}
<p> {{ message }} </p>
{% endif %}
<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>
{% endfor %}
</p>
{% endblock %}

27
app/templates/index.html Normal file
View File

@@ -0,0 +1,27 @@
{% extends "base.html"%}
{% set title = "Bierliste" %}
{% block content %}
<h3>TODO: </h3>
<ul>
<li> graphical beer list</li>
</ul>
<h1> Bierliste </h1>
<table>
<tr>
<th>ID</th>
<th>Produkt Nummer</th>
<th>Konsument</th>
<th>Preis</th>
<th>Zeit</th>
</tr>
{% for consumption in consumed %}
<tr>
<td>{{consumption.id}}</td>
<td>{{consumption.prodnr}}</td>
<td>{{consumption.consumer}}</td>
<td>{{consumption.price}}</td>
<td>{{consumption.time}}</td>
</tr>
{% endfor %}
</table>
{% endblock %}

17
app/templates/login.html Normal file
View File

@@ -0,0 +1,17 @@
{% extends "base.html"%}
{% set title = "Login" %}
{% block content %}
<h3>TODO: </h3>
<ul>
<li>encrypt and salt passwords</li>
</ul>
<h1> Login </h1>
{% if error %}
<p>{{ error }}</p>
{% endif %}
<form name="login" method="post" action="/login">
Username:<input type="text" name=username required placeholder="Username"><br>
Passwort:<input type="password" name=password required placeholder="Password"><br>
<input type="submit" value="Login">
</form>
{% endblock %}

View File

@@ -0,0 +1,14 @@
{% extends "base.html"%}
{% set title = "Konsumatverwaltung" %}
{% block content %}
<h3>TODO: </h3>
<ul>
<li>add "change products pages"</li>
</ul>
<h1> Konsumatverwaltung </h1>
{% for product in products %}
<div><p> {{ product.id }}, {{product.name}}, {{product.price}} €</p></div>
{% endfor %}
<a href=/manage_beverages/add>Getränk Hinzufügen</a></li>
{% endblock %}

View File

@@ -0,0 +1,16 @@
{% extends "base.html"%}
{% set title = "Produkt hinzufügen" %}
{% block content %}
<h1> Produkt hinzufügen</h1>
{% if error %}
<p>Fehler: {{ error }}</p>
{% endif %}
{% if success %}
<p>{{ success }}</p>
{% endif %}
<p> TODO: many </p>
<form name="user" method="post" action="/manage_users/add">
Produktname:<input type="text" name=username required placeholder="Username"><br>
Preis:<input type="password" name=password1 required placeholder="Password"><br>
</form>
{% endblock %}

View File

@@ -0,0 +1,34 @@
{% extends "base.html"%}
{% set title = "Konsumentenverwaltung" %}
{% block content %}
<h1> Konsumentenverwaltung </h1>
<p> TODO: many</p>
<table>
<tr>
<th>ID</th>
<th>Username</th>
<th>Name</th>
<th>E-mail</th>
<th>RFID-ID</th>
<th>Geschwärzt</th>
<th>Baron</th>
<th>Angezeigt</th>
<th></th>
</tr>
{% for user in users %}
<tr>
<td>{{user.id}}</td>
<td>{{user.name}}</td>
<td>{{user.longname}}</td>
<td>{{user.email}}</td>
<td>{{user.rfid_id}}</td>
<td>{% if user.isblack %} &#9745; {% else %} &#9744; {% endif %} </td>
<td>{% if user.isbaron %} &#9745; {% else %} &#9744; {% endif %} </td>
<td>{% if user.isshown %} &#9745; {% else %} &#9744; {% endif %} </td>
<td> <a href="/manage_users/edit/{{user.name}}">bearbeiten</a></td>
</tr>
{% endfor %}
</table>
<br />
<a href=/manage_users/add>User Hinzufügen</a>
{% endblock %}

View File

@@ -0,0 +1,21 @@
{% extends "base.html"%}
{% set title = "Konsumentin hinzufügen" %}
{% block content %}
<h1> Konsumentin hinzufügen</h1>
{% if error %}
<p>Fehler: {{ error }}</p>
{% endif %}
{% if success %}
<p>{{ success }}</p>
{% endif %}
<p> TODO: many </p>
<form name="user" method="post" action="/manage_users/add">
Username:<input type="text" name=username required placeholder="Username"><br>
Passwort:<input type="password" name=password1 required placeholder="Password"><br>
Passwort wiederholen:<input type="password" name=password2 required placeholder="Password"><br>
Name:<input type="text" name=longname required placeholder="Vorname Nachname"><br>
Email:<input type="email" name=email required placeholder="petra@fet.at"><br>
Euml ID:<input type="text" name=rfid_id required placeholder="0xDEADBEEF"><br>
<input type="submit" value="Hinzufügen">
</form>
{% endblock %}

View File

@@ -0,0 +1,23 @@
{% extends "base.html"%}
{% set title = "Konsumentin bearbeiten" %}
{% block content %}
<h1> {{user.name}} bearbeiten</h1>
{% if error %}
<p>Fehler: {{ error }}</p>
{% else %}
{% if success %}
<p>{{ success }}</p>
{% endif %}
<form name="user" method="post" action="/manage_users/edit">
Userid: <input type="text" name="id" required value="{{user_to_edit.id}}" readonly="readonly" /> <br>
Username:<input type="text" name="username" required value="{{user_to_edit.name}}" /> <br>
Name:<input type="text" name="longname" required value="{{user_to_edit.longname}}" /><br>
Email:<input type="email" name="email" required value="{{user_to_edit.email}}" /><br>
Euml ID:<input type="text" name="rfid_id" required value="{{user_to_edit.rfid_id}}" /><br>
Geschwärzt: <input type="checkbox" name="isblack" {% if user_to_edit.isblack %} checked {% endif %} /> <br>
Baron: <input type="checkbox" name="isbaron" {% if user_to_edit.isbaron %} checked {% endif %} /> <br>
Angezeigt: <input type="checkbox" name="isshown" {% if user_to_edit.isshown %} checked {% endif %} /><br>
<input type="submit" value="Übernehmen" />
</form>
{% endif %}
{% endblock %}

View File

@@ -0,0 +1,6 @@
{% extends "base.html"%}
{% set title = "Fehler 401" %}
{% block content %}
<h1> Fehler 401 </h1>
<p>Du musst Baron sein um auf diese Seite zugreifen zu könnnen.</p>
{% endblock %}

View File

@@ -0,0 +1,6 @@
{% extends "base.html"%}
{% set title = "Fehler 401" %}
{% block content %}
<h1> Fehler 401 </h1>
<p>Du musst eingeloggt sein um auf diese Seite zugerreifen zu können.</p>
{% endblock %}