diff options
author | Unknwon <u@gogs.io> | 2017-03-11 01:52:37 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2017-03-11 01:52:37 -0500 |
commit | 9713016637d2a034e2977133d2526709ce21dd38 (patch) | |
tree | b0215aa282212903c3ae5a02118e7deb78057c4f /templates/repo | |
parent | 5c7cb1594b6904657bc63c50abc8b72056a85e4b (diff) |
repo/branches: hide buttons for regular users
Diffstat (limited to 'templates/repo')
-rw-r--r-- | templates/repo/branches/all.tmpl | 4 | ||||
-rw-r--r-- | templates/repo/branches/overview.tmpl | 16 |
2 files changed, 12 insertions, 8 deletions
diff --git a/templates/repo/branches/all.tmpl b/templates/repo/branches/all.tmpl index 24d3a449..d374acaa 100644 --- a/templates/repo/branches/all.tmpl +++ b/templates/repo/branches/all.tmpl @@ -17,9 +17,9 @@ <span class="ui text light grey">{{$.i18n.Tr "repo.branches.updated_by" $timeSince .Commit.Committer.Name | Safe}}</span> </div> <div class="ui four wide column"> - {{if eq $.BranchName .Name}} + {{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}} + {{else if $.IsRepositoryAdmin}} <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 16775d44..be31e7f5 100644 --- a/templates/repo/branches/overview.tmpl +++ b/templates/repo/branches/overview.tmpl @@ -15,9 +15,11 @@ {{$timeSince := TimeSince .DefaultBranch.Commit.Committer.When $.Lang}} <span class="ui text light grey">{{$.i18n.Tr "repo.branches.updated_by" $timeSince .DefaultBranch.Commit.Committer.Name | Safe}}</span> </div> - <div class="ui four wide column"> - <a class="ui basic blue button" href="{{$.RepoLink}}/settings/branches">{{.i18n.Tr "repo.branches.change_default_branch"}}</a> - </div> + {{if $.IsRepositoryAdmin}} + <div class="ui four wide column"> + <a class="ui basic blue button" href="{{$.RepoLink}}/settings/branches">{{.i18n.Tr "repo.branches.change_default_branch"}}</a> + </div> + {{end}} </div> </div> @@ -33,9 +35,11 @@ {{$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> - <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> + {{if $.IsRepositoryWriter}} + <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> + {{end}} </div> {{end}} </div> |