Files
eve_structure/webapp/templates/archive.html
2025-08-27 18:55:45 +02:00

176 lines
7.9 KiB
HTML
Raw 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="de">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>EVE Web Helper Archiv</title>
<style>
:root { color-scheme: light dark; }
body{font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;margin:2rem}
.container{max-width:1440px;margin:0 auto}
.nav{display:flex;gap:.6rem;margin-bottom:1rem}
.tab{padding:.5rem .8rem;border:1px solid #e5e7eb;border-radius:.6rem;text-decoration:none;color:#111827}
.tab.active{background:#111827;color:#fff;border-color:#111827}
.card{border:1px solid #e5e7eb;border-radius:.8rem;padding:1rem 1.2rem;margin-bottom:1rem;background:#fff}
.full{width:100%}
.section-title{font-weight:700;margin-bottom:.6rem}
.table-wrap{overflow:auto;border:1px solid #e5e7eb;border-radius:.6rem}
.table-wrap table{width:100%;border-collapse:collapse;margin:0;table-layout:fixed}
th,td{padding:.5rem .45rem;border-bottom:1px solid #e5e7eb;text-align:left;vertical-align:top;word-break:break-word;overflow-wrap:anywhere}
th{font-weight:700}
.id{font-family:ui-monospace,SFMono-Regular,Consolas,Menlo,monospace;font-size:.85em;max-width:90px}
.num{text-align:right}
.empty{padding:.65rem .8rem;border:1px dashed #d1d5db;border-radius:.6rem;color:#6b7280;background:transparent}
/* Modal (nur lesen) */
.modal{position:fixed;inset:0;display:none;align-items:flex-start;justify-content:center;padding:4vh 1rem;background:rgba(0,0,0,.45);z-index:999}
.modal:target{display:flex}
.dialog{max-width:1100px;width:min(92vw,1100px);background:#fff;border-radius:14px;padding:1rem 1.2rem;box-shadow:0 20px 45px rgba(0,0,0,.35);max-height:92vh;overflow:auto;position:relative}
.close{position:sticky;top:0;float:right;font-size:1.4rem;text-decoration:none;color:#111827;padding:.2rem .5rem;border-radius:.4rem}
.kv{display:grid;grid-template-columns:180px 1fr;gap:.35rem .8rem}
.pill{display:inline-block;background:#111827;color:#fff;border-radius:999px;padding:.2rem .55rem;font-size:.85rem;margin-bottom:.5rem}
.result{border:1px solid #e5e7eb;border-radius:.6rem;padding:.7rem .8rem;background:#fafafa;margin-top:.6rem}
@media (prefers-color-scheme:dark){
body{background:#0b0f19;color:#e5e7eb}
.tab{border-color:#374151;color:#e5e7eb}
.tab.active{background:#1f2937;border-color:#374151}
.card,.dialog{background:#0f1423;border-color:#374151}
th,td{border-bottom-color:#374151}
.table-wrap{border-color:#374151}
.result{background:#111318;border-color:#374151}
.close{color:#e5e7eb}
}
</style>
</head>
<body>
<div class="container">
<nav class="nav">
<a class="tab" href="/">Home</a>
<a class="tab" href="/strukturen">Strukturen</a>
<a class="tab active" href="/archiv">Archiv</a>
</nav>
<section class="card full">
<div class="section-title">Archivierte / fertige Aufträge</div>
{% if archived_orders %}
<div class="table-wrap">
<table aria-label="Archivierte Aufträge">
<thead>
<tr>
<th>ID</th>
<th>Struktur</th>
<th>System</th>
<th>Ind.-Struktur</th>
<th>Ind.-Rig</th>
<th>Reakt.-Struktur</th>
<th>Reakt.-Rig</th>
<th class="num">Menge</th>
<th class="num">ME&nbsp;%</th>
<th>Erstellt</th>
<th>Fertig/Archiv</th>
<th>Aktionen</th>
</tr>
</thead>
<tbody>
{% for o in archived_orders %}
<tr>
<td class="id">{{ o.id[:8] }}…</td>
<td>{{ o.structure }}</td>
<td>{{ o.system|default('Jita') }}</td>
<td>{{ o.industry_structure|default('Station') }}</td>
<td>{{ o.industry_rig|default('None') }}</td>
<td>{{ o.reaction_structure|default('Athanor') }}</td>
<td>{{ o.reaction_rig|default('None') }}</td>
<td class="num">{{ o.quantity }}</td>
<td class="num">{{ o.me }}</td>
<td>{{ o.created_at|fmt_ts }}</td>
<td>{{ (o.archived_at or o.done_at)|fmt_ts }}</td>
<td><a class="tab" style="padding:.35rem .6rem" href="#m-{{ o.id }}">Details</a></td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<div class="empty">Keine archivierten Aufträge vorhanden.</div>
{% endif %}
</section>
<!-- Readonly-Details pro Auftrag -->
{% for o in archived_orders %}
<div id="m-{{ o.id }}" class="modal" aria-hidden="true">
<div class="dialog" role="dialog" aria-modal="true" aria-labelledby="h-{{ o.id }}">
<a class="close" href="#" aria-label="Schließen">×</a>
<h2 id="h-{{ o.id }}">Auftrag {{ o.structure }}</h2>
<div class="kv">
<div><strong>ID</strong></div><div class="id">{{ o.id }}</div>
<div><strong>Status</strong></div><div>{{ o.status }}</div>
<div><strong>Struktur</strong></div><div>{{ o.structure }}</div>
<div><strong>System</strong></div><div>{{ o.system|default('Jita') }}</div>
<div><strong>Industrie-Struktur</strong></div><div>{{ o.industry_structure|default('Station') }}</div>
<div><strong>Industrie-Rig</strong></div><div>{{ o.industry_rig|default('None') }}</div>
<div><strong>Reaktions-Struktur</strong></div><div>{{ o.reaction_structure|default('Athanor') }}</div>
<div><strong>Reaktions-Rig</strong></div><div>{{ o.reaction_rig|default('None') }}</div>
<div><strong>Menge</strong></div><div>{{ o.quantity }}</div>
<div><strong>ME&nbsp;%</strong></div><div>{{ o.me }}</div>
<div><strong>Notizen</strong></div><div>{{ o.notes|default('') }}</div>
<div><strong>Erstellt</strong></div><div>{{ o.created_at|fmt_ts }}</div>
<div><strong>Fertig/Archiv</strong></div><div>{{ (o.archived_at or o.done_at)|fmt_ts }}</div>
<div><strong>Blueprint&nbsp;ID</strong></div><div>{{ o.blueprint_type_id or '—' }}</div>
</div>
{% set cb = o.cookbook and (o.cookbook.message or o.cookbook) %}
{% if cb %}
<div class="pill">Gesamtkosten:
{{ (cb.totalCost or cb.total or cb.buildCostPerUnit) | default('—') }}
</div>
<div class="result">
<details>
<summary>CookbookRohdaten</summary>
<pre style="white-space:pre-wrap">{{ o.cookbook | tojson(indent=2) }}</pre>
</details>
</div>
{% endif %}
{% if o.materials %}
<div class="result">
<h4 style="margin:.2rem 0 .5rem">Materialien</h4>
<table style="width:100%;border-collapse:collapse">
<thead><tr><th>Item</th><th class="num">Menge</th><th class="num">Kosten</th></tr></thead>
<tbody>
{% set mats = o.materials.materials or o.materials.message and o.materials.message.materials or [] %}
{% for m in mats %}
{% set tid = m.type_id or m.typeId %}
{% set name = m.name or ('Type ' ~ tid) %}
{% set qty = m.quantity or m.qty or m.amount or m.count %}
{% set cost = m.cost or m.cost_per_unit or m.unit_cost %}
<tr>
<td>{{ name }} {% if tid %}<span class="id">({{ tid }})</span>{% endif %}</td>
<td class="num">{{ qty }}</td>
<td class="num">{% if cost is not none %}<strong>{{ cost }}</strong>{% endif %}</td>
</tr>
{% endfor %}
</tbody>
</table>
<details style="margin-top:.4rem">
<summary>MaterialRohdaten</summary>
<pre style="white-space:pre-wrap">{{ o.materials | tojson(indent=2) }}</pre>
</details>
</div>
{% endif %}
<div style="margin-top:.8rem"><a class="tab" href="#" style="padding:.4rem .7rem">Schließen</a></div>
</div>
</div>
{% endfor %}
</div>
</body>
</html>