Merge remote-tracking branch 'origin/master'
# Conflicts: # templates/index.html
This commit is contained in:
commit
6143f44442
@ -80,6 +80,9 @@ class Habit:
|
|||||||
count = 0
|
count = 0
|
||||||
self.checked = False
|
self.checked = False
|
||||||
for tracking in self.get_habitTrackings():
|
for tracking in self.get_habitTrackings():
|
||||||
|
if tracking.created_at.date() == datetime.today().date():
|
||||||
|
self.checked = True
|
||||||
|
|
||||||
# day
|
# day
|
||||||
if self.unit == 0:
|
if self.unit == 0:
|
||||||
if tracking.created_at.date() == datetime.today().date():
|
if tracking.created_at.date() == datetime.today().date():
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
from flask_login import UserMixin
|
from flask_login import UserMixin
|
||||||
from db.SQLiteClient import create_user, get_user, get_user_by_email, get_habits, delete_user, update_user, \
|
from db.SQLiteClient import create_user, get_user, get_user_by_email, delete_user, update_user, \
|
||||||
get_habitLists
|
get_habitLists, get_heatmap_value
|
||||||
|
|
||||||
|
|
||||||
class User(UserMixin):
|
class User(UserMixin):
|
||||||
@ -43,3 +43,10 @@ class User(UserMixin):
|
|||||||
habitLists.append(habitList)
|
habitLists.append(habitList)
|
||||||
|
|
||||||
return habitLists
|
return habitLists
|
||||||
|
|
||||||
|
def get_heatmap(self):
|
||||||
|
heatmap = []
|
||||||
|
for day in range (0, 27):
|
||||||
|
value = get_heatmap_value(self.id, day)
|
||||||
|
heatmap.append(value)
|
||||||
|
return heatmap
|
||||||
@ -21,14 +21,12 @@
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
<div class="col-md-4 col-12 card bg-light mb-6">
|
<div class="col-md-5 col-12">
|
||||||
<div class="card-body">
|
|
||||||
<h5 class="card-title">Heatmap</h5>
|
|
||||||
<div id="heatmap"></div>
|
<div id="heatmap"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// Funktion zur Rückgabe des Montagsdatums
|
// Funktion zur Rückgabe des Montagsdatums
|
||||||
@ -80,21 +78,20 @@
|
|||||||
// Erstelle die Heatmap mit den simulierten Daten
|
// Erstelle die Heatmap mit den simulierten Daten
|
||||||
createHeatmap(activityData);
|
createHeatmap(activityData);
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<div class="col-md-7 col-12">
|
||||||
<div class="col-md-7 col-12 card gap-3 bg-light p-6 offset-md-1 mb-6">
|
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<h2 class="col-9">Gewohnheiten</h2>
|
<h2 class="col-9">Gewohnheiten</h2>
|
||||||
<a class="col-3 btn btn-primary p" role="button" href="/habit-list">Neue Liste erstellen</a>
|
<a class="col-3 btn btn-primary" role="button" href="/habit-list">Neue Liste erstellen</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% for habit_list in habit_lists %}
|
{% for habit_list in habit_lists %}
|
||||||
|
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<h2 class="col-9">{{ habit_list.name }}</h2>
|
<h2 class="col-9">{{ habit_list.name }}</h2>
|
||||||
<a class="col-3 btn btn-primary" role="button" href="/habit?list={{ habit_list.id }}">Gewohnheit
|
<a class="col-3 btn btn-primary" role="button" href="/habit?list={{ habit_list.id }}">Gewohnheit erstellen</a>
|
||||||
erstellen</a>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ul class="task-list row">
|
<ul class="task-list row">
|
||||||
@ -113,16 +110,12 @@
|
|||||||
{{ habit.name }}
|
{{ habit.name }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-5 text-black text-opacity-50" style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis">
|
<div class="col-6" style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis">
|
||||||
|
|
||||||
{{ habit.note }}
|
{{ habit.note }}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-2" style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis">
|
<div class="col-2" style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis">
|
||||||
{% if habit %}
|
{% if habit %}
|
||||||
|
|
||||||
{% else %}
|
|
||||||
5 🔥
|
5 🔥
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user