You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

list.tmpl 5.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. {{template "base/head" .}}
  2. <div class="ui repository branches">
  3. {{template "repo/header" .}}
  4. <div class="ui container">
  5. {{template "base/alert" .}}
  6. {{template "repo/sub_menu" .}}
  7. <h4 class="ui top attached header">
  8. {{.i18n.Tr "repo.default_branch"}}
  9. </h4>
  10. <div class="ui attached table segment">
  11. <table class="ui very basic striped fixed table single line">
  12. <tbody>
  13. <tr>
  14. <td>
  15. {{range .Branches}}
  16. {{if eq .Name $.DefaultBranch}}
  17. {{if .IsProtected}}
  18. <i class="octicon octicon-shield"></i>
  19. {{end}}
  20. {{.Name}}
  21. {{end}}
  22. {{end}}
  23. </td>
  24. </tr>
  25. </tbody>
  26. </table>
  27. </div>
  28. {{if gt (len .Branches) 1}}
  29. <h4 class="ui top attached header">
  30. {{.i18n.Tr "repo.branches"}}
  31. </h4>
  32. <div class="ui attached table segment">
  33. <table class="ui very basic striped fixed table single line">
  34. <thead>
  35. <tr>
  36. <th class="six wide">{{.i18n.Tr "repo.branch.name"}}</th>
  37. <th class="three wide"></th>
  38. <th class="two wide"></th>
  39. {{if and $.IsWriter (not $.IsMirror) (not $.Repository.IsArchived)}}
  40. <th class="one wide right aligned">{{.i18n.Tr "repo.branch.delete_head"}}</th>
  41. {{end}}
  42. </tr>
  43. </thead>
  44. <tbody>
  45. {{range .Branches}}
  46. {{if ne .Name $.DefaultBranch}}
  47. <tr>
  48. <td>
  49. {{if .IsDeleted}}
  50. <s><a href="{{$.RepoLink}}/src/branch/{{.Name | EscapePound}}">{{.Name}}</a></s>
  51. <p class="time">{{$.i18n.Tr "repo.branch.deleted_by" .DeletedBranch.DeletedBy.Name}} {{TimeSinceUnix .DeletedBranch.DeletedUnix $.i18n.Lang}}</p>
  52. {{else}}
  53. {{if .IsProtected}}
  54. <i class="octicon octicon-shield"></i>
  55. {{end}}
  56. <a href="{{$.RepoLink}}/src/branch/{{.Name | EscapePound}}">{{.Name}}</a>
  57. <p class="time">{{$.i18n.Tr "org.repo_updated"}} {{TimeSince .Commit.Committer.When $.i18n.Lang}}</p>
  58. {{end}}
  59. </td>
  60. <td class="ui">
  61. {{if not .IsDeleted}}
  62. <div class="commit-divergence">
  63. <div class="bar-group">
  64. <div class="count count-behind">{{.CommitsBehind}}</div>
  65. <div class="bar bar-behind" style="width: {{percentage .CommitsBehind .CommitsBehind .CommitsAhead}}%"></div>
  66. </div>
  67. <div class="bar-group">
  68. <div class="count count-ahead">{{.CommitsAhead}}</div>
  69. <div class="bar bar-ahead" style="width: {{percentage .CommitsAhead .CommitsBehind .CommitsAhead}}%"></div>
  70. </div>
  71. </div>
  72. {{end}}
  73. </td>
  74. <td class="right aligned">
  75. {{if not .LatestPullRequest}}
  76. {{if and (not .IsDeleted) $.AllowsPulls}}
  77. <a href="{{$.RepoLink}}/compare/{{$.DefaultBranch | EscapePound}}...{{if ne $.Repository.Owner.Name $.Owner.Name}}{{$.Owner.Name}}:{{end}}{{.Name | EscapePound}}">
  78. <button id="new-pull-request" class="ui compact basic button">{{$.i18n.Tr "repo.pulls.compare_changes"}}</button>
  79. </a>
  80. {{end}}
  81. {{else}}
  82. <a href="{{$.RepoLink}}/pulls/{{.LatestPullRequest.Issue.Index}}">#{{.LatestPullRequest.Issue.Index}}</a>
  83. {{if .LatestPullRequest.HasMerged}}
  84. <a href="{{$.RepoLink}}/pulls/{{.LatestPullRequest.Issue.Index}}" class="ui purple small label"><i class="octicon octicon-git-pull-request"></i> {{$.i18n.Tr "repo.pulls.merged"}}</a>
  85. {{else if .LatestPullRequest.Issue.IsClosed}}
  86. <a href="{{$.RepoLink}}/pulls/{{.LatestPullRequest.Issue.Index}}" class="ui red small label"><i class="octicon octicon-issue-closed"></i> {{$.i18n.Tr "repo.issues.closed_title"}}</a>
  87. {{else}}
  88. <a href="{{$.RepoLink}}/pulls/{{.LatestPullRequest.Issue.Index}}" class="ui green small label"><i class="octicon octicon-issue-opened"></i> {{$.i18n.Tr "repo.issues.open_title"}}</a>
  89. {{end}}
  90. {{end}}
  91. </td>
  92. {{if and $.IsWriter (not $.IsMirror) (not $.Repository.IsArchived)}}
  93. <td class="right aligned">
  94. {{if and .IsDeleted (not .IsProtected)}}
  95. <a class="undo-button" href data-url="{{$.Link}}/restore?branch_id={{.DeletedBranch.ID | urlquery}}&name={{.DeletedBranch.Name | urlquery}}"><i class="octicon octicon-reply"></i></a>
  96. {{else if (not .IsProtected)}}
  97. <a class="delete-branch-button" href data-url="{{$.Link}}/delete?name={{.Name | urlquery}}" data-name="{{.Name}}"><i class="trash icon text red"></i></a>
  98. {{end}}
  99. </td>
  100. {{end}}
  101. </tr>
  102. {{end}}
  103. {{end}}
  104. </tbody>
  105. </table>
  106. </div>
  107. {{end}}
  108. </div>
  109. </div>
  110. <div class="ui small basic delete modal">
  111. <div class="ui icon header">
  112. <i class="trash icon"></i>
  113. {{.i18n.Tr "repo.branch.delete_html"}} <span class="name"></span>
  114. </div>
  115. <div class="content">
  116. <p>{{.i18n.Tr "repo.branch.delete_desc" | Str2html}}</p>
  117. </div>
  118. {{template "base/delete_modal_actions" .}}
  119. </div>
  120. {{template "base/footer" .}}