aboutsummaryrefslogtreecommitdiff
path: root/templates/repo
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2017-04-03 22:24:21 -0400
committerUnknwon <u@gogs.io>2017-04-03 22:24:21 -0400
commitb873ec2bcea6d7b6205925646275c27f7f157a93 (patch)
tree08c3551d2b0f715ca072b035a6690907e4e085b4 /templates/repo
parent1bc805bb4b1f9d3afbbce357939b28594e372c58 (diff)
templates/repo/branches: hide pull request button if not allowed (#4377)
Diffstat (limited to 'templates/repo')
-rw-r--r--templates/repo/branches/all.tmpl2
-rw-r--r--templates/repo/branches/overview.tmpl2
2 files changed, 2 insertions, 2 deletions
diff --git a/templates/repo/branches/all.tmpl b/templates/repo/branches/all.tmpl
index d374acaa..f962884d 100644
--- a/templates/repo/branches/all.tmpl
+++ b/templates/repo/branches/all.tmpl
@@ -19,7 +19,7 @@
<div class="ui four wide column">
{{if and (eq $.BranchName .Name) $.IsRepositoryWriter}}
<a class="ui basic blue button" href="{{$.RepoLink}}/settings/branches">{{$.i18n.Tr "repo.branches.change_default_branch"}}</a>
- {{else if $.IsRepositoryAdmin}}
+ {{else if and $.IsRepositoryWriter $.AllowPullRequest}}
<a class="ui basic button" href="{{$.RepoLink}}/compare/{{$.DefaultBranch.Name}}...{{.Name}}"><i class="octicon octicon-git-pull-request"></i> {{$.i18n.Tr "repo.pulls.new"}}</a>
{{end}}
</div>
diff --git a/templates/repo/branches/overview.tmpl b/templates/repo/branches/overview.tmpl
index be31e7f5..921bce24 100644
--- a/templates/repo/branches/overview.tmpl
+++ b/templates/repo/branches/overview.tmpl
@@ -35,7 +35,7 @@
{{$timeSince := TimeSince .Commit.Committer.When $.Lang}}
<span class="ui text light grey">{{$.i18n.Tr "repo.branches.updated_by" $timeSince .Commit.Committer.Name | Safe}}</span>
</div>
- {{if $.IsRepositoryWriter}}
+ {{if and $.IsRepositoryWriter $.AllowPullRequest}}
<div class="ui four wide column">
<a class="ui basic button" href="{{$.RepoLink}}/compare/{{$.DefaultBranch.Name}}...{{.Name}}"><i class="octicon octicon-git-pull-request"></i> {{$.i18n.Tr "repo.pulls.new"}}</a>
</div>