// Code generated by templ - DO NOT EDIT. // templ: version: v0.3.1001 package routes //lint:file-ignore SA4006 This context is only used if a nested component is present. import "github.com/a-h/templ" import templruntime "github.com/a-h/templ/runtime" import ( "fmt" "github.com/LazyBachelor/LazyPM/internal/models" "github.com/LazyBachelor/LazyPM/pkg/web/components" ) func IssueDetailPage(issue *models.Issue, comments []*models.Comment) templ.Component { return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { return templ_7745c5c3_CtxErr } templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) if !templ_7745c5c3_IsBuffer { defer func() { templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) if templ_7745c5c3_Err == nil { templ_7745c5c3_Err = templ_7745c5c3_BufErr } }() } ctx = templ.InitializeContext(ctx) templ_7745c5c3_Var1 := templ.GetChildren(ctx) if templ_7745c5c3_Var1 == nil { templ_7745c5c3_Var1 = templ.NopComponent } ctx = templ.ClearChildren(ctx) issueJSON, _ := templ.JSONString(issue) xData := fmt.Sprintf(`{ issue: %s, editing: null, newComment: '', get statusClass() { const classes = { 'open': 'badge-info', 'in_progress': 'badge-warning', 'blocked': 'badge-error', 'closed': 'badge-success' } return classes[this.issue.status] || 'badge-ghost' }, get priorityLabel() { const labels = ['Irrelevant', 'Low', 'Normal', 'High', 'Critical'] return labels[this.issue.priority] || 'P' + this.issue.priority }, async saveField(field, value) { const formData = new URLSearchParams() formData.append(field, value || '') const response = await fetch('/issues/' + this.issue.id, { method: 'PATCH', body: formData, headers: { 'HX-Request': 'true' } }) this.editing = null // Check if server wants to redirect back to list const redirectUrl = response.headers.get('HX-Redirect') if (redirectUrl) { window.location.href = redirectUrl } }, async addComment() { if (!this.newComment.trim()) return const author = this.issue.created_by || 'Anonymous' const formData = new URLSearchParams() formData.append('text', this.newComment) formData.append('author', author) await fetch('/issues/' + this.issue.id + '/comments', { method: 'POST', body: formData, headers: { 'HX-Request': 'true' } }) this.newComment = '' window.location.reload() } }`, issueJSON) templ_7745c5c3_Var2 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) if !templ_7745c5c3_IsBuffer { defer func() { templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) if templ_7745c5c3_Err == nil { templ_7745c5c3_Err = templ_7745c5c3_BufErr } }() } ctx = templ.InitializeContext(ctx) templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "
Click to add description...
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } var templ_7745c5c3_Var6 string templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(comment.Text) if templ_7745c5c3_Err != nil { return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/web/routes/issue_detail.templ`, Line: 264, Col: 61} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "