From 624474386aa51b74fdbee04bb85aaa957a22b99c Mon Sep 17 00:00:00 2001 From: Unknwon Date: Wed, 5 Apr 2017 17:59:22 -0400 Subject: templates/repo/branches: fix links for mirror repository Also added new pull request button for stale branches. --- templates/repo/branches/all.tmpl | 4 ++-- templates/repo/branches/overview.tmpl | 11 ++++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/templates/repo/branches/all.tmpl b/templates/repo/branches/all.tmpl index f962884d..d4ea3076 100644 --- a/templates/repo/branches/all.tmpl +++ b/templates/repo/branches/all.tmpl @@ -17,10 +17,10 @@ {{$.i18n.Tr "repo.branches.updated_by" $timeSince .Commit.Committer.Name | Safe}}
- {{if and (eq $.BranchName .Name) $.IsRepositoryWriter}} + {{if and (and (eq $.BranchName .Name) $.IsRepositoryAdmin) (not $.Repository.IsMirror)}} {{$.i18n.Tr "repo.branches.change_default_branch"}} {{else if and $.IsRepositoryWriter $.AllowPullRequest}} - {{$.i18n.Tr "repo.pulls.new"}} + {{$.i18n.Tr "repo.pulls.new"}} {{end}}
diff --git a/templates/repo/branches/overview.tmpl b/templates/repo/branches/overview.tmpl index 921bce24..f4614369 100644 --- a/templates/repo/branches/overview.tmpl +++ b/templates/repo/branches/overview.tmpl @@ -15,7 +15,7 @@ {{$timeSince := TimeSince .DefaultBranch.Commit.Committer.When $.Lang}} {{$.i18n.Tr "repo.branches.updated_by" $timeSince .DefaultBranch.Commit.Committer.Name | Safe}} - {{if $.IsRepositoryAdmin}} + {{if and $.IsRepositoryAdmin (not $.Repository.IsMirror)}}
{{.i18n.Tr "repo.branches.change_default_branch"}}
@@ -37,7 +37,7 @@ {{if and $.IsRepositoryWriter $.AllowPullRequest}}
- {{$.i18n.Tr "repo.pulls.new"}} + {{$.i18n.Tr "repo.pulls.new"}}
{{end}} @@ -52,11 +52,16 @@
{{range .StaleBranches}}
-
+
{{if .IsProtected}} {{end}}{{.Name}} {{$timeSince := TimeSince .Commit.Committer.When $.Lang}} {{$.i18n.Tr "repo.branches.updated_by" $timeSince .Commit.Committer.Name | Safe}}
+ {{if and $.IsRepositoryWriter $.AllowPullRequest}} + + {{end}}
{{end}}
-- cgit v1.2.3