Skip to content

Commit 08daa7b

Browse files
CodeDoctorDESysoev, Vladimir
authored and
Sysoev, Vladimir
committed
Add an option to create new issues from "/issues" page (go-gitea#20650)
1 parent dc31534 commit 08daa7b

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

routers/web/user/home.go

+6
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

+3
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)