49 lines
1018 B
Plaintext
49 lines
1018 B
Plaintext
package routes
|
|
|
|
import (
|
|
"github.com/LazyBachelor/LazyPM/internal/models"
|
|
"github.com/LazyBachelor/LazyPM/pkg/web/components"
|
|
)
|
|
|
|
type IssueDetailProps struct {
|
|
Issue *models.Issue
|
|
Comments []*models.Comment
|
|
}
|
|
|
|
templ IssueDetailContent(props IssueDetailProps) {
|
|
<div class="p-2">
|
|
<div class="mb-4">
|
|
<a
|
|
class="btn btn-ghost btn-sm"
|
|
hx-get="/"
|
|
hx-target="main"
|
|
hx-swap="innerHTML"
|
|
>
|
|
@components.IconBack()
|
|
Back to Issues
|
|
</a>
|
|
<a
|
|
class="btn btn-primary btn-sm"
|
|
hx-get={ "/issues/" + props.Issue.ID + "/edit" }
|
|
hx-target="#modal-container"
|
|
hx-swap="innerHTML"
|
|
>
|
|
Edit Issue
|
|
</a>
|
|
</div>
|
|
<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>
|
|
}
|
|
|
|
templ IssueDetail(props IssueDetailProps) {
|
|
@BaseLayout() {
|
|
@IssueDetailContent(props)
|
|
}
|
|
}
|