diff options
author | Unknwon <u@gogs.io> | 2015-11-16 11:20:11 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-11-16 11:20:11 -0500 |
commit | d370effca5c0544c4a1877e1fa9b08703feaa82d (patch) | |
tree | dab7a238668cfb1eb9144671d9a3a9f1e5033f7a | |
parent | 29ed7872f807db590d9127cf9f447fb0ac34b40c (diff) | |
download | gitea-d370effca5c0544c4a1877e1fa9b08703feaa82d.tar.gz gitea-d370effca5c0544c4a1877e1fa9b08703feaa82d.zip |
minor fix for #1961
-rw-r--r-- | routers/repo/issue.go | 1 | ||||
-rw-r--r-- | templates/repo/issue/view.tmpl | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/routers/repo/issue.go b/routers/repo/issue.go index 639117b8c3..cf6687fe9c 100644 --- a/routers/repo/issue.go +++ b/routers/repo/issue.go @@ -494,6 +494,7 @@ func ViewIssue(ctx *middleware.Context) { ctx.Data["PageIsPullList"] = true ctx.Data["PageIsPullConversation"] = true + ctx.Data["HasForkedRepo"] = ctx.IsSigned && ctx.User.HasForkedRepo(ctx.Repo.Repository.ID) } else { ctx.Data["PageIsIssueList"] = true } diff --git a/templates/repo/issue/view.tmpl b/templates/repo/issue/view.tmpl index dff8910b88..506e4e3f04 100644 --- a/templates/repo/issue/view.tmpl +++ b/templates/repo/issue/view.tmpl @@ -5,7 +5,11 @@ <div class="navbar"> {{template "repo/issue/navbar" .}} <div class="ui right"> - <a class="ui green button" href="{{$.RepoLink}}/issues/new">{{.i18n.Tr "repo.issues.new"}}</a> + {{if .PageIsIssueList}} + <a class="ui green button" href="{{.RepoLink}}/issues/new">{{.i18n.Tr "repo.issues.new"}}</a> + {{else}} + <a class="ui green button {{if not .HasForkedRepo}}disabled{{end}}" href="{{.RepoLink}}/compare/{{.BranchName}}...{{.SignedUserName}}:{{.BranchName}}">{{.i18n.Tr "repo.pulls.new"}}</a> + {{end}} </div> </div> <div class="ui divider"></div> |