double-click on issues in list view opens edit window

This commit is contained in:
viljarb
2026-03-05 17:32:31 +01:00
parent 8593f7fdc4
commit dbffd5f3f8
10 changed files with 264 additions and 179 deletions

View File

@@ -50,15 +50,7 @@ templ DashboardContent(props DashboardProps) {
>
New Issue
</button>
<button
type="button"
class="btn btn-error btn-sm btn-outline"
hx-delete={ "/issues/" + props.SelectedIssue.ID }
hx-confirm="Are you sure you want to delete this issue? This action cannot be undone."
hx-target="body"
>
Delete issue
</button>
</div>
<div class="flex gap-2">
if props.SelectedIssue != nil {
@@ -136,6 +128,8 @@ templ DashboardIssueRows(issues []*models.Issue, selectedID string) {
hx-target="main"
hx-vals={ `{"selected-issue": "` + issue.ID + `"}` }
hx-swap="innerHTML"
data-issue-id={ issue.ID }
ondblclick="event.preventDefault(); var id = this.dataset.issueId; if(id) htmx.ajax('GET', '/issues/' + id + '/edit', {target: '#modal-container', swap: 'innerHTML'})"
>
<td class="min-w-20 truncate">{ issue.ID }</td>
<td class="truncate max-w-60">{ issue.Title }</td>