feat(web): confirm-then-delete control on a finished or failed recording (#37)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -86,6 +86,7 @@ templ uploadStatus(u domain.UploadedTranscript, chatEnabled bool, now time.Time)
|
|||||||
<summary>Transcript</summary>
|
<summary>Transcript</summary>
|
||||||
<pre class="transcript">{ u.Content }</pre>
|
<pre class="transcript">{ u.Content }</pre>
|
||||||
</details>
|
</details>
|
||||||
|
@deleteRecording(u.ID)
|
||||||
</div>
|
</div>
|
||||||
case domain.UploadFailed:
|
case domain.UploadFailed:
|
||||||
<div class="upload-status upload-failed flash flash-error" role="alert">
|
<div class="upload-status upload-failed flash flash-error" role="alert">
|
||||||
@@ -97,6 +98,7 @@ templ uploadStatus(u domain.UploadedTranscript, chatEnabled bool, now time.Time)
|
|||||||
@progressSteps(u.Progress, now, false)
|
@progressSteps(u.Progress, now, false)
|
||||||
</details>
|
</details>
|
||||||
}
|
}
|
||||||
|
@deleteRecording(u.ID)
|
||||||
</div>
|
</div>
|
||||||
default:
|
default:
|
||||||
<div
|
<div
|
||||||
@@ -122,6 +124,20 @@ templ uploadStatus(u domain.UploadedTranscript, chatEnabled bool, now time.Time)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// deleteRecording is the confirm-then-delete control, shown only once a recording has
|
||||||
|
// finished (done or failed): deleting one that is still being processed is refused.
|
||||||
|
templ deleteRecording(id string) {
|
||||||
|
<details class="confirm-delete">
|
||||||
|
<summary class="btn-danger">Delete this recording…</summary>
|
||||||
|
<div class="confirm-body">
|
||||||
|
<p>This permanently deletes the recording and its transcript. Are you sure?</p>
|
||||||
|
<form method="post" action={ templ.SafeURL("/uploads/" + id + "/delete") }>
|
||||||
|
<button type="submit" class="btn-danger">Yes, permanently delete it</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</details>
|
||||||
|
}
|
||||||
|
|
||||||
// UploadChatPage is the no-JS full page for chatting with an uploaded transcript:
|
// UploadChatPage is the no-JS full page for chatting with an uploaded transcript:
|
||||||
// the same chat panel as a video's (ADR-027), scoped to this recording.
|
// the same chat panel as a video's (ADR-027), scoped to this recording.
|
||||||
templ UploadChatPage(u domain.UploadedTranscript, v chatView) {
|
templ UploadChatPage(u domain.UploadedTranscript, v chatView) {
|
||||||
|
|||||||
+367
-311
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user