Renamed template and created page for habit creation in controller
This commit is contained in:
parent
729d11f1c9
commit
8463c01133
18
app.py
18
app.py
@ -141,6 +141,18 @@ def logout():
|
|||||||
return redirect(url_for('index'))
|
return redirect(url_for('index'))
|
||||||
|
|
||||||
|
|
||||||
|
@app.route('/habit')
|
||||||
|
@login_required
|
||||||
|
def habit_creation():
|
||||||
|
return render_template(
|
||||||
|
'habit.html',
|
||||||
|
title='Erstelle ein Habit',
|
||||||
|
unit=1,
|
||||||
|
errors={},
|
||||||
|
habits=current_user.get_habits()
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@app.route('/habit', methods=['POST'])
|
@app.route('/habit', methods=['POST'])
|
||||||
@login_required
|
@login_required
|
||||||
def habit_create():
|
def habit_create():
|
||||||
@ -168,7 +180,8 @@ def habit_create():
|
|||||||
|
|
||||||
if errors:
|
if errors:
|
||||||
return render_template(
|
return render_template(
|
||||||
'index.html',
|
'habit.html',
|
||||||
|
title='Erstelle ein Habit',
|
||||||
name=name,
|
name=name,
|
||||||
note=note,
|
note=note,
|
||||||
times=times,
|
times=times,
|
||||||
@ -194,7 +207,8 @@ def habit_create():
|
|||||||
|
|
||||||
# Back to index
|
# Back to index
|
||||||
return render_template(
|
return render_template(
|
||||||
'index.html',
|
'habit.html',
|
||||||
|
title='Erstelle ein Habit',
|
||||||
name=name,
|
name=name,
|
||||||
note=note,
|
note=note,
|
||||||
times=times,
|
times=times,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user