- Add delete notebook handler with ownership check and CASCADE delete - Rename "Create Share Link" to "Share" - Fix action button heights: use inline-flex + align-items for consistent sizing across <a> and <button> elements Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
46 lines
1.6 KiB
HTML
46 lines
1.6 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">Share</button>
|
|
</form>
|
|
<form method="POST" action="/notebooks/{{.ID}}/delete" style="display:inline;"
|
|
onsubmit="return confirm('Delete this notebook from the server?');">
|
|
<button type="submit" class="btn" style="color: #c62828; border-color: #c62828;">Delete</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}}
|