aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2017-04-05 17:59:22 -0400
committerUnknwon <u@gogs.io>2017-04-05 17:59:22 -0400
commit624474386aa51b74fdbee04bb85aaa957a22b99c (patch)
treee6a26057f43568ad47f1d6898bc9c92036ab926e
parente0a787b5ee077498abf0f8ea78395aec16b90c71 (diff)
templates/repo/branches: fix links for mirror repository
Also added new pull request button for stale branches.
-rw-r--r--templates/repo/branches/all.tmpl4
-rw-r--r--templates/repo/branches/overview.tmpl11
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 @@
<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 and (eq $.BranchName .Name) $.IsRepositoryWriter}}
+ {{if and (and (eq $.BranchName .Name) $.IsRepositoryAdmin) (not $.Repository.IsMirror)}}
<a class="ui basic blue button" href="{{$.RepoLink}}/settings/branches">{{$.i18n.Tr "repo.branches.change_default_branch"}}</a>
{{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>
+ <a class="ui basic button" href="{{$.RepoLink}}/compare/{{$.BranchName}}...{{.Name}}"><i class="octicon octicon-git-pull-request"></i> {{$.i18n.Tr "repo.pulls.new"}}</a>
{{end}}
</div>
</div>
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}}
<span class="ui text light grey">{{$.i18n.Tr "repo.branches.updated_by" $timeSince .DefaultBranch.Commit.Committer.Name | Safe}}</span>
</div>
- {{if $.IsRepositoryAdmin}}
+ {{if and $.IsRepositoryAdmin (not $.Repository.IsMirror)}}
<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>
@@ -37,7 +37,7 @@
</div>
{{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>
+ <a class="ui basic button" href="{{$.RepoLink}}/compare/{{$.BranchName}}...{{.Name}}"><i class="octicon octicon-git-pull-request"></i> {{$.i18n.Tr "repo.pulls.new"}}</a>
</div>
{{end}}
</div>
@@ -52,11 +52,16 @@
<div class="ui attached segment list">
{{range .StaleBranches}}
<div class="item ui grid">
- <div class="ui fourteen wide column">
+ <div class="ui eleven wide column">
{{if .IsProtected}}<i class="octicon octicon-shield"></i> {{end}}<a class="markdown" href="{{$.RepoLink}}/src/{{.Name}}"><code>{{.Name}}</code></a>
{{$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 and $.IsRepositoryWriter $.AllowPullRequest}}
+ <div class="ui four wide column">
+ <a class="ui basic button" href="{{$.RepoLink}}/compare/{{$.BranchName}}...{{.Name}}"><i class="octicon octicon-git-pull-request"></i> {{$.i18n.Tr "repo.pulls.new"}}</a>
+ </div>
+ {{end}}
</div>
{{end}}
</div>