feat(web): apply firebreak theme doctrine across pages
Make the metaphor structural: a thing gets visual heat only if it increases exposure; contained things stay silent. - Badge diet: private repos render unmarked (an unmarked row is the "contained" statement); only Public/Archived/Empty earn a badge. Public wears the ember "live ember" badge (a public repo is a fire starter); fork/mirror demote to muted mono provenance beside the name. - Containment status grammar in empty/warning states (STATUS · CONTAINED — 0 EXPOSED); firebreak-rule dividers under page headings; remove the settings sidebar (one section doesn't earn a rail) in favor of a single column; reuse .notice-rail for the success notice. - Sweep the ad-hoc text-foreground/NN gray ladder to text-muted-foreground, fixing sub-AA helper text. Includes the landing hero (index.html) legibility pass so hero copy stays cream after the foreground token flipped to charcoal. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
97ded2d287
commit
1883381f3f
4 changed files with 307 additions and 194 deletions
|
|
@ -1,17 +1,15 @@
|
|||
{% extends "base.html" %}
|
||||
{% block title %}Dashboard — Firebreak{% endblock %}
|
||||
{% block content %}
|
||||
<div class="flex flex-col gap-10">
|
||||
<section class="page-header">
|
||||
<div>
|
||||
<p class="text-xs font-semibold uppercase tracking-[0.14em] text-muted-foreground">Dashboard</p>
|
||||
<h1 class="mt-3 text-3xl font-semibold leading-tight text-foreground sm:text-4xl">
|
||||
Welcome, {{ user.display_name or user.email }}.
|
||||
</h1>
|
||||
<p class="mt-2 text-base leading-7 text-foreground/68 sm:text-lg">
|
||||
Private repository snapshots and access boundaries.
|
||||
</p>
|
||||
</div>
|
||||
<div class="flex flex-col gap-6 sm:gap-8">
|
||||
<section>
|
||||
<h1 class="text-2xl font-semibold leading-tight text-foreground sm:text-3xl">
|
||||
Welcome, {{ user.display_name or user.email }}.
|
||||
</h1>
|
||||
<p class="mt-2 text-sm leading-7 text-muted-foreground sm:text-base">
|
||||
Private repository snapshots and access boundaries.
|
||||
</p>
|
||||
<div class="firebreak-rule mt-6" aria-hidden="true"></div>
|
||||
</section>
|
||||
{% if not user.has_pat %}
|
||||
<div class="notice-rail">
|
||||
|
|
@ -19,63 +17,112 @@
|
|||
<p class="mt-1 text-sm leading-6 text-muted-foreground">
|
||||
Register a Forgejo access token to fetch repositories and create share links.
|
||||
</p>
|
||||
<a href="/settings" class="mt-3 btn btn-sm btn-link w-fit">Go to Settings</a>
|
||||
<a href="/settings" class="mt-3 w-fit btn-link">Go to Settings</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if user.has_pat %}
|
||||
<div hx-get="/dashboard/repositories"
|
||||
hx-trigger="load"
|
||||
hx-swap="innerHTML">
|
||||
<section class="table-panel">
|
||||
<div class="flex flex-col gap-1 px-5 py-4 border-b border-border">
|
||||
<h2 class="text-base font-semibold text-foreground">Repositories</h2>
|
||||
{# min-h reserves the swapped-in table's space so content below doesn't jump (CLS) #}
|
||||
<div id="repositories-region" class="min-h-64">
|
||||
<section class="table-panel"
|
||||
hx-get="/dashboard/repositories"
|
||||
hx-trigger="load"
|
||||
hx-swap="outerHTML">
|
||||
<div class="flex flex-col gap-1 border-b border-border px-4 py-3.5 sm:px-5 sm:py-4">
|
||||
<h2 class="flex items-center gap-2 text-base font-semibold text-foreground">
|
||||
<svg class="status-icon text-muted-foreground"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
aria-hidden="true">
|
||||
<path d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z" />
|
||||
</svg>
|
||||
Repositories
|
||||
</h2>
|
||||
<p class="text-sm leading-6 text-muted-foreground">
|
||||
Your Forgejo repositories. Create a share link to grant temporary read-only access.
|
||||
Create a share link to grant temporary read-only access.
|
||||
</p>
|
||||
</div>
|
||||
<div class="px-5 py-8 text-sm text-center text-muted-foreground">Loading repositories…</div>
|
||||
{# Skeleton rows #}
|
||||
<p class="sr-only" role="status">Loading repositories…</p>
|
||||
<div class="divide-y divide-border-subtle" aria-hidden="true">
|
||||
<div class="flex items-center gap-6 px-4 py-4 sm:px-5">
|
||||
<span class="skeleton-bar w-44"></span>
|
||||
<span class="skeleton-bar w-14"></span>
|
||||
<span class="skeleton-bar hidden w-12 sm:inline-block"></span>
|
||||
<span class="skeleton-bar ml-auto w-20"></span>
|
||||
</div>
|
||||
<div class="flex items-center gap-6 px-4 py-4 sm:px-5">
|
||||
<span class="skeleton-bar w-36"></span>
|
||||
<span class="skeleton-bar w-14"></span>
|
||||
<span class="skeleton-bar hidden w-12 sm:inline-block"></span>
|
||||
<span class="skeleton-bar ml-auto w-20"></span>
|
||||
</div>
|
||||
<div class="flex items-center gap-6 px-4 py-4 sm:px-5">
|
||||
<span class="skeleton-bar w-52"></span>
|
||||
<span class="skeleton-bar w-14"></span>
|
||||
<span class="skeleton-bar hidden w-12 sm:inline-block"></span>
|
||||
<span class="skeleton-bar ml-auto w-20"></span>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
{% endif %}
|
||||
<section class="table-panel">
|
||||
<div class="flex flex-col gap-1 px-5 py-4 border-b border-border">
|
||||
<h2 class="text-base font-semibold text-foreground">Share links</h2>
|
||||
<div class="flex flex-col gap-1 border-b border-border px-4 py-3.5 sm:px-5 sm:py-4">
|
||||
<h2 class="flex items-center gap-2 text-base font-semibold text-foreground">
|
||||
<svg class="status-icon {% if exposure.active %}text-ember{% else %}text-muted-foreground{% endif %}"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
{% if exposure.active %}role="img" aria-label="Live"{% else %}aria-hidden="true"{% endif %}>
|
||||
<path d="M9 17H7A5 5 0 0 1 7 7h2m6 0h2a5 5 0 1 1 0 10h-2m-7-5h8" />
|
||||
</svg>
|
||||
Share links
|
||||
</h2>
|
||||
<p class="text-sm leading-6 text-muted-foreground">
|
||||
Read-only repository snapshots published from this account.
|
||||
Repository snapshots published from this account.
|
||||
</p>
|
||||
</div>
|
||||
<div class="table-shell">
|
||||
<table class="data-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Repository</th>
|
||||
<th>Commit</th>
|
||||
<th>Status</th>
|
||||
<th>Views</th>
|
||||
<th>Expires</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="table-empty">
|
||||
<td colspan="5">You have not created any share links yet.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
{# Empty state — share-link data isn't wired yet; the populated table
|
||||
(thead + rows) belongs here once links exist. #}
|
||||
<div class="px-5 py-10 text-center">
|
||||
<p class="status-line text-muted-foreground">Status · Contained — 0 exposed</p>
|
||||
<p class="mt-3 text-sm font-medium text-foreground">No active share links</p>
|
||||
<p class="mt-1 text-sm leading-6 text-muted-foreground">
|
||||
Create one from a repository above to grant temporary, read-only access.
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<script>
|
||||
function localizeDates(root) {
|
||||
(root || document).querySelectorAll("time[data-local-date]").forEach((time) => {
|
||||
const value = time.getAttribute("datetime");
|
||||
if (!value) return;
|
||||
const date = new Date(value);
|
||||
const scope = root || document;
|
||||
const absolute = new Intl.DateTimeFormat(undefined, {
|
||||
month: "short",
|
||||
day: "numeric",
|
||||
year: "numeric",
|
||||
});
|
||||
scope.querySelectorAll("time[data-local-date]").forEach((time) => {
|
||||
const date = new Date(time.getAttribute("datetime"));
|
||||
if (Number.isNaN(date.valueOf())) return;
|
||||
time.textContent = new Intl.DateTimeFormat(undefined, {
|
||||
month: "short",
|
||||
day: "numeric",
|
||||
year: "numeric",
|
||||
}).format(date);
|
||||
time.textContent = absolute.format(date);
|
||||
});
|
||||
// Operational consoles read recency: "3d ago" / "in 3d", absolute on hover.
|
||||
const relative = new Intl.RelativeTimeFormat(undefined, { numeric: "auto", style: "narrow" });
|
||||
scope.querySelectorAll("time[data-relative-date]").forEach((time) => {
|
||||
const date = new Date(time.getAttribute("datetime"));
|
||||
if (Number.isNaN(date.valueOf())) return;
|
||||
const seconds = (date - Date.now()) / 1000;
|
||||
const units = [["day", 86400], ["hour", 3600], ["minute", 60]];
|
||||
const [unit, size] = units.find(([, s]) => Math.abs(seconds) >= s) || ["minute", 60];
|
||||
time.textContent = relative.format(Math.trunc(seconds / size), unit);
|
||||
time.title = absolute.format(date);
|
||||
});
|
||||
}
|
||||
localizeDates(document);
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
{% extends "base.html" %}
|
||||
{% block title %}Firebreak — protect your code from scraping{% endblock %}
|
||||
{% block body_class %}landing-page{% endblock %}
|
||||
{% block header_class %}hidden{% endblock %}
|
||||
{% block main_class %}flex-1{% endblock %}
|
||||
{% block content %}
|
||||
<section class="relative flex min-h-dvh w-full items-center justify-center overflow-hidden bg-background px-4 py-10 text-center text-foreground sm:px-6 sm:py-14 lg:py-16">
|
||||
<video class="hero-video"
|
||||
<section class="relative flex min-h-dvh w-full items-center justify-center overflow-hidden bg-background px-4 py-10 text-center text-brand-cream sm:px-6 sm:py-14 lg:py-16">
|
||||
<video class="absolute inset-0 h-full w-full object-cover"
|
||||
autoplay
|
||||
muted
|
||||
loop
|
||||
|
|
@ -14,24 +14,38 @@
|
|||
aria-hidden="true">
|
||||
<source src="/static/video/firebreak-hero.mp4" type="video/mp4" />
|
||||
</video>
|
||||
<div class="hero-vignette"></div>
|
||||
<div class="hero-ember"></div>
|
||||
<div class="relative z-10 flex w-full max-w-4xl -translate-y-[2dvh] flex-col items-center gap-6 sm:gap-8 lg:gap-9">
|
||||
<div class="pointer-events-none absolute inset-0"
|
||||
style="background: radial-gradient(circle at center, transparent 0, transparent 30%, color-mix(in oklab, var(--color-overlay) 38%, transparent) 62%, color-mix(in oklab, var(--color-overlay) 90%, transparent) 100%), linear-gradient(180deg, color-mix(in oklab, var(--color-overlay) 64%, transparent) 0, transparent 28%, color-mix(in oklab, var(--color-overlay) 70%, transparent) 100%), radial-gradient(ellipse at center, color-mix(in oklab, var(--color-overlay) 10%, transparent) 0, color-mix(in oklab, var(--color-overlay) 26%, transparent) 36%, transparent 58%)">
|
||||
</div>
|
||||
<div class="pointer-events-none absolute inset-[12%_18%_18%]"
|
||||
style="background: radial-gradient(circle at center, var(--color-hero-ember) 0%, color-mix(in oklab, var(--color-hero-ember) 35%, transparent) 35%, transparent 70%);
|
||||
mix-blend-mode: screen"></div>
|
||||
<div class="relative z-10 flex w-full max-w-4xl translate-y-[-2dvh] flex-col items-center gap-6 sm:gap-8 lg:gap-9">
|
||||
<img src="/static/img/firebreak-logo-cream-red.svg"
|
||||
alt=""
|
||||
width="240"
|
||||
height="238"
|
||||
class="hero-logo"
|
||||
class="h-auto w-full max-w-24 sm:max-w-32 lg:max-w-40"
|
||||
style="filter: drop-shadow(var(--shadow-hero-logo)) drop-shadow(var(--glow-hero))"
|
||||
aria-hidden="true" />
|
||||
<img src="/static/img/firebreak-brand-text.svg"
|
||||
alt="Firebreak"
|
||||
width="280"
|
||||
height="48"
|
||||
class="hero-wordmark" />
|
||||
<div class="hero-statement">
|
||||
<p class="text-base font-semibold leading-7 text-foreground sm:text-lg">Fight Fire with Fire.</p>
|
||||
<div class="hero-burn-line" aria-hidden="true"></div>
|
||||
<p class="max-w-md text-sm leading-6 text-foreground/90 sm:max-w-lg sm:text-[0.9375rem] sm:leading-7">
|
||||
class="h-auto w-full max-w-40 sm:max-w-48 lg:max-w-56"
|
||||
style="filter: drop-shadow(var(--shadow-hero-text))" />
|
||||
<div class="relative isolate flex max-w-lg flex-col items-center text-balance px-4 py-2 text-brand-cream sm:max-w-xl"
|
||||
style="filter: drop-shadow(var(--shadow-hero-copy))">
|
||||
<div class="pointer-events-none absolute -z-10 blur-[10px]"
|
||||
style="inset: -1.5rem -3rem;
|
||||
background: radial-gradient(ellipse at center, color-mix(in oklab, var(--color-overlay) 72%, transparent) 0, color-mix(in oklab, var(--color-overlay) 44%, transparent) 42%, transparent 72%)">
|
||||
</div>
|
||||
<p class="text-base font-semibold leading-7 text-brand-cream sm:text-lg">Fight Fire with Fire.</p>
|
||||
<div class="my-4 h-px w-16 rounded-full sm:my-5"
|
||||
style="background: linear-gradient(90deg, transparent, color-mix(in oklab, var(--color-brand-red) 85%, transparent) 18%, var(--color-hero-burn) 50%, color-mix(in oklab, var(--color-brand-red) 85%, transparent) 82%, transparent);
|
||||
box-shadow: 0 0 14px color-mix(in oklab, var(--color-brand-flame) 45%, transparent), 0 0 1px var(--color-brand-cream)"
|
||||
aria-hidden="true"></div>
|
||||
<p class="max-w-md text-sm leading-6 text-brand-cream/90 sm:max-w-lg sm:text-[0.9375rem] sm:leading-7">
|
||||
Temporary read-only access to private Forgejo snapshots.
|
||||
Let them inspect what you allow. Nothing more.
|
||||
</p>
|
||||
|
|
@ -52,11 +66,20 @@
|
|||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<p class="hero-meta" aria-label="Firebreak security properties">
|
||||
<p class="absolute inset-x-4 z-10 flex flex-wrap items-center justify-center gap-x-3 gap-y-2 text-[0.6875rem] font-semibold uppercase tracking-[0.12em] text-brand-cream/56 sm:text-xs"
|
||||
style="bottom: clamp(1.5rem, 5dvh, 4rem);
|
||||
filter: drop-shadow(var(--shadow-hero-text))"
|
||||
aria-label="Firebreak security properties">
|
||||
<span>Snapshot scoped</span>
|
||||
<span class="hero-meta-separator" aria-hidden="true"></span>
|
||||
<span class="size-1 rounded-full"
|
||||
style="background: var(--color-brand-flame);
|
||||
box-shadow: 0 0 10px color-mix(in oklab, var(--color-brand-flame) 55%, transparent)"
|
||||
aria-hidden="true"></span>
|
||||
<span>Read-only</span>
|
||||
<span class="hero-meta-separator" aria-hidden="true"></span>
|
||||
<span class="size-1 rounded-full"
|
||||
style="background: var(--color-brand-flame);
|
||||
box-shadow: 0 0 10px color-mix(in oklab, var(--color-brand-flame) 55%, transparent)"
|
||||
aria-hidden="true"></span>
|
||||
<span>Forgejo-native</span>
|
||||
</p>
|
||||
</section>
|
||||
|
|
|
|||
|
|
@ -1,9 +1,19 @@
|
|||
<section class="table-panel">
|
||||
<div class="flex flex-col gap-1 px-5 py-4 border-b border-border">
|
||||
<h2 class="text-base font-semibold text-foreground">
|
||||
<div class="flex flex-col gap-1 border-b border-border px-4 py-3.5 sm:px-5 sm:py-4">
|
||||
<h2 class="flex items-center gap-2 text-base font-semibold text-foreground">
|
||||
<svg class="status-icon text-muted-foreground"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
aria-hidden="true">
|
||||
<path d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z" />
|
||||
</svg>
|
||||
Repositories
|
||||
{% if repositories %}
|
||||
<span class="ml-1.5 text-sm font-normal text-muted-foreground">{{ repositories|length }}</span>
|
||||
<span class="text-sm font-normal text-muted-foreground">{{ repositories|length }}</span>
|
||||
{% endif %}
|
||||
</h2>
|
||||
<p class="text-sm leading-6 text-muted-foreground">
|
||||
|
|
@ -11,69 +21,121 @@
|
|||
</p>
|
||||
</div>
|
||||
{% if repo_error %}
|
||||
<div class="px-5 py-8 text-sm text-center text-muted-foreground">{{ repo_error }}</div>
|
||||
<div class="table-placeholder text-warning-foreground">
|
||||
{{ repo_error }}
|
||||
<button type="button"
|
||||
class="btn btn-sm btn-secondary"
|
||||
hx-get="/dashboard/repositories"
|
||||
hx-target="#repositories-region"
|
||||
hx-swap="innerHTML">Retry</button>
|
||||
</div>
|
||||
{% elif repositories %}
|
||||
<div class="table-shell">
|
||||
<table class="data-table">
|
||||
<caption class="sr-only">Your Forgejo repositories</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Repository</th>
|
||||
<th>Status</th>
|
||||
<th>Branch</th>
|
||||
<th>Language</th>
|
||||
<th>Updated</th>
|
||||
<th class="text-right">Actions</th>
|
||||
<th scope="col">Repository</th>
|
||||
<th scope="col">Type</th>
|
||||
<th scope="col">Branch</th>
|
||||
<th scope="col" class="hidden lg:table-cell">Language</th>
|
||||
<th scope="col" class="hidden md:table-cell">Last Updated</th>
|
||||
<th scope="col" class="text-center">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for repo in repositories %}
|
||||
<tr>
|
||||
<td>
|
||||
{# Owner muted, name bright — eyes land on the repo, not the prefix #}
|
||||
{% set owner, slash, name = repo.full_name.partition('/') %}
|
||||
{% if repo.html_url %}
|
||||
<a href="{{ repo.html_url }}"
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
class="font-medium text-foreground hover:text-brand-flame">{{ repo.full_name }}</a>
|
||||
class="group inline-flex items-center gap-1 font-medium text-foreground hover:text-ember">
|
||||
{% if slash %}
|
||||
<span class="font-normal text-muted-foreground">{{ owner }}/</span>{{ name }}
|
||||
{% else %}
|
||||
{{ repo.full_name }}
|
||||
{% endif %}
|
||||
<svg class="size-3 shrink-0 text-muted-foreground/60 transition-colors group-hover:text-ember"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
aria-hidden="true">
|
||||
<path d="M15 3h6v6m-11 5L21 3m-3 10v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" />
|
||||
</svg>
|
||||
<span class="sr-only">(opens in Forgejo in a new tab)</span>
|
||||
</a>
|
||||
{% else %}
|
||||
<span class="font-medium text-foreground">{{ repo.full_name }}</span>
|
||||
<span class="font-medium text-foreground">
|
||||
{% if slash %}
|
||||
<span class="font-normal text-muted-foreground">{{ owner }}/</span>{{ name }}
|
||||
{% else %}
|
||||
{{ repo.full_name }}
|
||||
{% endif %}
|
||||
</span>
|
||||
{% endif %}
|
||||
{# Provenance is metadata, not risk — muted mono, never a badge #}
|
||||
{% set provenance = (['fork'] if repo.fork else []) + (['mirror'] if repo.mirror else []) %}
|
||||
{% if provenance %}
|
||||
<span class="font-mono text-xs text-muted-foreground">· {{ provenance | join(' · ') }}</span>
|
||||
{% endif %}
|
||||
{% if repo.description %}
|
||||
<p class="mt-0.5 max-w-md truncate text-xs text-muted-foreground">{{ repo.description }}</p>
|
||||
<p class="mt-0.5 max-w-[16rem] truncate text-xs text-muted-foreground sm:max-w-md">
|
||||
{{ repo.description }}
|
||||
</p>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
{# Heat = exposure: only exception states earn a badge.
|
||||
Private is the ground state — an unmarked row is contained. #}
|
||||
<div class="flex flex-wrap items-center gap-1.5">
|
||||
{% if repo.private %}
|
||||
<span class="badge-warning">Private</span>
|
||||
{% else %}
|
||||
<span class="badge-slate">Public</span>
|
||||
{% if not repo.private %}
|
||||
<span class="badge badge-ember">Public</span>
|
||||
{% endif %}
|
||||
{% if repo.archived %}<span class="badge-expired">Archived</span>{% endif %}
|
||||
{% if repo.empty %}<span class="badge-danger">Empty</span>{% endif %}
|
||||
{% if repo.fork %}<span class="badge-slate">Fork</span>{% endif %}
|
||||
{% if repo.mirror %}<span class="badge-slate">Mirror</span>{% endif %}
|
||||
{% if repo.archived %}<span class="badge badge-expired">Archived</span>{% endif %}
|
||||
{% if repo.empty %}<span class="badge badge-danger">Empty</span>{% endif %}
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<span class="inline-block rounded bg-muted px-1.5 py-0.5 font-mono text-xs text-muted-foreground">{{ repo.default_branch }}</span>
|
||||
<span class="mono-chip inline-flex items-center gap-1">
|
||||
<svg class="size-3 shrink-0"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
aria-hidden="true">
|
||||
<path d="M15 6a9 9 0 0 0-9 9V3" />
|
||||
<circle cx="18" cy="6" r="3" />
|
||||
<circle cx="6" cy="18" r="3" />
|
||||
</svg>
|
||||
{{ repo.default_branch }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="whitespace-nowrap text-muted-foreground">
|
||||
<td class="hidden whitespace-nowrap text-muted-foreground lg:table-cell">
|
||||
{% if repo.language %}
|
||||
<span class="inline-flex items-center gap-1.5">
|
||||
<span class="rounded-full size-2 bg-brand-flame/70" aria-hidden="true"></span>{{ repo.language }}
|
||||
</span>
|
||||
{{ repo.language }}
|
||||
{% else %}
|
||||
<span class="text-muted-foreground/50">—</span>
|
||||
<span class="text-muted-foreground">—</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="whitespace-nowrap text-muted-foreground">
|
||||
<time datetime="{{ repo.updated_at }}" data-local-date>{{ repo.updated_at }}</time>
|
||||
<td class="hidden whitespace-nowrap text-muted-foreground md:table-cell">
|
||||
<time datetime="{{ repo.updated_at }}" data-relative-date>{{ repo.updated_at }}</time>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<td class="text-center">
|
||||
{% if repo.empty %}
|
||||
<span class="btn btn-sm btn-disabled" aria-disabled="true">Create Link</span>
|
||||
{% else %}
|
||||
<a href="/links/create" class="btn btn-sm btn-primary">Create Link</a>
|
||||
<a href="/links/create"
|
||||
class="btn btn-sm btn-primary"
|
||||
aria-label="Create link for {{ repo.full_name }}">Create Link</a>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
|
|
@ -82,8 +144,6 @@
|
|||
</table>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="px-5 py-8 text-sm text-center text-muted-foreground">
|
||||
No repositories found in your Forgejo account.
|
||||
</div>
|
||||
<div class="table-placeholder">No repositories found in your Forgejo account.</div>
|
||||
{% endif %}
|
||||
</section>
|
||||
|
|
|
|||
|
|
@ -1,120 +1,103 @@
|
|||
{% extends "base.html" %}
|
||||
{% block title %}Settings — Firebreak{% endblock %}
|
||||
{% block content %}
|
||||
<div class="flex flex-col gap-10">
|
||||
<section class="page-header">
|
||||
<div>
|
||||
<p class="text-xs font-semibold uppercase tracking-[0.14em] text-muted-foreground">Settings</p>
|
||||
<h1 class="mt-3 text-3xl font-semibold leading-tight text-foreground sm:text-4xl">
|
||||
Configuration
|
||||
</h1>
|
||||
<p class="mt-2 text-base leading-7 text-foreground/68 sm:text-lg">
|
||||
Manage your Firebreak configuration.
|
||||
</p>
|
||||
</div>
|
||||
{# One section doesn't earn a sidebar — a single quiet column until it does. #}
|
||||
<div class="mx-auto flex w-full max-w-3xl flex-col gap-6">
|
||||
<section>
|
||||
<h1 class="text-2xl font-semibold leading-tight text-foreground sm:text-3xl">Settings</h1>
|
||||
<div class="firebreak-rule mt-6" aria-hidden="true"></div>
|
||||
</section>
|
||||
<div class="max-w-3xl">
|
||||
<div class="flex min-w-0 flex-col gap-4">
|
||||
{% if pat_deleted %}
|
||||
<div class="rounded-md border-l-4 border-warning bg-warning-muted px-4 py-3 text-sm font-semibold text-warning-foreground"
|
||||
role="status">Access token removed.</div>
|
||||
<div class="notice-rail" role="status">
|
||||
<p class="text-sm font-semibold text-warning-foreground">Access token removed.</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div id="forgejo-access-token">
|
||||
<h2 class="text-base font-semibold">Forgejo access token</h2>
|
||||
<p class="mt-2 text-sm text-muted-foreground">
|
||||
A <code class="rounded-sm bg-secondary px-1.5 py-0.5 text-foreground">read:repository</code>-scoped
|
||||
Personal Access Token is required for share link viewing.
|
||||
</p>
|
||||
{% if pat_registered %}
|
||||
<div class="notice-rail border-success" role="status">
|
||||
<p class="text-sm font-semibold text-success-foreground">Access token registered.</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
<section class="table-panel">
|
||||
<div class="flex flex-col gap-1 border-b border-border px-4 py-3.5 sm:px-5 sm:py-4">
|
||||
<h2 class="text-base font-semibold text-foreground">Forgejo access token</h2>
|
||||
<p class="text-sm leading-6 text-muted-foreground">
|
||||
A <code class="mono-chip">read:repository</code>-scoped
|
||||
Personal Access Token is required for share link viewing.
|
||||
</p>
|
||||
</div>
|
||||
{% if user.has_pat %}
|
||||
<div class="mt-4 card">
|
||||
<div class="flex items-center justify-between px-4 py-3.5">
|
||||
<div class="flex items-center gap-3">
|
||||
<div class="flex size-8 items-center justify-center rounded-md bg-success-muted text-success-foreground">
|
||||
<svg xmlns="http://www.w3.org/2000/svg"
|
||||
width="16"
|
||||
height="16"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round">
|
||||
<path d="M21 2l-2 2m-7.61 7.61a5.5 5.5 0 1 1-7.778 7.778 5.5 5.5 0 0 1 7.777-7.777zm0 0L15.5 7.5m0 0l3 3L22 7l-3-3m-3.5 3.5L19 4" />
|
||||
</svg>
|
||||
</div>
|
||||
<div>
|
||||
<p class="text-sm font-medium text-foreground">Access token</p>
|
||||
<p class="mt-0.5 text-xs text-muted-foreground">
|
||||
{% if user.pat_registered_at %}
|
||||
Registered <time datetime="{{ user.pat_registered_at.isoformat() }}" data-local-date>{{ user.pat_registered_at.isoformat() }}</time>
|
||||
{% else %}
|
||||
Registered
|
||||
{% endif %}
|
||||
</p>
|
||||
</div>
|
||||
<div class="flex items-center justify-between gap-4 border-b border-border-subtle px-4 py-3.5 sm:px-5">
|
||||
<div class="flex items-center gap-2.5">
|
||||
<svg class="status-icon text-success-foreground"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
aria-hidden="true">
|
||||
<path d="M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z" />
|
||||
<circle cx="16.5" cy="7.5" r=".5" fill="currentColor" stroke="none" />
|
||||
</svg>
|
||||
<div>
|
||||
<p class="text-sm font-medium text-foreground">Access token</p>
|
||||
<p class="mt-0.5 text-xs text-muted-foreground">
|
||||
{% if user.pat_registered_at %}
|
||||
Registered <time datetime="{{ user.pat_registered_at.isoformat() }}" data-local-date>{{ user.pat_registered_at.isoformat() }}</time>
|
||||
{% else %}
|
||||
Registered
|
||||
{% endif %}
|
||||
</p>
|
||||
</div>
|
||||
<form method="post"
|
||||
action="/settings/pat/delete"
|
||||
data-confirm="Delete this access token? You can register a new token later.">
|
||||
<button type="submit" class="btn btn-xs btn-danger">Delete</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<details class="mt-4">
|
||||
<summary class="cursor-pointer text-sm text-muted-foreground hover:text-foreground">
|
||||
Update token
|
||||
</summary>
|
||||
<form id="pat-form"
|
||||
class="mt-3"
|
||||
method="post"
|
||||
action="/settings/pat"
|
||||
novalidate>
|
||||
<div class="grid gap-2 sm:gap-4 sm:grid-cols-[1fr_auto] sm:items-end">
|
||||
<input type="password"
|
||||
id="pat"
|
||||
name="pat"
|
||||
class="block w-full input-mono"
|
||||
placeholder="Paste new token…"
|
||||
aria-describedby="pat-error"
|
||||
aria-invalid="false"
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
required />
|
||||
<button type="submit" class="btn btn-sm btn-primary self-center">Update</button>
|
||||
</div>
|
||||
<div class="mt-2">
|
||||
<p id="pat-error"
|
||||
class="text-sm font-medium text-danger-foreground hidden"
|
||||
aria-live="polite">A Forgejo token is required.</p>
|
||||
</div>
|
||||
<form method="post"
|
||||
action="/settings/pat/delete"
|
||||
data-confirm="Delete this access token? You can register a new token later.">
|
||||
<button type="submit" class="btn btn-sm btn-danger-quiet">Delete</button>
|
||||
</form>
|
||||
</details>
|
||||
</div>
|
||||
{% else %}
|
||||
<form id="pat-form"
|
||||
class="mt-4"
|
||||
method="post"
|
||||
action="/settings/pat"
|
||||
novalidate>
|
||||
<div class="grid gap-2 sm:gap-4 sm:grid-cols-[1fr_auto] sm:items-end">
|
||||
<div class="flex items-center gap-2.5 border-b border-border-subtle px-4 py-3.5 sm:px-5">
|
||||
<svg class="status-icon text-warning-foreground"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
aria-hidden="true">
|
||||
<path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3M12 9v4m0 4h.01" />
|
||||
</svg>
|
||||
<p class="status-line text-warning-foreground">Status · No token registered</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="px-4 py-3.5 sm:px-5 sm:py-4">
|
||||
<form id="pat-form" method="post" action="/settings/pat" novalidate>
|
||||
<label for="pat" class="form-label">
|
||||
{{ "Replace token" if user.has_pat else "Register token" }}
|
||||
</label>
|
||||
<div class="grid gap-2 sm:grid-cols-[1fr_auto] sm:gap-3">
|
||||
<input type="password"
|
||||
id="pat"
|
||||
name="pat"
|
||||
class="block w-full input-mono"
|
||||
placeholder="ad8j3…"
|
||||
class="form-input font-mono"
|
||||
placeholder="Paste new token…"
|
||||
aria-describedby="pat-error"
|
||||
aria-invalid="false"
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
required />
|
||||
<button type="submit" class="btn btn-sm btn-primary self-center">Register</button>
|
||||
</div>
|
||||
<div class="mt-2">
|
||||
<p id="pat-error"
|
||||
class="text-sm font-medium text-danger-foreground hidden"
|
||||
aria-live="polite">A Forgejo token is required.</p>
|
||||
<button type="submit" class="btn btn-sm btn-primary self-center">
|
||||
{{ "Update" if user.has_pat else "Register" }}
|
||||
</button>
|
||||
</div>
|
||||
<p id="pat-error"
|
||||
class="mt-2 hidden text-sm font-medium text-danger-foreground"
|
||||
aria-live="polite">A Forgejo token is required.</p>
|
||||
</form>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue