Skip to content

Commit

Permalink
Add an option to create new issues from "/issues" page (go-gitea#20650)
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeDoctorDE authored and Sysoev, Vladimir committed Aug 10, 2022
1 parent dc31534 commit 08daa7b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions routers/web/user/home.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions templates/user/dashboard/issues.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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"}}
Expand Down

0 comments on commit 08daa7b

Please sign in to comment.