From 989422a4a74f8ce4d6a06818ca9f2a576231f659 Mon Sep 17 00:00:00 2001 From: Bkolb Date: Fri, 10 Apr 2026 11:59:32 +0200 Subject: [PATCH] Kursfortschrittsanzeige --- app/flask-postgres/app/app.py | 31 +++++++- .../app/templates/admin_courses.html | 40 +++++++---- app/flask-postgres/app/templates/base.html | 17 +++++ .../app/templates/course/A1_page0.html | 45 ++++++++++++ .../app/templates/course/A1_page1.html | 4 +- .../app/templates/course/A1_page2.html | 4 +- .../app/templates/course/A1_page3.html | 4 +- .../app/templates/course/A1_page4.html | 4 +- .../app/templates/course/A1_page5.html | 4 +- .../app/templates/course/A1_page6.html | 2 +- .../app/templates/course/A2_page6.html | 4 +- .../app/templates/course/B1_page4.html | 4 +- .../app/templates/course/B1_page5.html | 4 +- .../app/templates/course/B1_page6.html | 4 +- .../app/templates/course/B1_page7.html | 2 +- app/flask-postgres/styles/site.css | 70 +++++++++++++++++++ 16 files changed, 207 insertions(+), 36 deletions(-) create mode 100644 app/flask-postgres/app/templates/course/A1_page0.html diff --git a/app/flask-postgres/app/app.py b/app/flask-postgres/app/app.py index dbc6505..1f0e1a4 100644 --- a/app/flask-postgres/app/app.py +++ b/app/flask-postgres/app/app.py @@ -1119,9 +1119,20 @@ def course_start(course_id): cur.close() conn.close() + show_course_progress = True + course_progress_title = f"{course['code']} – {course['title']}" + course_progress_current = 1 + course_progress_total = 8 + course_progress_percent = int((course_progress_current / course_progress_total) * 100) + return render_template( "course_video.html", course=course, + show_course_progress=show_course_progress, + course_progress_title=course_progress_title, + course_progress_current=course_progress_current, + course_progress_total=course_progress_total, + course_progress_percent=course_progress_percent, **get_current_user() ) @@ -1142,6 +1153,13 @@ def course_page(course_id, page_number): if not page: abort(404) + cur.execute(""" + SELECT * + FROM course + WHERE id = %s + """, (course_id,)) + course = fetchone_dict(cur) + # Fortschritt speichern cur.execute(""" INSERT INTO user_course_progress (user_id, course_id, last_page) @@ -1155,10 +1173,21 @@ def course_page(course_id, page_number): cur.close() conn.close() + show_course_progress = True + course_progress_title = f"{course['code']} – {course['title']}" + course_progress_current = page_number+1 + course_progress_total = 8 + course_progress_percent = int((course_progress_current / course_progress_total) * 100) + return render_template( page["template_name"], course_id=course_id, page_number=page_number, + show_course_progress=show_course_progress, + course_progress_title=course_progress_title, + course_progress_current=course_progress_current, + course_progress_total=course_progress_total, + course_progress_percent=course_progress_percent, **get_current_user() ) @@ -1591,7 +1620,7 @@ def admin_courses(): cur.execute(""" SELECT id, code, title, description, min_level, video_file, sort_order FROM course - ORDER BY min_level, sort_order, id + ORDER BY code """) courses = fetchall_dict(cur) diff --git a/app/flask-postgres/app/templates/admin_courses.html b/app/flask-postgres/app/templates/admin_courses.html index 89bfe44..1ac34ef 100644 --- a/app/flask-postgres/app/templates/admin_courses.html +++ b/app/flask-postgres/app/templates/admin_courses.html @@ -68,12 +68,12 @@ ID - Code + Code Titel - Level + Level Video - Sort - Aktionen + Sort + Aktionen @@ -81,26 +81,34 @@ {% for c in courses %}
- - - {{ c.id }} - + + + {{ c.id }} + + + - + + - + + + + + + - + + - +
{% endfor %} diff --git a/app/flask-postgres/app/templates/base.html b/app/flask-postgres/app/templates/base.html index 6a30650..b22e8de 100644 --- a/app/flask-postgres/app/templates/base.html +++ b/app/flask-postgres/app/templates/base.html @@ -72,6 +72,23 @@
+ {% if show_course_progress %} +
+ +
+ {{ course_progress_title }} + {{ course_progress_current }} / {{ course_progress_total }} +
+ +
+
+
+
+ +
+ {% endif %} + {% block content %} {% endblock %} diff --git a/app/flask-postgres/app/templates/course/A1_page0.html b/app/flask-postgres/app/templates/course/A1_page0.html new file mode 100644 index 0000000..16543a3 --- /dev/null +++ b/app/flask-postgres/app/templates/course/A1_page0.html @@ -0,0 +1,45 @@ +{% extends "base.html" %} + +{% block content %} + +

AI Governance Basics

+ +
+
+

Willkommen zu Compliance Verification und zum Modul A1 – AI Governance Basics

+ +

+ In diesem Kurs lernen Sie die Grundlagen dafür, wie moderne KI-Systeme funktionieren, +

+ +

+ warum sie so leistungsfähig – aber gleichzeitig fehleranfällig – sind, + in welchen Unternehmensbereichen KI eingesetzt wird, + und welche Mindestregeln für einen sicheren und verantwortungsvollen Umgang gelten. +

+ +

+ Unser Ziel ist nicht, + Sie zu Programmiererinnen oder Technikern zu machen. +

+ +

+ Unser Ziel ist, + dass Sie ein realistisches Grundverständnis entwickeln: +

+ +
    +
  • Was KI kann.
  • +
  • Was KI nicht kann.
  • +
  • Und welche Verantwortung Sie im Alltag tragen.
  • +
+ +
+
+ + + +{% endblock %} \ No newline at end of file diff --git a/app/flask-postgres/app/templates/course/A1_page1.html b/app/flask-postgres/app/templates/course/A1_page1.html index 0acc1df..3f001e5 100644 --- a/app/flask-postgres/app/templates/course/A1_page1.html +++ b/app/flask-postgres/app/templates/course/A1_page1.html @@ -41,8 +41,8 @@
{% endblock %} \ No newline at end of file diff --git a/app/flask-postgres/app/templates/course/A1_page2.html b/app/flask-postgres/app/templates/course/A1_page2.html index 62a6dac..30d9f1b 100644 --- a/app/flask-postgres/app/templates/course/A1_page2.html +++ b/app/flask-postgres/app/templates/course/A1_page2.html @@ -56,8 +56,8 @@ diff --git a/app/flask-postgres/app/templates/course/A1_page3.html b/app/flask-postgres/app/templates/course/A1_page3.html index 16fda1b..708896c 100644 --- a/app/flask-postgres/app/templates/course/A1_page3.html +++ b/app/flask-postgres/app/templates/course/A1_page3.html @@ -75,8 +75,8 @@ {% endblock %} \ No newline at end of file diff --git a/app/flask-postgres/app/templates/course/A1_page4.html b/app/flask-postgres/app/templates/course/A1_page4.html index 2e49725..91fa790 100644 --- a/app/flask-postgres/app/templates/course/A1_page4.html +++ b/app/flask-postgres/app/templates/course/A1_page4.html @@ -42,8 +42,8 @@ {% endblock %} \ No newline at end of file diff --git a/app/flask-postgres/app/templates/course/A1_page5.html b/app/flask-postgres/app/templates/course/A1_page5.html index e6982b0..dfe93da 100644 --- a/app/flask-postgres/app/templates/course/A1_page5.html +++ b/app/flask-postgres/app/templates/course/A1_page5.html @@ -85,8 +85,8 @@ {% endblock %} \ No newline at end of file diff --git a/app/flask-postgres/app/templates/course/A1_page6.html b/app/flask-postgres/app/templates/course/A1_page6.html index ff6d4f9..4f281b1 100644 --- a/app/flask-postgres/app/templates/course/A1_page6.html +++ b/app/flask-postgres/app/templates/course/A1_page6.html @@ -31,7 +31,7 @@ diff --git a/app/flask-postgres/app/templates/course/A2_page6.html b/app/flask-postgres/app/templates/course/A2_page6.html index 4965336..b6f8e95 100644 --- a/app/flask-postgres/app/templates/course/A2_page6.html +++ b/app/flask-postgres/app/templates/course/A2_page6.html @@ -58,8 +58,8 @@ {% endblock %} \ No newline at end of file diff --git a/app/flask-postgres/app/templates/course/B1_page4.html b/app/flask-postgres/app/templates/course/B1_page4.html index 2dff5cf..b9975be 100644 --- a/app/flask-postgres/app/templates/course/B1_page4.html +++ b/app/flask-postgres/app/templates/course/B1_page4.html @@ -50,8 +50,8 @@ {% endblock %} \ No newline at end of file diff --git a/app/flask-postgres/app/templates/course/B1_page5.html b/app/flask-postgres/app/templates/course/B1_page5.html index d1c80d7..c84a23a 100644 --- a/app/flask-postgres/app/templates/course/B1_page5.html +++ b/app/flask-postgres/app/templates/course/B1_page5.html @@ -52,8 +52,8 @@ {% endblock %} \ No newline at end of file diff --git a/app/flask-postgres/app/templates/course/B1_page6.html b/app/flask-postgres/app/templates/course/B1_page6.html index 202671f..fd96228 100644 --- a/app/flask-postgres/app/templates/course/B1_page6.html +++ b/app/flask-postgres/app/templates/course/B1_page6.html @@ -54,8 +54,8 @@ {% endblock %} \ No newline at end of file diff --git a/app/flask-postgres/app/templates/course/B1_page7.html b/app/flask-postgres/app/templates/course/B1_page7.html index 97b4788..e8ef5bb 100644 --- a/app/flask-postgres/app/templates/course/B1_page7.html +++ b/app/flask-postgres/app/templates/course/B1_page7.html @@ -31,7 +31,7 @@ diff --git a/app/flask-postgres/styles/site.css b/app/flask-postgres/styles/site.css index f9ded5b..90e4e5f 100644 --- a/app/flask-postgres/styles/site.css +++ b/app/flask-postgres/styles/site.css @@ -1020,4 +1020,74 @@ button { .highlight-quote { font-size: 16px; } +} + +.mandanten-table textarea { + width: 100%; + min-height: 70px; + padding: 10px 12px; + border: 1px solid #cfd8e3; + border-radius: 10px; + font-size: 14px; + box-sizing: border-box; + resize: vertical; + font-family: Arial, Helvetica, sans-serif; +} + +/* =============================== + Kursverwaltung Tabelle + =============================== */ + +.input-small { + width: 60px; + padding: 6px 8px; +} + +.input-full { + width: 100%; + margin-bottom: 6px; +} + +.textarea-inline { + width: 100%; + min-height: 60px; + padding: 8px 10px; + border: 1px solid #cfd8e3; + border-radius: 8px; + font-size: 14px; + resize: vertical; + box-sizing: border-box; +} + +/* =============================== + Kursfortschritt (grün/grau) + =============================== */ + +.course-progress-box { + margin-bottom: 24px; +} + +.course-progress-header { + display: flex; + justify-content: space-between; + font-size: 14px; + margin-bottom: 6px; + color: #334155; +} + +/* Hintergrund = grau */ +.course-progress-bar { + width: 100%; + height: 12px; + background: #e5e7eb; /* grau */ + border-radius: 8px; + overflow: hidden; +} + +/* Fortschritt = grün */ +.course-progress-fill { + height: 100%; + background: #22c55e; /* grün */ + border-radius: 8px; + transition: width 0.3s ease; } \ No newline at end of file