diff --git a/templates/repo/branch/list.tmpl b/templates/repo/branch/list.tmpl index fffe3a08cc4bf..0331f124669a6 100644 --- a/templates/repo/branch/list.tmpl +++ b/templates/repo/branch/list.tmpl @@ -15,58 +15,65 @@
-
- {{.DefaultBranchBranch.DBBranch.Name}}
- {{if .DefaultBranchBranch.IsProtected}}
- {{svg "octicon-shield-lock"}}
- {{end}}
-
- {{template "repo/commit_statuses" dict "Status" (index $.CommitStatus .DefaultBranchBranch.DBBranch.CommitID) "Statuses" (index $.CommitStatuses .DefaultBranchBranch.DBBranch.CommitID)}}
-
- {{svg "octicon-git-commit" 16 "tw-mr-1"}}{{ShortSha .DefaultBranchBranch.DBBranch.CommitID}} · · {{ctx.Locale.Tr "org.repo_updated"}} {{DateUtils.TimeSince .DefaultBranchBranch.DBBranch.CommitTime}}{{if .DefaultBranchBranch.DBBranch.Pusher}} {{template "shared/user/avatarlink" dict "user" .DefaultBranchBranch.DBBranch.Pusher}}{{template "shared/user/namelink" .DefaultBranchBranch.DBBranch.Pusher}}{{end}} - |
- {{/* FIXME: here and below, the tw-overflow-visible is not quite right but it is still needed the moment: to show the important buttons when the width is narrow */}}
-
- {{if and $.IsWriter (not $.Repository.IsArchived) (not .IsDeleted)}}
-
+
+
+
+
+ {{.DefaultBranchBranch.DBBranch.Name}}
+ {{if .DefaultBranchBranch.IsProtected}}
+ {{svg "octicon-shield-lock"}}
{{end}}
- {{if .EnableFeed}}
- {{svg "octicon-rss"}}
+
+ {{ShortSha .DefaultBranchBranch.DBBranch.CommitID}}
+ {{template "repo/commit_statuses" dict "Status" (index $.CommitStatus .DefaultBranchBranch.DBBranch.CommitID) "Statuses" (index $.CommitStatuses .DefaultBranchBranch.DBBranch.CommitID)}}
+
+
+
+ {{ctx.AvatarUtils.Avatar .DefaultBranchBranch.DBBranch.Pusher 20}}
+ {{.DefaultBranchBranch.DBBranch.Pusher.GetDisplayName}}
+
{{end}}
- {{if not $.DisableDownloadSourceArchives}}
-
+ ·
+ {{if and .DefaultBranchBranch.DBBranch.Pusher (gt .DefaultBranchBranch.DBBranch.Pusher.ID 0)}}
+
- {{svg "octicon-download"}}
-
+
+ {{DateUtils.TimeSince .DefaultBranchBranch.DBBranch.CommitTime}}
+
+ {{if and $.IsWriter (not $.Repository.IsArchived) (not .IsDeleted)}}
+
+ {{end}}
+ {{if .EnableFeed}}
+ {{svg "octicon-rss"}}
+ {{end}}
+ {{if not $.DisableDownloadSourceArchives}}
+
+ {{svg "octicon-download"}}
+
- {{end}}
- {{if and $.IsWriter (not $.Repository.IsArchived) (not .IsDeleted) (not $.IsMirror)}}
-
- {{end}}
- |
-
- {{if .DBBranch.IsDeleted}}
-
- {{.DBBranch.Name}}
-
-
- {{ctx.Locale.Tr "repo.branch.deleted_by" .DBBranch.DeletedBy.Name}} {{DateUtils.TimeSince .DBBranch.DeletedUnix}} - {{else}} -
- {{.DBBranch.Name}}
+
+ {{range .Branches}}
+
+
+
+ {{if .DBBranch.IsDeleted}}
+ {{.DBBranch.Name}}
+
+ {{else}}
+ {{.DBBranch.Name}}
{{if .IsProtected}}
{{svg "octicon-shield-lock"}}
{{end}}
+ {{ShortSha .DBBranch.CommitID}}
{{template "repo/commit_statuses" dict "Status" (index $.CommitStatus .DBBranch.CommitID) "Statuses" (index $.CommitStatuses .DBBranch.CommitID)}}
-
- {{svg "octicon-git-commit" 16 "tw-mr-1"}}{{ShortSha .DBBranch.CommitID}} · · {{ctx.Locale.Tr "org.repo_updated"}} {{DateUtils.TimeSince .DBBranch.CommitTime}}{{if .DBBranch.Pusher}} {{template "shared/user/avatarlink" dict "user" .DBBranch.Pusher}} {{template "shared/user/namelink" .DBBranch.Pusher}}{{end}} - {{end}} - |
-
- {{if and (not .DBBranch.IsDeleted) $.DefaultBranchBranch}}
-
-
{{end}}
-
-
- |
-
+
+
+ {{if .DBBranch.IsDeleted}}
+ {{ctx.Locale.Tr "repo.branch.deleted_by" .DBBranch.DeletedBy.Name}} {{DateUtils.TimeSince .DBBranch.DeletedUnix}}
+ {{else}}
+
+ {{ctx.AvatarUtils.Avatar .DBBranch.Pusher 20}}
+ {{.DBBranch.Pusher.GetDisplayName}}
+
+ {{end}}
+ {{DateUtils.TimeSince .DBBranch.CommitTime}}
+ {{end}}
+
+ ·
+ {{if and .DBBranch.Pusher (gt .DBBranch.Pusher.ID 0)}}
+
{{if not .LatestPullRequest}}
{{if .IsIncluded}}
-
+
{{svg "octicon-git-pull-request"}} {{ctx.Locale.Tr "repo.branch.included"}}
{{else if and (not .DBBranch.IsDeleted) $.AllowsPulls (gt .CommitsAhead 0)}}
-
-
+
+ {{if $.CanPull}}{{ctx.Locale.Tr "repo.pulls.compare_changes"}}{{else}}{{ctx.Locale.Tr "action.compare_branch"}}{{end}}
{{end}}
{{else if and .LatestPullRequest.HasMerged .MergeMovedOn}}
{{if and (not .DBBranch.IsDeleted) $.AllowsPulls (gt .CommitsAhead 0)}}
-
-
+
+ {{if $.CanPull}}{{ctx.Locale.Tr "repo.pulls.compare_changes"}}{{else}}{{ctx.Locale.Tr "action.compare_branch"}}{{end}}
{{end}}
{{else}}
{{if not .LatestPullRequest.IsSameRepo}}{{.LatestPullRequest.BaseRepo.FullName}}{{end}}#{{.LatestPullRequest.Issue.Index}}
{{if .LatestPullRequest.HasMerged}}
- {{svg "octicon-git-merge" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.pulls.merged"}}
+ {{svg "octicon-git-merge" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.pulls.merged"}}
{{else if .LatestPullRequest.Issue.IsClosed}}
- {{svg "octicon-git-pull-request-closed" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.issues.closed_title"}}
+ {{svg "octicon-git-pull-request-closed" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.issues.closed_title"}}
{{else}}
- {{svg "octicon-git-pull-request" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.issues.open_title"}}
+ {{svg "octicon-git-pull-request" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.issues.open_title"}}
{{end}}
{{end}}
- |
- {{/* FIXME: here and above, the tw-overflow-visible is not quite right */}}
-
- {{if and $.IsWriter (not $.Repository.IsArchived) (not .DBBranch.IsDeleted)}}
-
- {{end}}
- {{if $.EnableFeed}}
- {{svg "octicon-rss"}}
- {{end}}
- {{if and (not .DBBranch.IsDeleted) (not $.DisableDownloadSourceArchives)}}
-
- {{svg "octicon-download"}}
-
+
+
+ {{if and (not .DBBranch.IsDeleted) $.DefaultBranchBranch}}
+
+
{{end}}
- {{if and $.IsWriter (not $.Repository.IsArchived) (not .DBBranch.IsDeleted) (not $.IsMirror)}}
-
+
+
+ {{if and $.IsWriter (not $.Repository.IsArchived) (not .DBBranch.IsDeleted)}}
+
+ {{end}}
+ {{if $.EnableFeed}}
+
+ {{svg "octicon-rss"}}
+
+ {{end}}
+ {{if and (not .DBBranch.IsDeleted) (not $.DisableDownloadSourceArchives)}}
+
+ {{svg "octicon-download"}}
+
+ {{end}}
+ {{if and $.IsWriter (not $.Repository.IsArchived) (not .DBBranch.IsDeleted) (not $.IsMirror)}}
+
+ {{end}}
+ {{if and $.IsWriter (not $.IsMirror) (not $.Repository.IsArchived) (not .IsProtected)}}
+ {{if .DBBranch.IsDeleted}}
+
+ {{else}}
+
{{end}}
- {{if and $.IsWriter (not $.IsMirror) (not $.Repository.IsArchived) (not .IsProtected)}}
- {{if .DBBranch.IsDeleted}}
-
- {{else}}
-
- {{end}}
- {{end}}
-
+ |
-