Skip to content

Commit 5cfdc20

Browse files
committed
Add option to create new issue from /issues page
1 parent 7a31292 commit 5cfdc20

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-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+
var repo = showReposMap[repoIDs[0]]
623+
if repo != nil {
624+
ctx.Data["Repo"] = repo.OwnerName + "/" + repo.Name
625+
}
626+
}
621627

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

templates/user/dashboard/issues.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@
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+
{{template "user/dashboard/issues_create" .}}
102103
</div>
103104
</div>
104105
{{template "shared/issuelist" mergeinto . "listType" "dashboard"}}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{{if .Repo}}
2+
<a class="ui green button" href="{{AppSubUrl}}/{{.Repo}}/issues/new">{{.locale.Tr "repo.issues.new"}}</a>
3+
{{end}}

0 commit comments

Comments
 (0)