Gewohnheit erstellen Butten
Seite für das erstellen von einer neuen Gewohnheit fehlermeldungen und die übergabe an das backend müssen noch hinzugefügt werden
This commit is contained in:
parent
8463c01133
commit
873bdc1e86
7
app.py
7
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()
|
||||
)
|
||||
|
||||
|
||||
|
||||
36
templates/habit.html
Normal file
36
templates/habit.html
Normal file
@ -0,0 +1,36 @@
|
||||
{% 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 %}
|
||||
@ -1,7 +1,7 @@
|
||||
{% extends 'layouts/main.html' %}
|
||||
|
||||
{% block content %}
|
||||
<h1>Hello World!</h1>
|
||||
<h1>{{ title }}</h1>
|
||||
<h3>{{ utc_dt }}</h3>
|
||||
|
||||
|
||||
@ -30,9 +30,17 @@
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<h2>Task List</h2>
|
||||
|
||||
|
||||
</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>
|
||||
|
||||
<ul class="task-list row">
|
||||
{% for habit in habits %}
|
||||
<li class="row col-md-4">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user