wip: local portal changes (backup before disk cleanup)

This commit is contained in:
Ondřej Glaser
2026-07-07 13:16:26 +02:00
parent 48cef99257
commit 79b17be817
774 changed files with 8592 additions and 245 deletions

View File

@@ -4,40 +4,77 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Kontrola smluvních podmínek | Colsys AI</title>
<base href="/apps/smlouvy/">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&display=swap">
<link rel="stylesheet" href="/static/styles.css">
<link rel="stylesheet" href="/static/extra.css">
<link rel="stylesheet" href="static/styles.css">
<link rel="stylesheet" href="static/extra.css">
<script>
// Theme bootstrap — read source-of-truth in this order:
// ?theme= URL → portal_theme cookie → app_theme localStorage → OS
// The cookie is set by the portal landing on every resolvedTheme change,
// so it always reflects the portal's current state.
(function () {
var t = null;
try {
var p = new URL(window.location.href).searchParams.get("theme");
if (p === "dark" || p === "light") t = p;
} catch (e) {}
if (!t) { try { t = localStorage.getItem("app_theme"); } catch (e) {} }
if (!t) {
var m = document.cookie.match(/(?:^|;\s*)portal_theme=([^;]+)/);
if (m) t = decodeURIComponent(m[1]);
}
if (!t) { try { t = localStorage.getItem("app_theme"); } catch (e) {} }
if (!t && typeof matchMedia !== "undefined") {
try {
t = matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
} catch (e) {}
}
if (t === "dark" || t === "light") {
document.documentElement.classList.add(t);
try { localStorage.setItem("app_theme", t); } catch (e) {}
}
})();
// bfcache rehydration — re-sync the class when the page is restored
// (e.g. user toggled theme on the portal, then hit Back).
// Same as pageshow, but fires when the user switches tabs.
// Covers: portal tab toggles theme → user comes back to app tab.
document.addEventListener("visibilitychange", function () {
if (document.visibilityState !== "visible") return;
var m = document.cookie.match(/(?:^|;\s*)portal_theme=([^;]+)/);
if (!m) return;
var t = decodeURIComponent(m[1]);
if (t !== "dark" && t !== "light") return;
var cls = document.documentElement.classList;
if (cls.contains(t)) return;
cls.remove(t === "dark" ? "light" : "dark");
cls.add(t);
try { localStorage.setItem("app_theme", t); } catch (e) {}
});
window.addEventListener("pageshow", function () {
var m = document.cookie.match(/(?:^|;\s*)portal_theme=([^;]+)/);
if (!m) return;
var t = decodeURIComponent(m[1]);
if (t !== "dark" && t !== "light") return;
var cls = document.documentElement.classList;
if (cls.contains(t)) return;
cls.remove(t === "dark" ? "light" : "dark");
cls.add(t);
try { localStorage.setItem("app_theme", t); } catch (e) {}
});
</script>
</head>
<body>
<header class="header">
<div class="header-inner">
<a href="https://ai.klas.chat" class="brand">
<a href="/" class="brand">
<span class="brand-icon">C</span>
<span class="brand-name">Colsys <span class="brand-ai">AI</span></span>
</a>
<span class="header-crumb">Kontrola smluvních podmínek</span>
<a href="https://ai.klas.chat" class="back-link" title="Zpět na portál">
<a href="/" class="back-link" title="Zpět na portál">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<path d="m15 18-6-6 6-6"/>
</svg>
@@ -136,13 +173,51 @@
</div>
</div>
<p class="download-gate-note hidden" id="download-gate-note"></p>
<div class="overall-card" id="overall-card"></div>
<div class="supplier-card" id="supplier-card"></div>
<div class="findings" id="findings"></div>
<div class="chat-card" id="chat-card">
<div class="chat-head">
<span class="chat-title">Dotazy ke smlouvě</span>
<span class="chat-sub">Zeptejte se na cokoliv ze smlouvy — odpovídá z jejího textu.</span>
</div>
<div class="chat-log" id="chat-log" aria-live="polite"></div>
<form class="chat-form" id="chat-form" autocomplete="off">
<textarea id="chat-input" class="chat-input" rows="1"
placeholder="Např. Jaká je výpovědní lhůta? Kdo platí dopravu?"
aria-label="Dotaz ke smlouvě"></textarea>
<button type="submit" class="chat-send" id="chat-send" aria-label="Odeslat">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<path d="m22 2-7 20-4-9-9-4Z"/><path d="M22 2 11 13"/>
</svg>
</button>
</form>
<p class="chat-hint">Enter odeslat · Shift+Enter nový řádek</p>
</div>
</section>
<!-- Export options modal -->
<div class="modal-overlay hidden" id="export-modal">
<div class="modal-box">
<h3 class="modal-title">Co zahrnout do PDF?</h3>
<p class="modal-sub">Ověření protistrany a nálezy kontroly jsou součástí vždy.</p>
<label class="modal-check"><input type="checkbox" id="inc-advice" checked> Návrhy úprav (vygenerované)</label>
<label class="modal-check"><input type="checkbox" id="inc-chat"> Dotazy ke smlouvě (konverzace)</label>
<div class="modal-actions">
<button class="btn btn-secondary" id="export-cancel" type="button">Zrušit</button>
<button class="btn btn-primary" id="export-go" type="button">Stáhnout PDF</button>
</div>
</div>
</div>
</main>
<script src="/static/app.js"></script>
<script src="static/app.js"></script>
</body>
</html>