- add: add beverages
This commit is contained in:
@@ -7,8 +7,24 @@
|
||||
</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 %}
|
||||
<table>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Name</th>
|
||||
<th>Preis</th>
|
||||
<th>Wird angezeigt</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
{% for product in products %}
|
||||
<tr>
|
||||
<td>{{product.id}}</td>
|
||||
<td>{{product.name}}</td>
|
||||
<td>{{product.price}}</td>
|
||||
<td>{% if product.isshown %} ☑ {% else %} ☐ {% endif %} </td>
|
||||
<td> <a href="/manage_beverages/edit/{{product.name}}">bearbeiten</a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
<br />
|
||||
<a href=/manage_beverages/add>Getränk Hinzufügen</a></li>
|
||||
{% endblock %}
|
||||
18
app/templates/manage_beverages_add.html
Normal file
18
app/templates/manage_beverages_add.html
Normal file
@@ -0,0 +1,18 @@
|
||||
{% 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_beverages/add">
|
||||
Produktname:<input type="text" name="name" required><br>
|
||||
Preis:<input type="number" name="price" step="any" required value="0.0" /> € <br>
|
||||
Angezeigt: <input type="checkbox" name="isshown" checked /><br>
|
||||
<input type="submit" value="Hinzufügen">
|
||||
</form>
|
||||
{% endblock %}
|
||||
19
app/templates/manage_beverages_edit.html
Normal file
19
app/templates/manage_beverages_edit.html
Normal file
@@ -0,0 +1,19 @@
|
||||
{% extends "base.html"%}
|
||||
{% set title = "Konsumat bearbeiten" %}
|
||||
{% block content %}
|
||||
<h1> {{product_to_edit.name}} bearbeiten</h1>
|
||||
{% if error %}
|
||||
<p>Fehler: {{ error }}</p>
|
||||
{% else %}
|
||||
{% if success %}
|
||||
<p>{{ success }}</p>
|
||||
{% endif %}
|
||||
<form name="product" method="post" action="/manage_beverages/edit">
|
||||
Userid: <input type="text" name="id" required value="{{product_to_edit.id}}" readonly="readonly" /> <br>
|
||||
Username:<input type="text" name="name" required value="{{product_to_edit.name}}" /> <br>
|
||||
Preis:<input type="number" name="price" step="any" required value="{{product_to_edit.price}}" /> € <br>
|
||||
Angezeigt: <input type="checkbox" name="isshown" {% if product_to_edit.isshown %} checked {% endif %} /><br>
|
||||
<input type="submit" value="Übernehmen" />
|
||||
</form>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
@@ -1,16 +0,0 @@
|
||||
{% 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 %}
|
||||
Reference in New Issue
Block a user