Files
2026-07-07 13:16:26 +02:00

224 lines
9.7 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="cs">
<head>
<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">
<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) {
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="/" 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="/" 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>
<span>Zpět na portál</span>
</a>
</div>
</header>
<main class="main">
<!-- ── Setup ──────────────────────────────── -->
<section id="s-setup">
<div class="section-intro">
<h1 class="section-title">Kontrola smluvních podmínek</h1>
<p class="section-desc">
Nahrajte PDF smlouvu, vyberte body ke kontrole a spusťte analýzu.
Výsledkem je shrnutí s odkazy na strany a PDF se zvýrazněnými pasážemi.
</p>
</div>
<!-- 1. Upload first -->
<div id="drop-zone" class="drop-zone">
<svg class="drop-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
<path stroke-linecap="round" stroke-linejoin="round"
d="M12 16.5V4.5m0 0-3.75 3.75M12 4.5l3.75 3.75M4.5 19.5h15"/>
</svg>
<p class="drop-text">Přetáhněte PDF smlouvu sem</p>
<p class="drop-or">nebo</p>
<button class="btn btn-secondary" id="browse-btn" type="button">Vybrat soubor</button>
<p class="drop-formats">Podporovaný formát: .pdf</p>
<input type="file" id="file-input" accept=".pdf" style="display:none">
</div>
<!-- Selected-file row with inline action (shown after pick) -->
<div id="file-info" class="file-info hidden">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/>
<polyline points="14 2 14 8 20 8"/>
</svg>
<div class="file-info-text">
<span class="file-info-name" id="file-info-name"></span>
<span class="file-info-hint" id="run-hint">Vyberte body ke kontrole níže (výchozí jsou předvybrané).</span>
</div>
<button class="btn-link" id="file-info-clear" type="button">Změnit</button>
<button class="btn btn-primary" id="run-btn" type="button" disabled>
Spustit analýzu
</button>
</div>
<!-- Checklist -->
<div class="checklist-panel">
<div class="panel-header">
<h2 class="panel-title">Co kontrolovat</h2>
<div class="panel-actions">
<button class="btn btn-secondary btn-sm" id="check-all-btn" type="button">Vybrat vše</button>
<button class="btn btn-secondary btn-sm" id="uncheck-all-btn" type="button">Zrušit vše</button>
</div>
</div>
<div id="checklist" class="checklist"></div>
<form id="add-item-form" class="add-item-row">
<input type="text" id="add-item-input" class="add-item-input"
placeholder="Vlastní bod ke kontrole (např. „Zákaz vývozu IP" nebo Penále za pozdní dodání")"
autocomplete="off" maxlength="200">
<button type="submit" class="btn btn-secondary">
+ Přidat
</button>
</form>
</div>
</section>
<!-- ── Processing ────────────────────────── -->
<section id="s-processing" class="hidden">
<div class="processing-card">
<div class="spinner"></div>
<h2 class="processing-title" id="processing-title">Analyzuji smlouvu…</h2>
<p class="processing-sub">Toto může trvat 3090 sekund. AI prochází text smlouvy
a porovnává ji s vybranými body.</p>
</div>
</section>
<!-- ── Results ───────────────────────────── -->
<section id="s-results" class="hidden">
<div class="results-header">
<div>
<h2 class="results-title">Výsledek kontroly</h2>
<p class="results-meta" id="results-meta"></p>
</div>
<div class="results-actions">
<button class="btn btn-secondary" id="restart-btn" type="button">Nová kontrola</button>
<button class="btn btn-primary" id="download-pdf-btn" type="button">
<svg class="btn-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v12m0 0-3.75-3.75M12 16.5l3.75-3.75M4.5 19.5h15"/>
</svg>
Stáhnout PDF se zvýrazněním
</button>
</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>
</body>
</html>