diff --git a/main.py b/main.py index 753de85..b9fd26f 100644 --- a/main.py +++ b/main.py @@ -18,7 +18,7 @@ class Person: return self.name def __eq__(self, other): - return self.name == other.name + return self.name.lower() == other.name.lower() def getStatus(self): return self.statusses[self.status] @@ -41,12 +41,14 @@ def home(): return render_template("home.html", people=people) -@app.route("/statusUpdate") +@app.route("/statusUpdate", methods=["POST", "GET"]) def statusUpdate(): - if people: - people[0].status += 1 - if people[0].status == 3: - people.remove(people[0]) + if people and request.method == "POST": + index = people.index(Person(request.form["name"])) + print(index) + people[index].status += 1 + if people[index].status == 3: + people.remove(people[index]) return redirect("/") diff --git a/templates/home.html b/templates/home.html index 59117f5..2eaddbc 100644 --- a/templates/home.html +++ b/templates/home.html @@ -14,16 +14,16 @@

+
+

Up te daten persoon

+

+
+

Zie hieronder de lijst van personen die een pannenkoek willen

{% for person in people %} - {% endfor %}
{{ person.getName() + person.getRemark() + ": " }} - - - - {{ "Huidige status: " + person.getStatus() }}