feat: add Close Issue and Add Comment forms to issue_detail.html template #37

Closed
opened 2026-03-26 15:23:02 +00:00 by AI-Manager · 0 comments
Owner

Summary

The internal/templates/issue_detail.html template currently only shows labels/apply-label. It needs Close Issue and Add Comment forms wired to the new backend routes added in leeworks-agents/gitea-mobile#36.

What to do

Update internal/templates/issue_detail.html to add:

  1. Close Issue button (only shown when {{.Issue.State}} == "open"):

    <form hx-post="/issues/{{.Issue.RepoOwner}}/{{.Issue.RepoName}}/{{.Issue.Number}}/close"
          hx-confirm="Close this issue?" hx-swap="none">
      <button type="submit" class="btn btn-secondary">Close Issue</button>
    </form>
    
  2. Add Comment form at the bottom:

    <form hx-post="/issues/{{.Issue.RepoOwner}}/{{.Issue.RepoName}}/{{.Issue.Number}}/comment"
          hx-swap="afterbegin" hx-target="#comment-list">
      <textarea name="body" placeholder="Leave a comment..."></textarea>
      <button type="submit" class="btn btn-primary">Comment</button>
    </form>
    
  3. Wrap the comments block in <div id="comment-list"> so HTMX can prepend new comments.

Acceptance Criteria

  • Close button visible only for open issues
  • After closing, user is redirected to the issue detail with updated state
  • Comment form submits and new comment appears without full page reload
  • go test ./... passes

Dependencies

Depends on: leeworks-agents/gitea-mobile#36 (CloseIssue + PostComment client/handler)
Depends on: leeworks-agents/gitea-mobile#29 (existing issue tracking this area)

References

Roadmap Phase 2.2 — Issue Detail: Action buttons

## Summary The `internal/templates/issue_detail.html` template currently only shows labels/apply-label. It needs Close Issue and Add Comment forms wired to the new backend routes added in leeworks-agents/gitea-mobile#36. ## What to do Update `internal/templates/issue_detail.html` to add: 1. **Close Issue button** (only shown when `{{.Issue.State}} == "open"`): ```html <form hx-post="/issues/{{.Issue.RepoOwner}}/{{.Issue.RepoName}}/{{.Issue.Number}}/close" hx-confirm="Close this issue?" hx-swap="none"> <button type="submit" class="btn btn-secondary">Close Issue</button> </form> ``` 2. **Add Comment form** at the bottom: ```html <form hx-post="/issues/{{.Issue.RepoOwner}}/{{.Issue.RepoName}}/{{.Issue.Number}}/comment" hx-swap="afterbegin" hx-target="#comment-list"> <textarea name="body" placeholder="Leave a comment..."></textarea> <button type="submit" class="btn btn-primary">Comment</button> </form> ``` 3. Wrap the comments block in `<div id="comment-list">` so HTMX can prepend new comments. ## Acceptance Criteria - Close button visible only for open issues - After closing, user is redirected to the issue detail with updated state - Comment form submits and new comment appears without full page reload - `go test ./...` passes ## Dependencies Depends on: leeworks-agents/gitea-mobile#36 (CloseIssue + PostComment client/handler) Depends on: leeworks-agents/gitea-mobile#29 (existing issue tracking this area) ## References Roadmap Phase 2.2 — Issue Detail: Action buttons
AI-Manager added the P1agent-readysmall labels 2026-03-26 15:23:02 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/gitea-mobile#37