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.

79 lines
2.6 KiB

  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>{{.DefaultBranch}}</td>
  15. </tr>
  16. </tbody>
  17. </table>
  18. </div>
  19. {{if gt (len .Branches) 1}}
  20. <h4 class="ui top attached header">
  21. {{.i18n.Tr "repo.branches"}}
  22. </h4>
  23. <div class="ui attached table segment">
  24. <table class="ui very basic striped fixed table single line">
  25. <thead>
  26. <tr>
  27. <th class="nine wide">{{.i18n.Tr "repo.branch.name"}}</th>
  28. {{if and $.IsWriter (not $.IsMirror)}}
  29. <th class="one wide right aligned">{{.i18n.Tr "repo.branch.delete_head"}}</th>
  30. {{end}}
  31. </tr>
  32. </thead>
  33. <tbody>
  34. {{range $branch := .Branches}}
  35. {{if ne .Name $.DefaultBranch}}
  36. <tr>
  37. <td>
  38. {{if .IsDeleted}}
  39. <s><a href="{{$.RepoLink}}/src/branch/{{.Name}}">{{.Name}}</a></s>
  40. <p class="time">{{$.i18n.Tr "repo.branch.deleted_by" .DeletedBranch.DeletedBy.Name}} {{TimeSinceUnix .DeletedBranch.DeletedUnix $.i18n.Lang}}</p>
  41. {{else}}
  42. <a href="{{$.RepoLink}}/src/branch/{{.Name}}">{{.Name}}</a>
  43. <p class="time">{{$.i18n.Tr "org.repo_updated"}} {{TimeSince .Commit.Committer.When $.i18n.Lang}}</p>
  44. </td>
  45. {{end}}
  46. {{if and $.IsWriter (not $.IsMirror)}}
  47. <td class="right aligned">
  48. {{if .IsProtected}}
  49. <i class="octicon octicon-shield"></i>
  50. {{else if .IsDeleted}}
  51. <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>
  52. {{else}}
  53. <a class="delete-branch-button" href data-url="{{$.Link}}/delete?name={{.Name | urlquery}}" data-val="{{.Name}}"><i class="trash icon text red"></i></a>
  54. {{end}}
  55. </td>
  56. {{end}}
  57. </tr>
  58. {{end}}
  59. {{end}}
  60. </tbody>
  61. </table>
  62. </div>
  63. {{end}}
  64. </div>
  65. </div>
  66. <div class="ui small basic delete modal">
  67. <div class="ui icon header">
  68. <i class="trash icon"></i>
  69. {{.i18n.Tr "repo.branch.delete_html"}} <span class="branch-name"></span>
  70. </div>
  71. <div class="content">
  72. <p>{{.i18n.Tr "repo.branch.delete_desc"}}</p>
  73. </div>
  74. {{template "base/delete_modal_actions" .}}
  75. </div>
  76. {{template "base/footer" .}}