Skip to content

Commit

Permalink
Allow adding multiple issues to a project (go-gitea#17226)
Browse files Browse the repository at this point in the history
Adds an option like for adding multiple issues to a milestone.
Closes go-gitea#17216
  • Loading branch information
qwerty287 authored and Stelios Malathouras committed Oct 15, 2021
1 parent 8f630f3 commit 8e78eeb
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
14 changes: 14 additions & 0 deletions routers/web/repo/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,20 @@ func issues(ctx *context.Context, milestoneID, projectID int64, isPullOption uti
}
return 0
}

if ctx.Repo.CanWriteIssuesOrPulls(ctx.Params(":type") == "pulls") {
projects, _, err := models.GetProjects(models.ProjectSearchOptions{
RepoID: repo.ID,
Type: models.ProjectTypeRepository,
IsClosed: util.OptionalBoolOf(isShowClosed),
})
if err != nil {
ctx.ServerError("GetProjects", err)
return
}
ctx.Data["Projects"] = projects
}

ctx.Data["IssueStats"] = issueStats
ctx.Data["SelLabelIDs"] = labelIDs
ctx.Data["SelectLabels"] = selectLabels
Expand Down
18 changes: 18 additions & 0 deletions templates/repo/issue/list.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,24 @@
</div>
</div>

<!-- Projects -->
<div class="ui {{if not .Projects}}disabled{{end}} dropdown jump item">
<span class="text">
{{.i18n.Tr "repo.project_board"}}
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
</span>
<div class="menu">
<div class="item issue-action" data-element-id="0" data-url="{{$.Link}}/projects">
{{.i18n.Tr "repo.issues.new.no_projects"}}
</div>
{{range .Projects}}
<div class="item issue-action" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/projects">
{{.Title}}
</div>
{{end}}
</div>
</div>

<!-- Assignees -->
<div class="ui {{if not .Assignees}}disabled{{end}} dropdown jump item">
<span class="text">
Expand Down

0 comments on commit 8e78eeb

Please sign in to comment.