edit page
This commit is contained in:
parent
e20defa4e1
commit
7771c1eea2
23
app.py
23
app.py
@ -300,6 +300,29 @@ def profile_change():
|
||||
)
|
||||
|
||||
|
||||
@app.route('/edit-habit')
|
||||
@login_required
|
||||
def edit_habit():
|
||||
habit_id = request.args.get("habit")
|
||||
#habit_id = request.get_json()["editHabitId"]
|
||||
|
||||
habit = Habit.get(habit_id)
|
||||
return render_template(
|
||||
"edit-habit.html",
|
||||
title=habit.name
|
||||
)
|
||||
'''
|
||||
@app.route('/edit-habit', methods=['POST'])
|
||||
@login_required
|
||||
def edit_habit_change():
|
||||
#habit_id = request.get_json()["habitId"]
|
||||
|
||||
#habit = Habit.get(habit_id)
|
||||
|
||||
return render_template(
|
||||
"edit-habit.html"
|
||||
)
|
||||
'''
|
||||
@app.route('/check_password', methods=['POST'])
|
||||
@login_required
|
||||
def check_password():
|
||||
|
||||
@ -125,7 +125,6 @@
|
||||
{% if not habit.streak == 0 %}
|
||||
{{ habit.streak }} 🔥
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Knopf für das Löschen einer Gewohnheit -->
|
||||
@ -135,13 +134,12 @@
|
||||
<i class="bi bi-trash3"></i>
|
||||
</button>
|
||||
|
||||
<!-- Knopf für die Einstellungen einer Gewohnheit -->
|
||||
<button type="button" class="btn"
|
||||
<!-- -->
|
||||
<a type="button" class="btn" href="{{ url_for('edit_habit') }}?habit={{ habit.id }}" aria-current="page"
|
||||
style="width: 40px; height: 40px; min-height: 3em;">
|
||||
|
||||
<i class="bi bi-gear"></i>
|
||||
|
||||
</button>
|
||||
<i class="bi bi-pencil"></i>
|
||||
</a>
|
||||
|
||||
<!-- Progressbar -->
|
||||
<div class="col-12">
|
||||
|
||||
@ -49,6 +49,14 @@
|
||||
});
|
||||
}
|
||||
|
||||
function sendHabitId(Id) {
|
||||
|
||||
var habitId = document.getElementById(Id);
|
||||
|
||||
// Make a POST request to /check with the habit id
|
||||
// axios.post('/edit-habit', {editHabitId: habitId})
|
||||
}
|
||||
|
||||
function deleteHabit(habitId) {
|
||||
// Make a POST request to /delete with the habit id
|
||||
|
||||
|
||||
7
templates/edit-habit.html
Normal file
7
templates/edit-habit.html
Normal file
@ -0,0 +1,7 @@
|
||||
{% extends 'index.html' %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
test
|
||||
{{ title }}
|
||||
{% endblock %}
|
||||
@ -6,7 +6,7 @@
|
||||
<h1 class="mb-4">Account Einstellungen👤</h1>
|
||||
|
||||
<!-- Account information fields -->
|
||||
<div class="card mb-4">
|
||||
<div class="card bg-light mb-4">
|
||||
<div class="card-body d-flex">
|
||||
<div>
|
||||
<h5 class="card-title">Profilbild</h5>
|
||||
@ -35,7 +35,7 @@
|
||||
</div>
|
||||
|
||||
<!-- Password change fields -->
|
||||
<div class="card mb-4">
|
||||
<div class="card bg-light mb-4">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Passwort ändern</h5>
|
||||
<form id="editPasswordForm" action="/password" method="POST">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user