summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCodeDoctor <20452814+CodeDoctorDE@users.noreply.github.com>2022-08-09 13:30:09 +0200
committerGitHub <noreply@github.com>2022-08-09 19:30:09 +0800
commit36f9ee5813beba0fc4b394a5db636f76afc5cc38 (patch)
treeebbef5f327a727745230c1361ae6d10be7e69b89
parent33b03e851f1a99f8d7fb682fec4bcba4f20ff6a8 (diff)
downloadgitea-36f9ee5813beba0fc4b394a5db636f76afc5cc38.tar.gz
gitea-36f9ee5813beba0fc4b394a5db636f76afc5cc38.zip
Add an option to create new issues from "/issues" page (#20650)
-rw-r--r--routers/web/user/home.go6
-rw-r--r--templates/user/dashboard/issues.tmpl3
2 files changed, 9 insertions, 0 deletions
diff --git a/routers/web/user/home.go b/routers/web/user/home.go
index 6482699804..f338c525b4 100644
--- a/routers/web/user/home.go
+++ b/routers/web/user/home.go
@@ -618,6 +618,12 @@ func buildIssueOverview(ctx *context.Context, unitType unit.Type) {
shownIssues += int(issueCountByRepo[repoID])
}
}
+ if len(repoIDs) == 1 {
+ repo := showReposMap[repoIDs[0]]
+ if repo != nil {
+ ctx.Data["SingleRepoLink"] = repo.Link()
+ }
+ }
ctx.Data["IsShowClosed"] = isShowClosed
diff --git a/templates/user/dashboard/issues.tmpl b/templates/user/dashboard/issues.tmpl
index b2f4863d6c..b6dc002154 100644
--- a/templates/user/dashboard/issues.tmpl
+++ b/templates/user/dashboard/issues.tmpl
@@ -99,6 +99,9 @@
<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>
</div>
</div>
+ {{if .SingleRepoLink}}
+ <a class="ui green button" href="{{.SingleRepoLink}}/issues/new/choose">{{.locale.Tr "repo.issues.new"}}</a>
+ {{end}}
</div>
</div>
{{template "shared/issuelist" mergeinto . "listType" "dashboard"}}