瀏覽代碼

Fix new pull request link (#3133)

* Fix new pull request link

* Only show button for branches
tags/v1.4.0-rc1
Ethan Koenig 6 年之前
父節點
當前提交
0b77dbc11c
共有 2 個檔案被更改,包括 2 行新增3 行删除
  1. 0
    1
      modules/context/repo.go
  2. 2
    2
      templates/repo/home.tmpl

+ 0
- 1
modules/context/repo.go 查看文件

@@ -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)) {

+ 2
- 2
templates/repo/home.tmpl 查看文件

@@ -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>

Loading…
取消
儲存