From d6d441fa699aa8c8874e686b6185c0fddc383e10 Mon Sep 17 00:00:00 2001 From: Martin Tazl Date: Fri, 3 Jul 2026 09:48:01 +0200 Subject: [PATCH] Disclaimer re-added, added several documentation files for Codex --- AGENTS.md | 6 + PROJECT_KNOWLEDGE.md | 26 + README.md | 0 ROADMAP.md | 13 + access_log.json | 35 ++ admin.html | 849 --------------------------------- admin_simple.html | 694 --------------------------- docs/architecture.md | 0 docs/changelog.md | 0 docs/formulars.md | 0 fix_article_data.py | 107 ----- templates/roll_calculator.html | 127 +++++ 12 files changed, 207 insertions(+), 1650 deletions(-) create mode 100644 AGENTS.md create mode 100644 PROJECT_KNOWLEDGE.md create mode 100644 README.md create mode 100644 ROADMAP.md delete mode 100644 admin.html delete mode 100644 admin_simple.html create mode 100644 docs/architecture.md create mode 100644 docs/changelog.md create mode 100644 docs/formulars.md delete mode 100644 fix_article_data.py diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..42c8381 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,6 @@ +- Vor größeren Änderungen immer einen Plan erstellen. +- Keine neuen Python-Pakete ohne Zustimmung. +- Bestehende APIs nicht ohne Rückfrage ändern. +- Python-Code nach PEP8. +- JavaScript möglichst modern (ES6). +- Kommentare sparsam verwenden. diff --git a/PROJECT_KNOWLEDGE.md b/PROJECT_KNOWLEDGE.md new file mode 100644 index 0000000..a3e5b28 --- /dev/null +++ b/PROJECT_KNOWLEDGE.md @@ -0,0 +1,26 @@ +## Rollengeometrie + +Die Berechnungen basieren auf einer ideal zylindrischen Wicklung. + +Annahmen: +- konstante Materialdicke +- keine Kompression +- keine Luftzwischenräume + +Abweichungen: +- Bei Artikeln der Gruppe Secugrid, Combigrid, Carbofol MF/MF, Carbofol F/F, Carbofol s/F, Carbofol BF/s darf die Dicke aus der articel-data.json nicht verwendet werden + +## Artikeldaten + +Die JSON-Datei wird automatisch aus dem ERP erzeugt. + +Felder: +- Artikelnummer +- Dicke +- Flächengewicht +- Standardabweichung +- Kern + +Diese Werte dürfen niemals manuell verändert werden. + + diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/ROADMAP.md b/ROADMAP.md new file mode 100644 index 0000000..2b8adef --- /dev/null +++ b/ROADMAP.md @@ -0,0 +1,13 @@ +## Version 0.3 + +- Mehrsprachigkeit +- Filter der Artikelauswahl auf Basis der gewählten Produktgruppe: Secutex, Carbofol, Bentofix, Secumat, Secudrain +- PDF-Export + + +## Version 0.4 +- Benutzermanagement auf sichere Methode umstellen, keine Klartext Passworte mehr +- Produktionsdaten aus SQL per Query direkt beziehen + +## Version 0.5 +- diff --git a/access_log.json b/access_log.json index 60a7be6..99ee076 100644 --- a/access_log.json +++ b/access_log.json @@ -537,5 +537,40 @@ "endpoint": "/", "method": "GET", "status": 200 + }, + { + "timestamp": "2026-07-02T16:07:56.334163", + "username": "mtazl", + "endpoint": "/", + "method": "GET", + "status": 200 + }, + { + "timestamp": "2026-07-02T16:08:38.097844", + "username": "mtazl", + "endpoint": "/", + "method": "GET", + "status": 200 + }, + { + "timestamp": "2026-07-03T08:39:44.284544", + "username": "mtazl", + "endpoint": "/", + "method": "GET", + "status": 200 + }, + { + "timestamp": "2026-07-03T08:41:57.673023", + "username": "mtazl", + "endpoint": "/", + "method": "GET", + "status": 200 + }, + { + "timestamp": "2026-07-03T08:42:19.877155", + "username": "mtazl", + "endpoint": "/", + "method": "GET", + "status": 200 } ] \ No newline at end of file diff --git a/admin.html b/admin.html deleted file mode 100644 index 7a78b16..0000000 --- a/admin.html +++ /dev/null @@ -1,849 +0,0 @@ - - - - - - Roll Calculator Admin - - - - - -
-
-

🔐 Roll Calculator Admin

-

Geben Sie das Admin-Passwort ein

- - -

Standard: admin123

-
-
- - - - - - - - - - - diff --git a/admin_simple.html b/admin_simple.html deleted file mode 100644 index 92762d0..0000000 --- a/admin_simple.html +++ /dev/null @@ -1,694 +0,0 @@ - - - - - - Roll Calculator Admin - Einfach - - - - - -
-
-

🔐 Roll Calculator Admin

-

Geben Sie das Admin-Passwort ein

- - -

Standard: admin123

-
-
- - - - - - - - diff --git a/docs/architecture.md b/docs/architecture.md new file mode 100644 index 0000000..e69de29 diff --git a/docs/changelog.md b/docs/changelog.md new file mode 100644 index 0000000..e69de29 diff --git a/docs/formulars.md b/docs/formulars.md new file mode 100644 index 0000000..e69de29 diff --git a/fix_article_data.py b/fix_article_data.py deleted file mode 100644 index a36c725..0000000 --- a/fix_article_data.py +++ /dev/null @@ -1,107 +0,0 @@ -#!/usr/bin/env python3 -""" -Automatischer Fix für article-data.json Fetch-URLs in Flask -Ersetzt relative URLs durch /static/ URLs -""" - -import re -import os -from pathlib import Path - -def fix_html_file(html_path): - """Ersetzt die alten Fetch-URLs durch die neuen Flask-URLs""" - - if not os.path.exists(html_path): - print(f"❌ Datei nicht gefunden: {html_path}") - return False - - print(f"📖 Öffne: {html_path}") - - with open(html_path, 'r', encoding='utf-8') as f: - content = f.read() - - original_content = content - changes = [] - - # Fix 1: fetch('article-data.json') → fetch('/static/article-data.json') - if "fetch('article-data.json')" in content or 'fetch("article-data.json")' in content: - content = content.replace("fetch('article-data.json')", "fetch('/static/article-data.json')") - content = content.replace('fetch("article-data.json")', 'fetch("/static/article-data.json")') - changes.append("✓ article-data.json URL aktualisiert") - - # Fix 2: fetch('config.json') → fetch('/static/config.json') - if "fetch('config.json')" in content or 'fetch("config.json")' in content: - content = content.replace("fetch('config.json')", "fetch('/static/config.json')") - content = content.replace('fetch("config.json")', 'fetch("/static/config.json")') - changes.append("✓ config.json URL aktualisiert") - - # Fix 3: register('service-worker.js') → register('/static/service-worker.js') - if "register('service-worker.js')" in content or 'register("service-worker.js")' in content: - content = content.replace("register('service-worker.js')", "register('/static/service-worker.js')") - content = content.replace('register("service-worker.js")', 'register("/static/service-worker.js")') - changes.append("✓ service-worker.js URL aktualisiert") - - if content != original_content: - # Backup erstellen - backup_path = html_path + ".backup" - with open(backup_path, 'w', encoding='utf-8') as f: - f.write(original_content) - print(f"💾 Backup erstellt: {backup_path}") - - # Neue Version speichern - with open(html_path, 'w', encoding='utf-8') as f: - f.write(content) - - print(f"✅ HTML aktualisiert: {html_path}") - for change in changes: - print(f" {change}") - return True - else: - print("⚠️ Keine Änderungen notwendig (URLs sind bereits korrekt)") - return False - -def check_static_files(): - """Prüft ob die benötigten Dateien im static/ Ordner sind""" - print("\n🔍 Prüfe static/ Verzeichnis...") - - files_to_check = ['article-data.json', 'config.json'] - found = [] - missing = [] - - for filename in files_to_check: - path = os.path.join('static', filename) - if os.path.exists(path): - size = os.path.getsize(path) - found.append(f" ✓ {filename} ({size} bytes)") - else: - missing.append(f" ❌ {filename} (NICHT GEFUNDEN)") - - for msg in found: - print(msg) - for msg in missing: - print(msg) - - return len(missing) == 0 - -if __name__ == "__main__": - print("=" * 60) - print("Fix für article-data.json Flask-URLs") - print("=" * 60) - - html_file = "templates/roll_calculator.html" - - success = fix_html_file(html_file) - files_ok = check_static_files() - - print("\n" + "=" * 60) - if success or files_ok: - print("✅ Fix abgeschlossen!") - print("\n📝 Nächste Schritte:") - print(" 1. Browser neuladen (Ctrl+Shift+R)") - print(" 2. Öffne Browser Console (F12)") - print(" 3. Du solltest sehen:") - print(" 'Article data loaded: XXX items'") - print(" 'Config updated from file'") - else: - print("⚠️ Keine Änderungen nötig") - print("=" * 60) diff --git a/templates/roll_calculator.html b/templates/roll_calculator.html index 70b93ba..9bd6ae2 100644 --- a/templates/roll_calculator.html +++ b/templates/roll_calculator.html @@ -60,6 +60,85 @@ .fc-req-nok { color: #dc3545; font-weight: 600; } .formula-box { background: #f8f9fa; border: 1px solid #e0e0e0; border-radius: 6px; padding: 10px 14px; font-size: 12px; color: #666; margin-top: 18px; font-family: 'Courier New', monospace; } .footer { text-align: center; font-size: 11px; color: #aaa; padding: 18px; margin-top: 30px; } + .disclaimer-overlay { + position: fixed; + inset: 0; + z-index: 9999; + display: flex; + align-items: center; + justify-content: center; + padding: 20px; + background: rgba(20, 28, 34, 0.72); + } + .disclaimer-overlay.is-hidden { display: none; } + .disclaimer-dialog { + width: min(760px, 100%); + max-height: min(86vh, 820px); + display: flex; + flex-direction: column; + background: #fff; + border-radius: 8px; + box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28); + overflow: hidden; + } + .disclaimer-header { + padding: 18px 22px; + background: #1F5438; + color: #fff; + } + .disclaimer-header h2 { font-size: 18px; margin: 0; } + .disclaimer-content { + padding: 20px 22px; + overflow-y: auto; + line-height: 1.5; + font-size: 14px; + } + .disclaimer-content h3 { + margin: 0 0 8px; + color: #1F5438; + font-size: 15px; + } + .disclaimer-content p { margin: 0 0 12px; } + .disclaimer-language + .disclaimer-language { + margin-top: 18px; + padding-top: 18px; + border-top: 1px solid #e0e8f0; + } + .disclaimer-actions { + padding: 16px 22px; + border-top: 1px solid #e0e8f0; + background: #f8fafa; + } + .disclaimer-confirm { + display: flex; + align-items: flex-start; + gap: 10px; + margin-bottom: 14px; + font-size: 13px; + color: #333; + } + .disclaimer-confirm input { + width: 18px; + height: 18px; + margin-top: 1px; + flex: 0 0 auto; + } + .disclaimer-btn { + width: 100%; + border: none; + border-radius: 6px; + padding: 11px 18px; + background: #2BAC70; + color: #fff; + font-size: 14px; + font-weight: 700; + cursor: pointer; + } + .disclaimer-btn:hover { background: #1F5438; } + .disclaimer-btn:disabled { + background: #b8c7bf; + cursor: not-allowed; + } /* ============================================ LOAD OPTIMIZER STYLES @@ -336,6 +415,37 @@ + +

Naue Roll Diameter Calculator

Roll Diameter • Product Length • Roll Weight • Load Optimizer

@@ -1301,6 +1411,23 @@ class LoadOptimizerUI { document.addEventListener('DOMContentLoaded', () => { window.loadOptimizerUI = new LoadOptimizerUI(); }); + +document.addEventListener('DOMContentLoaded', () => { + const overlay = document.getElementById('disclaimerOverlay'); + const checkbox = document.getElementById('disclaimerAccepted'); + const confirmBtn = document.getElementById('disclaimerConfirmBtn'); + + if (!overlay || !checkbox || !confirmBtn) return; + + checkbox.addEventListener('change', () => { + confirmBtn.disabled = !checkbox.checked; + }); + + confirmBtn.addEventListener('click', () => { + if (!checkbox.checked) return; + overlay.classList.add('is-hidden'); + }); +});