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 7.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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. <a href="{{$.RepoLink}}/src/branch/{{$.DefaultBranch | EscapePound}}">{{$.DefaultBranch}}</a>
  21. <p class="info"><i class="octicon octicon-git-commit"></i><a href="{{$.RepoLink}}/commit/{{.Commit.ID.String}}">{{ShortSha .Commit.ID.String}}</a> · <span class="commit-message">{{RenderCommitMessage .Commit.CommitMessage $.RepoLink $.Repository.ComposeMetas}}</span> · {{$.i18n.Tr "org.repo_updated"}} {{TimeSince .Commit.Committer.When $.i18n.Lang}}</p>
  22. {{end}}
  23. {{end}}
  24. </td>
  25. <td class="right aligned overflow-visible">
  26. <div class="ui basic jump dropdown icon button poping up" data-content="{{$.i18n.Tr "repo.branch.download" ($.DefaultBranch)}}" data-variation="tiny inverted" data-position="top right">
  27. <i class="download icon"></i>
  28. <div class="menu">
  29. <a class="item" href="{{$.RepoLink}}/archive/{{EscapePound $.DefaultBranch}}.zip"><i class="octicon octicon-file-zip"></i> ZIP</a>
  30. <a class="item" href="{{$.RepoLink}}/archive/{{EscapePound $.DefaultBranch}}.tar.gz"><i class="octicon octicon-file-zip"></i> TAR.GZ</a>
  31. </div>
  32. </div>
  33. </td>
  34. </tr>
  35. </tbody>
  36. </table>
  37. </div>
  38. {{if gt (len .Branches) 1}}
  39. <h4 class="ui top attached header">
  40. {{.i18n.Tr "repo.branches"}}
  41. </h4>
  42. <div class="ui attached table segment">
  43. <table class="ui very basic striped fixed table single line">
  44. <tbody>
  45. {{range .Branches}}
  46. {{if ne .Name $.DefaultBranch}}
  47. <tr>
  48. <td class="six wide">
  49. {{if .IsDeleted}}
  50. <s><a href="{{$.RepoLink}}/src/branch/{{.Name | EscapePound}}">{{.Name}}</a></s>
  51. <p class="info">{{$.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="info"><i class="octicon octicon-git-commit"></i><a href="{{$.RepoLink}}/commit/{{.Commit.ID.String}}">{{ShortSha .Commit.ID.String}}</a> · <span class="commit-message">{{RenderCommitMessage .Commit.CommitMessage $.RepoLink $.Repository.ComposeMetas}}</span> · {{$.i18n.Tr "org.repo_updated"}} {{TimeSince .Commit.Committer.When $.i18n.Lang}}</p>
  58. {{end}}
  59. </td>
  60. <td class="three wide 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="two wide right aligned">
  75. {{if not .LatestPullRequest}}
  76. {{if .IsIncluded}}
  77. <a class="ui poping up orange small label" data-content="{{$.i18n.Tr "repo.branch.included_desc"}}" data-variation="tiny inverted" data-position="top right">
  78. <i class="octicon octicon-git-pull-request"></i> {{$.i18n.Tr "repo.branch.included"}}
  79. </a>
  80. {{else if and (not .IsDeleted) $.AllowsPulls (gt .CommitsAhead 0)}}
  81. <a href="{{$.RepoLink}}/compare/{{$.DefaultBranch | EscapePound}}...{{if ne $.Repository.Owner.Name $.Owner.Name}}{{$.Owner.Name}}:{{end}}{{.Name | EscapePound}}">
  82. <button id="new-pull-request" class="ui compact basic button">{{$.i18n.Tr "repo.pulls.compare_changes"}}</button>
  83. </a>
  84. {{end}}
  85. {{else}}
  86. <a href="{{$.RepoLink}}/pulls/{{.LatestPullRequest.Issue.Index}}">#{{.LatestPullRequest.Issue.Index}}</a>
  87. {{if .LatestPullRequest.HasMerged}}
  88. <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>
  89. {{else if .LatestPullRequest.Issue.IsClosed}}
  90. <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>
  91. {{else}}
  92. <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>
  93. {{end}}
  94. {{end}}
  95. </td>
  96. <td class="two wide right aligned overflow-visible">
  97. {{if (not .IsDeleted)}}
  98. <div class="ui basic jump dropdown icon button poping up" data-content="{{$.i18n.Tr "repo.branch.download" (.Name)}}" data-variation="tiny inverted" data-position="top right">
  99. <i class="download icon"></i>
  100. <div class="menu">
  101. <a class="item" href="{{$.RepoLink}}/archive/{{EscapePound .Name}}.zip"><i class="octicon octicon-file-zip"></i> ZIP</a>
  102. <a class="item" href="{{$.RepoLink}}/archive/{{EscapePound .Name}}.tar.gz"><i class="octicon octicon-file-zip"></i> TAR.GZ</a>
  103. </div>
  104. </div>
  105. {{end}}
  106. {{if and $.IsWriter (not $.IsMirror) (not $.Repository.IsArchived) (not .IsProtected)}}
  107. {{if .IsDeleted}}
  108. <a class="ui basic jump button icon poping up undo-button" href data-url="{{$.Link}}/restore?branch_id={{.DeletedBranch.ID | urlquery}}&name={{.DeletedBranch.Name | urlquery}}" data-content="{{$.i18n.Tr "repo.branch.restore" (.Name)}}" data-variation="tiny inverted" data-position="top right"><i class="octicon octicon-reply text blue"></i></a>
  109. {{else}}
  110. <a class="ui basic jump button icon poping up delete-branch-button" href data-url="{{$.Link}}/delete?name={{.Name | urlquery}}" data-content="{{$.i18n.Tr "repo.branch.delete" (.Name)}}" data-variation="tiny inverted" data-position="top right" data-name="{{.Name}}"><i class="trash icon text red"></i></a>
  111. {{end}}
  112. {{end}}
  113. </td>
  114. </tr>
  115. {{end}}
  116. {{end}}
  117. </tbody>
  118. </table>
  119. </div>
  120. {{end}}
  121. </div>
  122. </div>
  123. <div class="ui small basic delete modal">
  124. <div class="ui icon header">
  125. <i class="trash icon"></i>
  126. {{.i18n.Tr "repo.branch.delete_html"}} <span class="name"></span>
  127. </div>
  128. <div class="content">
  129. <p>{{.i18n.Tr "repo.branch.delete_desc" | Str2html}}</p>
  130. </div>
  131. {{template "base/delete_modal_actions" .}}
  132. </div>
  133. {{template "base/footer" .}}