liste verbessert
This commit is contained in:
parent
0d80cdcf9b
commit
2e1a2bc399
13
app.py
13
app.py
@ -5,7 +5,6 @@ from flask import Flask, render_template, redirect, url_for, request
|
|||||||
from flask_login import login_required, LoginManager, login_user, logout_user, current_user
|
from flask_login import login_required, LoginManager, login_user, logout_user, current_user
|
||||||
|
|
||||||
from models.User import User
|
from models.User import User
|
||||||
from models.Habit import Habit
|
|
||||||
from utils import anonymous_required
|
from utils import anonymous_required
|
||||||
|
|
||||||
# Create a new Flask instance
|
# Create a new Flask instance
|
||||||
@ -32,18 +31,18 @@ def inject_user():
|
|||||||
@app.route('/')
|
@app.route('/')
|
||||||
def index():
|
def index():
|
||||||
# return 'Hello World'
|
# return 'Hello World'
|
||||||
"""
|
|
||||||
if current_user.is_authenticated:
|
if current_user.is_authenticated:
|
||||||
habits = Habit.get_all(current_user.id)
|
habits = current_user.get_habits()
|
||||||
else:
|
else:
|
||||||
habits = []
|
habits = []
|
||||||
"""
|
|
||||||
# habits = [("lesen", "eine Seite vor dem schlafen gehen"), ("sport", "3x Gym")]
|
# habits = [("lesen", "eine Seite vor dem schlafen gehen"), ("sport", "3x Gym")]
|
||||||
return render_template(
|
return render_template(
|
||||||
'index.html',
|
'index.html',
|
||||||
title='Home',
|
title='Hallo ' + current_user.name,
|
||||||
utc_dt=datetime.datetime.now().strftime("%d.%m.%Y %H:%M:%S"),
|
utc_dt=datetime.datetime.now().strftime("%d.%m.%Y %H:%M %A"),
|
||||||
#habits=habits
|
habits=habits
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -35,4 +35,4 @@ class User(UserMixin):
|
|||||||
for habit in raw_habits:
|
for habit in raw_habits:
|
||||||
habit = Habit(habit[0], habit[1], habit[2], habit[3], habit[4], habit[5], habit[6])
|
habit = Habit(habit[0], habit[1], habit[2], habit[3], habit[4], habit[5], habit[6])
|
||||||
habits.append(habit)
|
habits.append(habit)
|
||||||
return habits if habits else None
|
return habits
|
||||||
@ -26,29 +26,32 @@
|
|||||||
|
|
||||||
// Erstelle die Heatmap mit den simulierten Daten
|
// Erstelle die Heatmap mit den simulierten Daten
|
||||||
createHeatmap(activityData);
|
createHeatmap(activityData);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-5">eins</div>
|
|
||||||
<div class="col-md-4">zwei
|
|
||||||
<h2>Task List</h2>
|
<h2>Task List</h2>
|
||||||
<ul class="task-list">
|
<ul class="task-list row">
|
||||||
<li class="task-item">
|
{% for habit in habits %}
|
||||||
|
<li class="row col-md-4">
|
||||||
|
<div class="col-auto">
|
||||||
<input type="checkbox" class="task-checkbox">
|
<input type="checkbox" class="task-checkbox">
|
||||||
<span class="task-text">Task 1</span>
|
</div>
|
||||||
|
|
||||||
|
<div class="col" style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis">
|
||||||
|
{{ habit.name }} hhhbhghbhjndjksbeujsdkfheuwaihgkjfgfjnsidkgjnkdghujds
|
||||||
|
</div>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
<li class="task-item">
|
|
||||||
<input type="checkbox" class="task-checkbox">
|
<div class="col-md-8" style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis">
|
||||||
<span class="task-text">Task 2</span>
|
{{ habit.note }}
|
||||||
</li>
|
</div>
|
||||||
<li class="task-item">
|
|
||||||
<input type="checkbox" class="task-checkbox">
|
{% endfor %}
|
||||||
<span class="task-text">Task 3</span>
|
|
||||||
</li>
|
|
||||||
<!-- Add more tasks as needed -->
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
Loading…
x
Reference in New Issue
Block a user