Skip to content

Commit 36f9ee5

Browse files
authored
Add an option to create new issues from "/issues" page (#20650)
1 parent 33b03e8 commit 36f9ee5

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

routers/web/user/home.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,12 @@ func buildIssueOverview(ctx *context.Context, unitType unit.Type) {
618618
shownIssues += int(issueCountByRepo[repoID])
619619
}
620620
}
621+
if len(repoIDs) == 1 {
622+
repo := showReposMap[repoIDs[0]]
623+
if repo != nil {
624+
ctx.Data["SingleRepoLink"] = repo.Link()
625+
}
626+
}
621627

622628
ctx.Data["IsShowClosed"] = isShowClosed
623629

templates/user/dashboard/issues.tmpl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@
9999
<a class="{{if eq .SortType "farduedate"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort=farduedate&state={{$.State}}&q={{$.Keyword}}">{{.locale.Tr "repo.issues.filter_sort.farduedate"}}</a>
100100
</div>
101101
</div>
102+
{{if .SingleRepoLink}}
103+
<a class="ui green button" href="{{.SingleRepoLink}}/issues/new/choose">{{.locale.Tr "repo.issues.new"}}</a>
104+
{{end}}
102105
</div>
103106
</div>
104107
{{template "shared/issuelist" mergeinto . "listType" "dashboard"}}

0 commit comments

Comments
 (0)