The web UI was linking to /v1/ REST API paths that aren't served through nginx. Added SVG/JPG/PDF rendering and share link endpoints directly to the web server so everything works through port 443. - Add render.go with SVG, JPG, PDF handlers for auth and share paths - Register render routes and share management routes in web server - Update template links from /v1/... to /notebooks/... paths - Add share link creation, display, and revocation to notebook view Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
42 lines
1.4 KiB
HTML
42 lines
1.4 KiB
HTML
{{define "title"}}{{.Title}} — Engineering Pad{{end}}
|
|
|
|
{{define "content"}}
|
|
<h1>{{.Title}}</h1>
|
|
<div class="actions">
|
|
<a href="{{.PDFLink}}" class="btn">Download PDF</a>
|
|
{{if not .Shared}}
|
|
<form method="POST" action="/notebooks/{{.ID}}/share" style="display:inline;">
|
|
<button type="submit" class="btn">Create Share Link</button>
|
|
</form>
|
|
{{end}}
|
|
</div>
|
|
|
|
{{if .ShareLinks}}
|
|
<div style="margin: 1rem 0; padding: 0.75rem; border: 1px solid #ccc; border-radius: 4px;">
|
|
<strong>Share Links</strong>
|
|
{{range .ShareLinks}}
|
|
<div style="display: flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem;">
|
|
<code style="font-size: 0.85rem; flex: 1;"><a href="{{.URL}}">{{.URL}}</a></code>
|
|
<form method="POST" action="/notebooks/{{$.ID}}/share/revoke" style="margin:0;">
|
|
<input type="hidden" name="token" value="{{.Token}}">
|
|
<button type="submit" class="btn" style="font-size: 0.8rem; padding: 0.25rem 0.5rem;">Revoke</button>
|
|
</form>
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
{{end}}
|
|
|
|
<div class="grid">
|
|
{{range .Pages}}
|
|
<div>
|
|
<a href="{{.ViewLink}}">
|
|
<div class="page-thumb">
|
|
<img src="{{.SVGLink}}" alt="Page {{.Number}}">
|
|
</div>
|
|
</a>
|
|
<div style="text-align:center; margin-top:0.25rem;">Page {{.Number}}</div>
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
{{end}}
|