feat(web): link the API documentation in the footer and where tokens are created
ci / build (pull_request) Successful in 3m46s
ci / image (pull_request) Successful in 4m39s
ci / test (pull_request) Successful in 8m25s
ci / lint (pull_request) Successful in 9m12s

The footer now always shows, with the API link next to the legal
documents. Creating a token explains how to send it, before and right
after creation.

Refs #84

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
This commit is contained in:
Sebastian UnterschützandClaude Opus 5.5 committed 2026-11-22 13:23:18 +01:00
1 parent ef49667082
commit e6be8f15d3
9 files changed
+433 -342

No files matched your search

+14 -1
View File
@@ -301,7 +301,6 @@ templ TokensPage(p Page, me Me, v TokensView) {
} else {
@settingsHeading("tokens.title", "tokens.intro")
}
<p class="-mt-4 mb-8 text-sm"><a href="/api/docs" class="underline underline-offset-2">{ i18n.T(ctx, "apidocs.title") }</a></p>
if v.MaxDays > 0 {
<p class="-mt-4 mb-8 text-sm">{ i18n.T(ctx, "tokens.policy", "Count", v.MaxDays) }</p>
}
@@ -352,6 +351,7 @@ templ TokensPage(p Page, me Me, v TokensView) {
}
<section class="max-w-xl">
@sectionHeading("tokens.create")
@tokenUsage()
<form data-api="/org/tokens" data-show-link>
@formError()
@valueField(i18n.T(ctx, "sso.field.name"), "name", "", "", true)
@@ -372,6 +372,9 @@ templ TokensPage(p Page, me Me, v TokensView) {
<div data-link-output hidden class="mt-6 border border-ink p-4">
<p class="mb-2 text-sm">{ i18n.T(ctx, "tokens.copy_now") }</p>
<input data-link readonly class="w-full border border-rule bg-transparent px-2 py-1.5 font-mono text-xs"/>
<div class="mt-3">
@tokenUsage()
</div>
</div>
</form>
</section>
@@ -465,3 +468,13 @@ func maxDaysValue(d int) string {
}
return strconv.Itoa(d)
}
// tokenUsage explains how to send a token and links the API documentation.
templ tokenUsage() {
<p class="mb-4 text-sm text-muted">
{ i18n.T(ctx, "tokens.usage") }
<code class="font-mono text-xs text-ink">Authorization: Bearer ust_…</code>
·
<a href="/api/docs" class="text-ink underline underline-offset-2">{ i18n.T(ctx, "apidocs.title") }</a>
</p>
}