From 5c7cb1594b6904657bc63c50abc8b72056a85e4b Mon Sep 17 00:00:00 2001 From: Unknwon Date: Sat, 11 Mar 2017 01:43:45 -0500 Subject: repo/branches: overview and all (#2310) --- templates/repo/branches/all.tmpl | 31 ++++++++++++++++++ templates/repo/branches/navbar.tmpl | 4 +++ templates/repo/branches/overview.tmpl | 62 +++++++++++++++++++++++++++++++++++ templates/repo/home.tmpl | 3 ++ 4 files changed, 100 insertions(+) create mode 100644 templates/repo/branches/all.tmpl create mode 100644 templates/repo/branches/navbar.tmpl create mode 100644 templates/repo/branches/overview.tmpl (limited to 'templates/repo') diff --git a/templates/repo/branches/all.tmpl b/templates/repo/branches/all.tmpl new file mode 100644 index 00000000..24d3a449 --- /dev/null +++ b/templates/repo/branches/all.tmpl @@ -0,0 +1,31 @@ +{{template "base/head" .}} +
+ {{template "repo/header" .}} +
+ +
+ {{.i18n.Tr "repo.branches.all"}} +
+
+ {{range .Branches}} +
+
+ {{if .IsProtected}} {{end}}{{.Name}} + {{$timeSince := TimeSince .Commit.Committer.When $.Lang}} + {{$.i18n.Tr "repo.branches.updated_by" $timeSince .Commit.Committer.Name | Safe}} +
+
+ {{if eq $.BranchName .Name}} + {{$.i18n.Tr "repo.branches.change_default_branch"}} + {{else}} + {{$.i18n.Tr "repo.pulls.new"}} + {{end}} +
+
+ {{end}} +
+
+
+{{template "base/footer" .}} \ No newline at end of file diff --git a/templates/repo/branches/navbar.tmpl b/templates/repo/branches/navbar.tmpl new file mode 100644 index 00000000..3e83a65a --- /dev/null +++ b/templates/repo/branches/navbar.tmpl @@ -0,0 +1,4 @@ + diff --git a/templates/repo/branches/overview.tmpl b/templates/repo/branches/overview.tmpl new file mode 100644 index 00000000..16775d44 --- /dev/null +++ b/templates/repo/branches/overview.tmpl @@ -0,0 +1,62 @@ +{{template "base/head" .}} +
+ {{template "repo/header" .}} +
+ +
+ {{.i18n.Tr "repo.settings.default_branch"}} +
+
+
+
+ {{if .DefaultBranch.IsProtected}} {{end}}{{.DefaultBranch.Name}} + {{$timeSince := TimeSince .DefaultBranch.Commit.Committer.When $.Lang}} + {{$.i18n.Tr "repo.branches.updated_by" $timeSince .DefaultBranch.Commit.Committer.Name | Safe}} +
+ +
+
+ + {{if .ActiveBranches}} +
+ {{.i18n.Tr "repo.branches.active_branches"}} +
+
+ {{range .ActiveBranches}} +
+
+ {{if .IsProtected}} {{end}}{{.Name}} + {{$timeSince := TimeSince .Commit.Committer.When $.Lang}} + {{$.i18n.Tr "repo.branches.updated_by" $timeSince .Commit.Committer.Name | Safe}} +
+ +
+ {{end}} +
+ {{end}} + + {{if .StaleBranches}} +
+ {{.i18n.Tr "repo.branches.stale_branches"}} +
+
+ {{range .StaleBranches}} +
+
+ {{if .IsProtected}} {{end}}{{.Name}} + {{$timeSince := TimeSince .Commit.Committer.When $.Lang}} + {{$.i18n.Tr "repo.branches.updated_by" $timeSince .Commit.Committer.Name | Safe}} +
+
+ {{end}} +
+ {{end}} +
+
+{{template "base/footer" .}} \ No newline at end of file diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl index 1a8e0432..44b7d186 100644 --- a/templates/repo/home.tmpl +++ b/templates/repo/home.tmpl @@ -14,6 +14,9 @@ {{.CommitsCount}} {{.i18n.Tr "repo.commits"}}
+ {{.BrancheCount}} {{.i18n.Tr "repo.git_branches"}} +
+
{{.Repository.NumTags}} {{.i18n.Tr "repo.releases"}}
-- cgit v1.2.3