Implement WP-0009-T04: Control Plane interactive UI on whynot-design
Builds the Control Plane's browser UI (login, dashboard, Phase
registration, Development Credit entry/proposal/review, credential
admin, audit log) as a FastAPI + Jinja2 app over the already-finished
T03 backend, rather than from scratch — whynot-design's Lit web
components are vendored as static assets (source commit 4b62cffc,
v0.4.1), with lit itself resolved via an esm.sh CDN import map.
Session auth re-checks the credential token against the database on
every request rather than trusting the session cookie's cached rights,
so a mid-session revocation takes effect immediately.
9 new Docker-gated HTTP-level tests via FastAPI's TestClient (no
browser-automation tool available, so real rendering of the <wn-*>
components was never visually verified). All four WP-0009 tasks are
now done; workplan marked finished.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-30 15:43:16 +02:00
|
|
|
<!doctype html>
|
|
|
|
|
<html lang="en">
|
|
|
|
|
<head>
|
|
|
|
|
<meta charset="utf-8">
|
|
|
|
|
<title>{% block title %}Target Revenue Control Plane{% endblock %}</title>
|
|
|
|
|
<link rel="stylesheet" href="/static/whynot-design/styles/colors_and_type.css">
|
|
|
|
|
<link rel="stylesheet" href="/static/whynot-design/styles/components.css">
|
|
|
|
|
<script type="importmap">
|
|
|
|
|
{
|
|
|
|
|
"imports": {
|
|
|
|
|
"lit": "https://esm.sh/lit@3.3.3"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
<script type="module" src="/static/whynot-design/index.js"></script>
|
|
|
|
|
<style>
|
|
|
|
|
body { max-width: 960px; margin: 0 auto; padding: 1.5rem; }
|
|
|
|
|
form.wn-form { display: flex; flex-direction: column; gap: 0.75rem; max-width: 480px; }
|
|
|
|
|
.wn-flash { margin: 1rem 0; }
|
|
|
|
|
table.wn-plain { width: 100%; border-collapse: collapse; }
|
|
|
|
|
table.wn-plain th, table.wn-plain td { text-align: left; padding: 0.4rem 0.6rem; border-bottom: 1px solid #ddd; }
|
|
|
|
|
</style>
|
|
|
|
|
</head>
|
|
|
|
|
<body>
|
|
|
|
|
<wn-top-nav>
|
|
|
|
|
<span slot="brand">Target Revenue Control Plane</span>
|
|
|
|
|
</wn-top-nav>
|
|
|
|
|
|
|
|
|
|
{% if session_credential_label %}
|
|
|
|
|
<p>
|
|
|
|
|
Signed in as <strong>{{ session_credential_label }}</strong>
|
|
|
|
|
({{ session_rights }}) for <strong>{{ session_licensor_id }}</strong>
|
|
|
|
|
· <a href="/">Dashboard</a>
|
|
|
|
|
{% if session_rights in ("operator", "admin") %}· <a href="/proposals">Proposals</a>{% endif %}
|
|
|
|
|
{% if session_rights == "admin" %}· <a href="/admin/credentials">Credentials</a>{% endif %}
|
|
|
|
|
· <a href="/audit">Audit log</a>
|
|
|
|
|
· <form method="post" action="/logout" style="display:inline"><button type="submit">Sign out</button></form>
|
|
|
|
|
</p>
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
|
{% if flash %}
|
|
|
|
|
<wn-banner class="wn-flash" variant="{{ flash_variant | default('info') }}">{{ flash }}</wn-banner>
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
|
{% block content %}{% endblock %}
|
|
|
|
|
|
|
|
|
|
<p style="margin-top:3rem;color:#888;font-size:0.85rem;">
|
|
|
|
|
This is a dry-run/pilot tool. No real Phase is authorized to go live via
|
|
|
|
|
this interface — see <code>workplans/TREV-WP-0008-governance-and-pilot-rollout.md</code> T05.
|
|
|
|
|
Visual language vendored from <code>whynot-design</code> — see
|
|
|
|
|
<code>static/whynot-design/VENDORED.md</code>.
|
|
|
|
|
</p>
|
2026-07-30 16:46:31 +02:00
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
// whynot-design's wn-input/wn-select/wn-textarea/wn-button are plain Lit
|
|
|
|
|
// components, not form-associated custom elements — their real <input>/
|
|
|
|
|
// <select>/<button> live inside shadow DOM, invisible to an ancestor
|
|
|
|
|
// <form>. Without this, clicking a wn-button[type=submit] does nothing,
|
|
|
|
|
// and even if it did, none of the field values would be part of the POST.
|
|
|
|
|
// This bridges both gaps generically, for every .wn-form on every page,
|
|
|
|
|
// without touching the vendored library itself.
|
|
|
|
|
(function () {
|
|
|
|
|
function readValue(el) {
|
|
|
|
|
var native = el.shadowRoot && el.shadowRoot.querySelector("input, select, textarea");
|
|
|
|
|
return native ? native.value : (el.value != null ? el.value : "");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
document.querySelectorAll("form").forEach(function (form) {
|
|
|
|
|
form.addEventListener("submit", function () {
|
|
|
|
|
form.querySelectorAll("[name]").forEach(function (el) {
|
|
|
|
|
if (!el.tagName || el.tagName.indexOf("WN-") !== 0) return;
|
|
|
|
|
var name = el.getAttribute("name");
|
|
|
|
|
if (!name) return;
|
|
|
|
|
var hidden = form.querySelector('input[type="hidden"][data-wn-mirror-for="' + name + '"]');
|
|
|
|
|
if (!hidden) {
|
|
|
|
|
hidden = document.createElement("input");
|
|
|
|
|
hidden.type = "hidden";
|
|
|
|
|
hidden.name = name;
|
|
|
|
|
hidden.dataset.wnMirrorFor = name;
|
|
|
|
|
form.appendChild(hidden);
|
|
|
|
|
}
|
|
|
|
|
hidden.value = readValue(el);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
form.querySelectorAll("wn-button[type=submit]").forEach(function (btn) {
|
|
|
|
|
btn.addEventListener("click", function () {
|
|
|
|
|
if (typeof form.requestSubmit === "function") form.requestSubmit();
|
|
|
|
|
else form.submit();
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
})();
|
|
|
|
|
</script>
|
Implement WP-0009-T04: Control Plane interactive UI on whynot-design
Builds the Control Plane's browser UI (login, dashboard, Phase
registration, Development Credit entry/proposal/review, credential
admin, audit log) as a FastAPI + Jinja2 app over the already-finished
T03 backend, rather than from scratch — whynot-design's Lit web
components are vendored as static assets (source commit 4b62cffc,
v0.4.1), with lit itself resolved via an esm.sh CDN import map.
Session auth re-checks the credential token against the database on
every request rather than trusting the session cookie's cached rights,
so a mid-session revocation takes effect immediately.
9 new Docker-gated HTTP-level tests via FastAPI's TestClient (no
browser-automation tool available, so real rendering of the <wn-*>
components was never visually verified). All four WP-0009 tasks are
now done; workplan marked finished.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-30 15:43:16 +02:00
|
|
|
</body>
|
|
|
|
|
</html>
|