summaryrefslogtreecommitdiffstats
path: root/templates/base.html
diff options
context:
space:
mode:
authoraur-build <aur-build@localhost>2026-11-18 08:06:39 +0000
committeraur-build <aur-build@localhost>2026-11-18 08:06:39 +0000
commita6b652985f40cf022d6c522415c36fad13bc663d (patch)
tree2383d83a820803808202084db1aa30b12f0e02c2 /templates/base.html
parentab8d33d5edc4c88075685206e3046c719e9bc855 (diff)
downloadaur-build-a6b652985f40cf022d6c522415c36fad13bc663d.tar.gz
aur-build-a6b652985f40cf022d6c522415c36fad13bc663d.zip
http: the review surface — server-rendered, no JavaScript required (§12, §13)
tiny_http, thread-per-connection, askama templates. Every §13 surface is server-rendered HTML that works with scripts switched off: Inbox, review detail with the full panel set, Builds, Attention, Index, Subscriptions, Ops/audit, Settings. The parts that are easy to get wrong: - Handlers read through thread-local READ-ONLY connections. They cannot take the write lock even by accident, so a slow page render never blocks the build pipeline's writer. tests/http.rs asserts this by trying to write through a read connection and requiring failure. - Every POST requires a CSRF token derived from the session id. Logout drops the session, which invalidates every form still open in a browser. - Approve carries identity_hash AND diff_digest (§7.1a). If either has moved, the approval is refused with 409 and the page re-renders the review AS IT IS NOW — never a silent retarget onto the newer state. - Bulk approve refuses high-risk items unless each one is individually confirmed by id. Bulk is per-item, never 'approve everything forever'. - Reject requires a note; it is re-openable, not a deletion. - Optional password gate; anonymous visitors are redirected to /login. Also: the index page states the pacman conf snippet including 'SigLevel = Required DatabaseOptional', because a repo consumers ignore the signature is a repo that gets MITM'd.
Diffstat (limited to 'templates/base.html')
-rw-r--r--templates/base.html52
1 files changed, 52 insertions, 0 deletions
diff --git a/templates/base.html b/templates/base.html
new file mode 100644
index 0000000..d36f9cc
--- /dev/null
+++ b/templates/base.html
@@ -0,0 +1,52 @@
+<!doctype html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width, initial-scale=1">
+<meta name="csrf" content="{{ page.csrf }}">
+<title>{{ page.title }} · aur-build</title>
+<style>
+:root { --bg:#fbfbfa; --fg:#1b1b1a; --mut:#6b6b66; --line:#e2e1dc; --card:#fff; --hi:#b3261e; --ok:#1f6b3a; --warn:#8a5b00; }
+* { box-sizing:border-box }
+body { margin:0; font:15px/1.5 ui-sans-serif, system-ui, sans-serif; background:var(--bg); color:var(--fg); }
+header { border-bottom:1px solid var(--line); background:var(--card); }
+nav { display:flex; gap:1.2rem; padding:.7rem 1.2rem; align-items:center; flex-wrap:wrap; max-width:1100px; margin:0 auto; }
+nav a { color:var(--mut); text-decoration:none; }
+nav a.on, nav a:hover { color:var(--fg); border-bottom:2px solid var(--fg); }
+.brand { font-weight:650; color:var(--fg) !important; }
+main { max-width:1100px; margin:0 auto; padding:1.2rem; }
+table { border-collapse:collapse; width:100%; background:var(--card); }
+th, td { text-align:left; padding:.45rem .6rem; border-bottom:1px solid var(--line); vertical-align:top; }
+th { font:inherit; font-weight:600; color:var(--mut); }
+.badge { background:var(--hi); color:#fff; border-radius:9px; padding:0 .4rem; font-size:.8em; }
+.risk-high { color:var(--hi); font-weight:600 } .risk-medium { color:var(--warn) } .risk-low { color:var(--mut) }
+pre { background:#f4f4f1; border:1px solid var(--line); padding:.6rem; overflow-x:auto; font-size:12.5px; }
+.card { background:var(--card); border:1px solid var(--line); padding:.9rem; margin-bottom:1rem; }
+.card.first { border-left:3px solid var(--hi); }
+.flash { background:#fff4e5; border:1px solid #f0d9b5; padding:.6rem .8rem; }
+.flash.err { background:#fdecea; border-color:#f5c6c2; }
+.mut { color:var(--mut) } .ok { color:var(--ok) }
+form.inline { display:inline }
+button { font:inherit; padding:.2rem .6rem; }
+h1 { font-size:1.3rem } h2 { font-size:1.05rem; margin:1.4rem 0 .4rem }
+.tag { border:1px solid var(--line); border-radius:3px; padding:0 .3rem; font-size:.85em; background:#f4f4f1 }
+</style>
+</head>
+<body>
+<header><nav>
+<a class="brand" href="/">aur-build</a>
+<a href="/reviews" class="{{ page.nav_reviews }}">Reviews{% if page.pending > 0 %} <span class="badge">{{ page.pending }}</span>{% endif %}</a>
+<a href="/builds" class="{{ page.nav_builds }}">Builds{% if page.running > 0 %} <span class="badge">{{ page.running }}</span>{% endif %}</a>
+<a href="/attention" class="{{ page.nav_attention }}">Attention{% if page.attention > 0 %} <span class="badge">{{ page.attention }}</span>{% endif %}</a>
+<a href="/packages" class="{{ page.nav_packages }}">Index</a>
+<a href="/subscriptions" class="{{ page.nav_subscriptions }}">Subscriptions</a>
+<a href="/audit" class="{{ page.nav_audit }}">Ops</a>
+<a href="/settings" class="{{ page.nav_settings }}">Settings</a>
+{% if page.gated %}<form method="post" action="/logout" class="inline"><input type="hidden" name="csrf" value="{{ page.csrf }}"><button type="submit">Sign out</button></form>{% endif %}
+</nav></header>
+<main>
+{% if page.has_flash %}<div class="flash{% if page.flash_err %} err{% endif %}">{{ page.flash }}</div>{% endif %}
+{% block content %}{% endblock %}
+</main>
+</body>
+</html>