| 1 | {{/* delete — GET /d/{sqid}/delete, File → Delete…'s confirmation |
| 2 | (delete.go). The document as the page it is, its title, what |
| 3 | deleting does, and the one button that does it: a plain POST, so it |
| 4 | works with no script, and a 303 back to the list. Cancel goes back |
| 5 | to the document. */}} |
| 6 | {{define "content"}}<style> |
| 7 | /* The document's own desk (show.html), so the confirmation reads as |
| 8 | the same place the person came from. Kept in step with show.html's |
| 9 | :root values by hand: two literals, one page each. */ |
| 10 | body:has([docs-delete]) { |
| 11 | background: light-dark(#e3e7ee, #0e1015); |
| 12 | } |
| 13 | /* A card on the desk, and Fiesta's stack (rst-stack): the stack |
| 14 | spaces the page, the title, what deleting does and the buttons. */ |
| 15 | [docs-delete] { |
| 16 | align-items: center; |
| 17 | max-inline-size: 26rem; |
| 18 | margin: var(--rst-sp-6) auto; |
| 19 | padding: var(--rst-sp-6) var(--rst-sp-5); |
| 20 | border-radius: var(--rst-radius); |
| 21 | background: var(--rst-surface); |
| 22 | box-shadow: var(--rst-shadow-lift); |
| 23 | text-align: center; |
| 24 | } |
| 25 | /* The page about to go, at shelf size, the same drawing the list |
| 26 | shows (preview.go), tipped a little as if lifted off the desk. */ |
| 27 | [docs-delete-sheet] { |
| 28 | display: block; |
| 29 | inline-size: 7.5rem; |
| 30 | aspect-ratio: 612 / 792; |
| 31 | border-radius: 3px; |
| 32 | background: #ffffff; |
| 33 | overflow: hidden; |
| 34 | rotate: -3deg; |
| 35 | box-shadow: |
| 36 | 0 0 0 1px rgb(23 32 60 / 0.08), |
| 37 | 0 10px 24px -12px rgb(23 32 60 / 0.35); |
| 38 | } |
| 39 | [docs-delete-sheet] > svg { |
| 40 | display: block; |
| 41 | inline-size: 100%; |
| 42 | block-size: 100%; |
| 43 | } |
| 44 | [docs-delete-sheet] rect { |
| 45 | fill: #b9c0cc; |
| 46 | } |
| 47 | [docs-delete] h1 { |
| 48 | font-size: 1.375rem; |
| 49 | font-weight: 700; |
| 50 | letter-spacing: -0.015em; |
| 51 | overflow-wrap: anywhere; |
| 52 | } |
| 53 | [docs-delete] p { |
| 54 | color: var(--rst-text-muted); |
| 55 | } |
| 56 | [docs-delete-actions] { |
| 57 | justify-content: center; |
| 58 | } |
| 59 | </style> |
| 60 | <section rst-stack docs-delete aria-labelledby="docs-delete-title"> |
| 61 | <span docs-delete-sheet aria-hidden="true">{{with .Thumb}}{{if .Bars}}<svg viewBox="0 0 {{.W}} {{.H}}" preserveAspectRatio="xMidYMin slice">{{range .Bars}}<rect x="{{.X}}" y="{{.Y}}" width="{{.W}}" height="{{.H}}"/>{{end}}</svg>{{end}}{{end}}</span> |
| 62 | <h1 id="docs-delete-title">{{.Heading}}</h1> |
| 63 | <p>{{.Body}}</p> |
| 64 | <div rst-actions docs-delete-actions> |
| 65 | <a rst-btn="ghost" href="/d/{{.Sqid}}">{{.Cancel}}</a> |
| 66 | <form method="post" action="/d/{{.Sqid}}/delete"> |
| 67 | <button rst-btn="danger" type="submit">{{.Confirm}}</button> |
| 68 | </form> |
| 69 | </div> |
| 70 | </section> |
| 71 | {{end}} |
| 72 | |