From 873bdc1e8666eee3540a6b19bd784e7a1ba66aad Mon Sep 17 00:00:00 2001 From: janphilippweinsheimer Date: Fri, 19 Jan 2024 11:13:01 +0100 Subject: [PATCH] =?UTF-8?q?Gewohnheit=20erstellen=20Butten=20Seite=20f?= =?UTF-8?q?=C3=BCr=20das=20erstellen=20von=20einer=20neuen=20Gewohnheit=20?= =?UTF-8?q?fehlermeldungen=20und=20die=20=C3=BCbergabe=20an=20das=20backen?= =?UTF-8?q?d=20m=C3=BCssen=20noch=20hinzugef=C3=BCgt=20werden?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.py | 7 ++----- templates/habit.html | 36 ++++++++++++++++++++++++++++++++++++ templates/index.html | 14 +++++++++++--- 3 files changed, 49 insertions(+), 8 deletions(-) create mode 100644 templates/habit.html diff --git a/app.py b/app.py index cc785bf..6bbceeb 100644 --- a/app.py +++ b/app.py @@ -41,7 +41,7 @@ def index(): # habits = [("lesen", "eine Seite vor dem schlafen gehen"), ("sport", "3x Gym")] return render_template( 'index.html', - title='Hallo ' + current_user.name, + title=f"Hallo {current_user.name}", utc_dt=datetime.datetime.now().strftime("%d.%m.%Y %H:%M %A"), habits=habits, errors={}, @@ -149,7 +149,6 @@ def habit_creation(): title='Erstelle ein Habit', unit=1, errors={}, - habits=current_user.get_habits() ) @@ -186,8 +185,7 @@ def habit_create(): note=note, times=times, unit=unit, - errors=errors, - habits=current_user.get_habits() + errors=errors ) # Map unit to integer @@ -214,7 +212,6 @@ def habit_create(): times=times, unit=unit, errors=errors, - habits=current_user.get_habits() ) diff --git a/templates/habit.html b/templates/habit.html new file mode 100644 index 0000000..280f06c --- /dev/null +++ b/templates/habit.html @@ -0,0 +1,36 @@ +{% extends 'layouts/main.html' %} + +{% block content %} + + +
+
+ + +
+
+ + +
+ +
+
+ + +
+
+ + +
+
+ + +
+ +{% endblock %} \ No newline at end of file diff --git a/templates/index.html b/templates/index.html index 93bd9a8..ef4604e 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,7 +1,7 @@ {% extends 'layouts/main.html' %} {% block content %} -

Hello World!

+

{{ title }}

{{ utc_dt }}

@@ -30,9 +30,17 @@ - -

Task List

+ + + +
+

Task List

+ + Task erstellen + +
+