From b925683aa42180c33f0b69171477616f77722207 Mon Sep 17 00:00:00 2001 From: nikolaswollenberg Date: Wed, 17 Jan 2024 11:17:35 +0100 Subject: [PATCH] Heatmap tasks udn task abruf --- app.py | 15 +++- static/main.css | 11 +++ templates/index.html | 132 ++++++++++-------------------------- templates/layouts/main.html | 4 +- 4 files changed, 63 insertions(+), 99 deletions(-) diff --git a/app.py b/app.py index 12560ec..3d0639d 100644 --- a/app.py +++ b/app.py @@ -4,6 +4,7 @@ import hashlib from flask import Flask, render_template, redirect, url_for, request from flask_login import login_required, LoginManager, login_user, logout_user, current_user +from models.Habit import Habit from models.User import User from utils import anonymous_required @@ -31,7 +32,19 @@ def inject_user(): @app.route('/') def index(): # return 'Hello World' - return render_template('index.html', title='Home', utc_dt=datetime.datetime.now().strftime("%d.%m.%Y %H:%M:%S")) + """ + if current_user.is_authenticated: + habits = Habit.get_all(current_user.id) + else: + habits = [] + """ + # habits = [("lesen", "eine Seite vor dem schlafen gehen"), ("sport", "3x Gym")] + return render_template( + 'index.html', + title='Home', + utc_dt=datetime.datetime.now().strftime("%d.%m.%Y %H:%M:%S"), + #habits=habits + ) @app.route('/test') diff --git a/static/main.css b/static/main.css index d31d692..b1cc7cd 100644 --- a/static/main.css +++ b/static/main.css @@ -21,4 +21,15 @@ 0%{background-position:0 50%} 50%{background-position:100% 50%} 100%{background-position:0 50%} +} +.day { + width: calc(100% / 7); + height: 20px; + border: 1px solid #ccc; + box-sizing: border-box; +} + +.heatmap { + display: flex; + flex-wrap: wrap; } \ No newline at end of file diff --git a/templates/index.html b/templates/index.html index 6de835d..6bf4b2a 100644 --- a/templates/index.html +++ b/templates/index.html @@ -4,109 +4,51 @@

Hello World!

{{ utc_dt }}

- + +
+ // Simulierte Aktivitätsdaten (ersetze dies durch deine echten Daten) + const activityData = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 5, 4, 3, 2, 1, 9, 5, 36, 75, 8, 9, 1, 0, 23, 0, 0, 0, 64, 0, 0, 64, 0, 0, 19, 84]; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PredictionIntegerPercentageCurrencyFormatted Float
N/A1110200%$10001,000.5
Yellow7771199%$1019,900
Green1000201%$2012,001.1
Red999200%$28902,000.2
- - +
+
eins
+
zwei +

Task List

+
    +
  • + + Task 1 +
  • +
  • + + Task 2 +
  • +
  • + + Task 3 +
  • + +
+
+
+ {% endblock %} \ No newline at end of file diff --git a/templates/layouts/main.html b/templates/layouts/main.html index bc1eb9c..b36d401 100644 --- a/templates/layouts/main.html +++ b/templates/layouts/main.html @@ -9,9 +9,8 @@ - + -
\ No newline at end of file