From 9713016637d2a034e2977133d2526709ce21dd38 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Sat, 11 Mar 2017 01:52:37 -0500 Subject: repo/branches: hide buttons for regular users --- templates/repo/branches/all.tmpl | 4 ++-- templates/repo/branches/overview.tmpl | 16 ++++++++++------ 2 files changed, 12 insertions(+), 8 deletions(-) (limited to 'templates/repo') 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 @@ {{$.i18n.Tr "repo.branches.updated_by" $timeSince .Commit.Committer.Name | Safe}}
- {{if eq $.BranchName .Name}} + {{if and (eq $.BranchName .Name) $.IsRepositoryWriter}} {{$.i18n.Tr "repo.branches.change_default_branch"}} - {{else}} + {{else if $.IsRepositoryAdmin}} {{$.i18n.Tr "repo.pulls.new"}} {{end}}
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}} {{$.i18n.Tr "repo.branches.updated_by" $timeSince .DefaultBranch.Commit.Committer.Name | Safe}} -
- {{.i18n.Tr "repo.branches.change_default_branch"}} -
+ {{if $.IsRepositoryAdmin}} +
+ {{.i18n.Tr "repo.branches.change_default_branch"}} +
+ {{end}} @@ -33,9 +35,11 @@ {{$timeSince := TimeSince .Commit.Committer.When $.Lang}} {{$.i18n.Tr "repo.branches.updated_by" $timeSince .Commit.Committer.Name | Safe}} -
- {{$.i18n.Tr "repo.pulls.new"}} -
+ {{if $.IsRepositoryWriter}} +
+ {{$.i18n.Tr "repo.pulls.new"}} +
+ {{end}} {{end}} -- cgit v1.2.3