Selaa lähdekoodia

Only show "New Pull Request" button if repo allows pulls (#7426) (#7432)

Signed-off-by: Gary Kim <gary@garykim.dev>
tags/v1.9.0-rc2
Gary Kim 4 vuotta sitten
vanhempi
commit
2477737fff
2 muutettua tiedostoa jossa 2 lisäystä ja 1 poistoa
  1. 1
    0
      routers/repo/branch.go
  2. 1
    1
      templates/repo/branch/list.tmpl

+ 1
- 0
routers/repo/branch.go Näytä tiedosto

@@ -39,6 +39,7 @@ func Branches(ctx *context.Context) {
ctx.Data["Title"] = "Branches"
ctx.Data["IsRepoToolbarBranches"] = true
ctx.Data["DefaultBranch"] = ctx.Repo.Repository.DefaultBranch
ctx.Data["AllowsPulls"] = ctx.Repo.Repository.AllowsPulls()
ctx.Data["IsWriter"] = ctx.Repo.CanWrite(models.UnitTypeCode)
ctx.Data["IsMirror"] = ctx.Repo.Repository.IsMirror
ctx.Data["PageIsViewCode"] = true

+ 1
- 1
templates/repo/branch/list.tmpl Näytä tiedosto

@@ -63,7 +63,7 @@
</td>
<td class="right aligned">
{{if not .LatestPullRequest}}
{{if not .IsDeleted}}
{{if and (not .IsDeleted) $.AllowsPulls}}
<a href="{{$.RepoLink}}/compare/{{$.DefaultBranch | EscapePound}}...{{if ne $.Repository.Owner.Name $.Owner.Name}}{{$.Owner.Name}}:{{end}}{{.Name | EscapePound}}">
<button id="new-pull-request" class="ui compact basic button">{{$.i18n.Tr "repo.pulls.compare_changes"}}</button>
</a>

Loading…
Peruuta
Tallenna