From 6f452a5f9ee8b7b129f6b118315dbcd39ba47991 Mon Sep 17 00:00:00 2001 From: Ine Maria Nilssen Aanonsen Date: Tue, 17 Mar 2026 15:47:40 +0100 Subject: [PATCH] LPM-81: Assign to me --- pkg/web/components/assignee_form.templ | 29 +++++++++++++++++++------- pkg/web/handler/issues.go | 7 ++++++- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/pkg/web/components/assignee_form.templ b/pkg/web/components/assignee_form.templ index e67032c..89f9cc2 100644 --- a/pkg/web/components/assignee_form.templ +++ b/pkg/web/components/assignee_form.templ @@ -12,12 +12,27 @@ templ AssigneeForm(props AssigneeFormProps) { hx-patch={ props.PatchAction } hx-swap="innerHTML" > - @base.Input(base.InputProps{ - Name: "assignee", - Type: "text", - Placeholder: "Enter assingee", - Value: props.Assignee, - }) - +
+ + if props.Assignee != "" { +

+ Current assignee: { props.Assignee } +

+ } +
+ } diff --git a/pkg/web/handler/issues.go b/pkg/web/handler/issues.go index 3f48bc1..dbcaa94 100644 --- a/pkg/web/handler/issues.go +++ b/pkg/web/handler/issues.go @@ -196,7 +196,12 @@ func UpdateIssue(w http.ResponseWriter, r *http.Request) { func UpdateAssignee(w http.ResponseWriter, r *http.Request) { issue := r.Context().Value(issueKey).(*models.Issue) - assignee := r.FormValue("assignee") + assignMe := r.FormValue("assign_me") + + assignee := "" + if assignMe != "" { + assignee = "Me" + } if err := App(r).Issues.UpdateIssue(r.Context(), issue.ID, map[string]any{"assignee": assignee}, ""); err != nil { http.Error(w, "Failed to update assignee", http.StatusInternalServerError)