Compare commits

..

No commits in common. "c6dc48dd52c2b54e5220b4702f128641ef78a874" and "6884482e789ed1a436de35eb4143ff30420211ab" have entirely different histories.

3 changed files with 7 additions and 48 deletions

7
app.py
View File

@ -41,7 +41,7 @@ def index():
# habits = [("lesen", "eine Seite vor dem schlafen gehen"), ("sport", "3x Gym")]
return render_template(
'index.html',
title=f"Hallo {current_user.name}",
title='Hallo ' + current_user.name,
utc_dt=datetime.datetime.now().strftime("%d.%m.%Y %H:%M %A"),
habits=habits,
errors={},
@ -149,6 +149,7 @@ def habit_creation():
title='Erstelle ein Habit',
unit=1,
errors={},
habits=current_user.get_habits()
)
@ -193,7 +194,8 @@ def habit_create():
note=note,
times=times,
unit=unit,
errors=errors
errors=errors,
habits=current_user.get_habits()
)
# Map unit to integer
@ -220,6 +222,7 @@ def habit_create():
times=times,
unit=unit,
errors=errors,
habits=current_user.get_habits()
)

View File

@ -1,36 +0,0 @@
{% extends 'layouts/main.html' %}
{% block content %}
<form>
<div class="mb-3">
<label for="name" class="form-label">Name der Gewohnheit</label>
<input type="text" class="form-control" id="name" name="name">
</div>
<div class="mb-3">
<label for="note" class="form-label">Beschreibung</label>
<input type="text" class="form-control" id="note" name="note">
</div>
<div class="row">
<div class="mb-3 col-2">
<label for="times" class="form-label">Häufigkeit</label>
<input type="number" min="1" class="form-control" id="times" name="times">
</div>
<div class="mb-3 col-10">
<label for="note" class="form-label">Im Zeitraum</label>
<select class="form-select" id="unit" name="unit">
<option selected value="Woche">Woche</option>
<option value="Tag">Tag</option>
<option value="Monat">Monat</option>
<option value="Jahr">Jahr</option>
</select>
</div>
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
{% endblock %}

View File

@ -1,7 +1,7 @@
{% extends 'layouts/main.html' %}
{% block content %}
<h1>{{ title }}</h1>
<h1>Hello World!</h1>
<h3>{{ utc_dt }}</h3>
@ -30,17 +30,9 @@
</script>
<div class="row">
<h2 class="col-10">Task List</h2>
<a class="col-2 btn btn-primary" role="button" href="/habit">
Task erstellen
</a>
</div>
<h2>Task List</h2>
<ul class="task-list row">
{% for habit in habits %}
<li class="row col-md-4">