0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-11-24 20:12:49 +01:00

Fix new pull request link (#3133)

* Fix new pull request link

* Only show button for branches
This commit is contained in:
Ethan Koenig 2017-12-12 21:06:25 -08:00 committed by Lunny Xiao
parent e693fda325
commit 0b77dbc11c
2 changed files with 2 additions and 3 deletions

View file

@ -427,7 +427,6 @@ func RepoAssignment() macaron.Handler {
return
}
}
ctx.Data["IsForkedRepo"] = repo.IsFork
// People who have push access or have forked repository can propose a new pull request.
if ctx.Repo.IsWriter() || (ctx.IsSigned && ctx.User.HasForkedRepo(ctx.Repo.Repository.ID)) {

View file

@ -25,9 +25,9 @@
</div>
{{template "repo/sub_menu" .}}
<div class="ui secondary menu">
{{if .PullRequestCtx.Allowed}}
{{if and .PullRequestCtx.Allowed .IsViewBranch}}
<div class="fitted item">
<a href="{{.BaseRepo.Link}}/compare/{{.BaseRepo.DefaultBranch}}...{{if .IsForkedRepo}}{{.Repository.Owner.Name}}:{{else}}{{if .SignedUser.HasForkedRepo .BaseRepo.ID}}{{.SignedUser.Name}}:{{end}}{{end}}{{.BranchName}}">
<a href="{{.BaseRepo.Link}}/compare/{{.BaseRepo.DefaultBranch}}...{{.Repository.Owner.Name}}:{{.BranchName}}">
<button class="ui green tiny compact button"><i class="octicon octicon-git-compare"></i></button>
</a>
</div>