Files
LazyPM/pkg/web/routes/issue_detail.templ
Ine Maria Nilssen Aanonsen 0c56c4c2b6 WEB - DELETE ISSUE
2026-02-24 15:33:58 +01:00

53 lines
1.3 KiB
Plaintext

package routes
import (
"github.com/LazyBachelor/LazyPM/internal/models"
"github.com/LazyBachelor/LazyPM/pkg/web/components"
)
type IssueDetailProps struct {
Issue models.Issue
DisplayOwner string
DisplayAssignee string
Comments []*models.Comment
}
templ IssueDetailContent(props IssueDetailProps) {
<div class="container mx-auto px-4 py-6">
<div class="mb-4 flex flex-wrap items-center gap-2">
<a
class="btn btn-ghost btn-sm"
hx-get="/"
hx-target="main"
hx-swap="innerHTML"
hx-push-url="true"
>
@components.IconBack()
Back to Issues
</a>
<button
type="button"
class="btn btn-error btn-sm btn-outline"
hx-delete={ "/issues/" + props.Issue.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="mb-6">
@components.IssueDetailCard(components.IssueDetailCardProps{Issue: props.Issue, DisplayOwner: props.DisplayOwner, DisplayAssignee: props.DisplayAssignee})
</div>
@components.CommentSection(components.CommentSectionProps{
IssueID: props.Issue.ID,
Comments: props.Comments,
})
</div>
}
templ IssueDetail(props IssueDetailProps) {
@BaseLayout(BaseLayoutProps{SearchQuery: ""}) {
@IssueDetailContent(props)
}
}