overview.tmpl 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. {{template "base/head" .}}
  2. <div class="repository branches overview">
  3. {{template "repo/header" .}}
  4. <div class="ui container">
  5. <div class="navbar">
  6. {{template "repo/branches/navbar" .}}
  7. </div>
  8. <div class="ui top attached header">
  9. {{.i18n.Tr "repo.settings.default_branch"}}
  10. </div>
  11. <div class="ui attached segment list">
  12. <div class="item ui grid">
  13. <div class="ui eleven wide column">
  14. {{if .DefaultBranch.IsProtected}}<i class="octicon octicon-shield"></i> {{end}}<a class="markdown" href="{{$.RepoLink}}/src/{{.DefaultBranch.Name}}"><code>{{.DefaultBranch.Name}}</code></a>
  15. {{$timeSince := TimeSince .DefaultBranch.Commit.Committer.When $.Lang}}
  16. <span class="ui text light grey">{{$.i18n.Tr "repo.branches.updated_by" $timeSince .DefaultBranch.Commit.Committer.Name | Safe}}</span>
  17. </div>
  18. {{if $.IsRepositoryAdmin}}
  19. <div class="ui four wide column">
  20. <a class="ui basic blue button" href="{{$.RepoLink}}/settings/branches">{{.i18n.Tr "repo.branches.change_default_branch"}}</a>
  21. </div>
  22. {{end}}
  23. </div>
  24. </div>
  25. {{if .ActiveBranches}}
  26. <div class="ui top attached header">
  27. {{.i18n.Tr "repo.branches.active_branches"}}
  28. </div>
  29. <div class="ui attached segment list">
  30. {{range .ActiveBranches}}
  31. <div class="item ui grid">
  32. <div class="ui eleven wide column">
  33. {{if .IsProtected}}<i class="octicon octicon-shield"></i> {{end}}<a class="markdown" href="{{$.RepoLink}}/src/{{.Name}}"><code>{{.Name}}</code></a>
  34. {{$timeSince := TimeSince .Commit.Committer.When $.Lang}}
  35. <span class="ui text light grey">{{$.i18n.Tr "repo.branches.updated_by" $timeSince .Commit.Committer.Name | Safe}}</span>
  36. </div>
  37. {{if and $.IsRepositoryWriter $.AllowPullRequest}}
  38. <div class="ui four wide column">
  39. <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>
  40. </div>
  41. {{end}}
  42. </div>
  43. {{end}}
  44. </div>
  45. {{end}}
  46. {{if .StaleBranches}}
  47. <div class="ui top attached header">
  48. {{.i18n.Tr "repo.branches.stale_branches"}}
  49. </div>
  50. <div class="ui attached segment list">
  51. {{range .StaleBranches}}
  52. <div class="item ui grid">
  53. <div class="ui fourteen wide column">
  54. {{if .IsProtected}}<i class="octicon octicon-shield"></i> {{end}}<a class="markdown" href="{{$.RepoLink}}/src/{{.Name}}"><code>{{.Name}}</code></a>
  55. {{$timeSince := TimeSince .Commit.Committer.When $.Lang}}
  56. <span class="ui text light grey">{{$.i18n.Tr "repo.branches.updated_by" $timeSince .Commit.Committer.Name | Safe}}</span>
  57. </div>
  58. </div>
  59. {{end}}
  60. </div>
  61. {{end}}
  62. </div>
  63. </div>
  64. {{template "base/footer" .}}