aboutsummaryrefslogtreecommitdiff
path: root/templates/repo/branches/overview.tmpl
blob: f8becf9d3785dc71596b97ad3f3586b22c62fa77 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
{{template "base/head" .}}
<div class="repository branches overview">
	{{template "repo/header" .}}
	<div class="ui container">
		<div class="navbar">
			{{template "repo/branches/navbar" .}}
		</div>
		<div class="ui top attached header">
			{{.i18n.Tr "repo.settings.default_branch"}}
		</div>
		<div class="ui attached segment list">
			<div class="item ui grid">
				<div class="ui eleven wide column">
					{{if .DefaultBranch.IsProtected}}<i class="octicon octicon-shield"></i> {{end}}<a class="markdown" href="{{$.RepoLink}}/src/{{EscapePound .DefaultBranch.Name}}"><code>{{.DefaultBranch.Name}}</code></a>
					{{$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 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>
				{{end}}
			</div>
		</div>

		{{if .ActiveBranches}}
			<div class="ui top attached header">
				{{.i18n.Tr "repo.branches.active_branches"}}
			</div>
			<div class="ui attached segment list">
				{{range .ActiveBranches}}
					<div class="item ui grid">
						<div class="ui eleven wide column">
							{{if .IsProtected}}<i class="octicon octicon-shield"></i> {{end}}<a class="markdown" href="{{$.RepoLink}}/src/{{EscapePound .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/{{EscapePound $.BranchName}}...{{EscapePound .Name}}"><i class="octicon octicon-git-pull-request"></i> {{$.i18n.Tr "repo.pulls.new"}}</a>
							</div>
						{{end}}
					</div>
				{{end}}
			</div>
		{{end}}

		{{if .StaleBranches}}
			<div class="ui top attached header">
				{{.i18n.Tr "repo.branches.stale_branches"}}
			</div>
			<div class="ui attached segment list">
				{{range .StaleBranches}}
					<div class="item ui grid">
						<div class="ui eleven wide column">
							{{if .IsProtected}}<i class="octicon octicon-shield"></i> {{end}}<a class="markdown" href="{{$.RepoLink}}/src/{{EscapePound .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/{{EscapePound $.BranchName}}...{{EscapePound .Name}}"><i class="octicon octicon-git-pull-request"></i> {{$.i18n.Tr "repo.pulls.new"}}</a>
							</div>
						{{end}}
					</div>
				{{end}}
			</div>
		{{end}}
	</div>
</div>
{{template "base/footer" .}}