summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--routers/web/user/home.go2
-rw-r--r--templates/user/dashboard/issues.tmpl6
2 files changed, 7 insertions, 1 deletions
diff --git a/routers/web/user/home.go b/routers/web/user/home.go
index f28a684054..c4aa749ce2 100644
--- a/routers/web/user/home.go
+++ b/routers/web/user/home.go
@@ -301,6 +301,7 @@ func Pulls(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("pull_requests")
ctx.Data["PageIsPulls"] = true
+ ctx.Data["SingleRepoAction"] = "pull"
buildIssueOverview(ctx, unit.TypePullRequests)
}
@@ -314,6 +315,7 @@ func Issues(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("issues")
ctx.Data["PageIsIssues"] = true
+ ctx.Data["SingleRepoAction"] = "issue"
buildIssueOverview(ctx, unit.TypeIssues)
}
diff --git a/templates/user/dashboard/issues.tmpl b/templates/user/dashboard/issues.tmpl
index b6dc002154..666a7bdb2a 100644
--- a/templates/user/dashboard/issues.tmpl
+++ b/templates/user/dashboard/issues.tmpl
@@ -100,7 +100,11 @@
</div>
</div>
{{if .SingleRepoLink}}
- <a class="ui green button" href="{{.SingleRepoLink}}/issues/new/choose">{{.locale.Tr "repo.issues.new"}}</a>
+ {{if eq .SingleRepoAction "issue"}}
+ <a class="ui green button" href="{{.SingleRepoLink}}/issues/new/choose">{{.locale.Tr "repo.issues.new"}}</a>
+ {{else if eq .SingleRepoAction "pull"}}
+ <a class="ui green button" href="{{.SingleRepoLink}}/compare">{{.locale.Tr "repo.pulls.new"}}</a>
+ {{end}}
{{end}}
</div>
</div>