Compare commits

..

No commits in common. "716ad056261392cd0f7a7a0474829f32aac1a548" and "2e40788bdb94f3f83ede12701a6411ae9bf3877b" have entirely different histories.

4 changed files with 10 additions and 40 deletions

2
.gitignore vendored
View file

@ -1,3 +1 @@
.idea/ .idea/
*.pyc
venv/

View file

@ -44,13 +44,6 @@ def home():
@app.route("/statusUpdate", methods=["POST", "GET"]) @app.route("/statusUpdate", methods=["POST", "GET"])
def statusUpdate(): def statusUpdate():
if people and request.method == "POST": if people and request.method == "POST":
result = request.form
if "index" in result:
index = int(request.form["index"])
people[index].status += 1
if people[index].status == 3:
people.remove(people[index])
if "name" in result:
index = people.index(Person(request.form["name"])) index = people.index(Person(request.form["name"]))
print(index) print(index)
people[index].status += 1 people[index].status += 1
@ -63,7 +56,7 @@ def statusUpdate():
def addPerson(): def addPerson():
if request.method == "POST": if request.method == "POST":
result = request.form result = request.form
if "name" in result: if result["name"]:
newPerson = Person(result["name"], result["remark"]) newPerson = Person(result["name"], result["remark"])
if newPerson not in people: if newPerson not in people:
people.append(newPerson) people.append(newPerson)

View file

@ -1 +0,0 @@
flask

View file

@ -1,12 +1,6 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<style>
body {
background-color: #303030;
color: white;
}
</style>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>Pannenkoekenwachtrij</title> <title>Pannenkoekenwachtrij</title>
</head> </head>
@ -21,28 +15,14 @@
</form> </form>
<form action="/statusUpdate" method="POST"> <form action="/statusUpdate" method="POST">
<input type="hidden" name="index" value="0"> <p>Up te daten persoon <input type="text" name="name"></p>
<p><input type="submit" value="Update First Person"></p> <p><input type="submit" value="Updaten"></p>
</form> </form>
<h2>Zie hieronder de lijst van personen die een pannenkoek willen</h2> <h2>Zie hieronder de lijst van personen die een pannenkoek willen</h2>
<h3>Volgende Persoon:</h3>
{% if people %}
<tr>
<th>{{ people[0].getName() + people[0].getRemark() + ": " }}</th>
<td>{{ "Huidige status: " + people[0].getStatus() }}</td>
</tr>
{% endif %}
<h3>Andere Personen:</h3>
<table> <table>
{% for person in people[1:] %} {% for person in people %}
<tr> <tr>
<td>
<form action="/statusUpdate" method="POST">
<input type="hidden" name="name" value="{{ person.getName() }}">
<input type="submit" value="Update">
</form>
</td>
<th>{{ person.getName() + person.getRemark() + ": " }}</th> <th>{{ person.getName() + person.getRemark() + ": " }}</th>
<td>{{ "Huidige status: " + person.getStatus() }}</td> <td>{{ "Huidige status: " + person.getStatus() }}</td>
</tr> </tr>