open same details page from board view; make assignee button more obvious
This commit is contained in:
@@ -8,14 +8,31 @@ import (
|
||||
type IssueDetailProps struct {
|
||||
Issue *models.Issue
|
||||
Comments []*models.Comment
|
||||
From string // "board" when navigating from board view
|
||||
}
|
||||
|
||||
type IssueDetailModalProps struct {
|
||||
Issue *models.Issue
|
||||
Comments []*models.Comment
|
||||
From string
|
||||
}
|
||||
|
||||
templ IssueDetailContent(props IssueDetailProps) {
|
||||
{{
|
||||
backURL := "/"
|
||||
editURL := "/issues/" + props.Issue.ID + "/edit"
|
||||
deleteURL := "/issues/" + props.Issue.ID
|
||||
if props.From == "board" {
|
||||
backURL = "/?board=true"
|
||||
editURL += "?from=board"
|
||||
deleteURL += "?from=board"
|
||||
}
|
||||
}}
|
||||
<div class="max-w-2xl mx-auto">
|
||||
<div class="mb-4">
|
||||
<a
|
||||
class="btn btn-ghost btn-sm"
|
||||
hx-get="/"
|
||||
hx-get={ backURL }
|
||||
hx-target="main"
|
||||
hx-swap="innerHTML"
|
||||
hx-push-url="true"
|
||||
@@ -26,7 +43,7 @@ templ IssueDetailContent(props IssueDetailProps) {
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-primary btn-sm"
|
||||
hx-get={ "/issues/" + props.Issue.ID + "/edit" }
|
||||
hx-get={ editURL }
|
||||
hx-target="#modal-container"
|
||||
hx-swap="innerHTML"
|
||||
>
|
||||
@@ -35,7 +52,7 @@ templ IssueDetailContent(props IssueDetailProps) {
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-error btn-sm btn-outline"
|
||||
hx-delete={ "/issues/" + props.Issue.ID }
|
||||
hx-delete={ deleteURL }
|
||||
hx-confirm="Are you sure you want to delete this issue? This action cannot be undone."
|
||||
hx-target="body"
|
||||
>
|
||||
@@ -57,3 +74,15 @@ templ IssueDetail(props IssueDetailProps) {
|
||||
@IssueDetailContent(props)
|
||||
}
|
||||
}
|
||||
|
||||
templ IssueDetailModalContent(props IssueDetailModalProps) {
|
||||
<div class="w-full">
|
||||
<div id="issue-detail-container" class="mb-6">
|
||||
@components.IssueDetail(components.IssueDetailProps{Issue: props.Issue})
|
||||
</div>
|
||||
@components.CommentSection(components.CommentSectionProps{
|
||||
IssueID: props.Issue.ID,
|
||||
Comments: props.Comments,
|
||||
})
|
||||
</div>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user