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.

81 lines
2.9 KiB

  1. {{template "base/head" .}}
  2. <div class="repository settings edit">
  3. {{template "repo/header" .}}
  4. {{template "repo/settings/navbar" .}}
  5. <div class="ui container">
  6. {{template "base/alert" .}}
  7. <h4 class="ui top attached header">
  8. {{.i18n.Tr "repo.default_branch"}}
  9. </h4>
  10. <div class="ui attached segment">
  11. <p>
  12. {{.i18n.Tr "repo.settings.default_branch_desc"}}
  13. </p>
  14. <form class="ui form" action="{{.Link}}" method="post">
  15. {{.CsrfTokenHtml}}
  16. <input type="hidden" name="action" value="default_branch">
  17. {{if not .Repository.IsBare}}
  18. <div class="required inline field">
  19. <div class="ui dropdown selection" tabindex="0">
  20. <select name="branch">
  21. <option value="{{.Repository.DefaultBranch}}">{{.Repository.DefaultBranch}}</option>
  22. {{range .Branches}}
  23. <option value="{{.}}">{{.}}</option>
  24. {{end}}
  25. </select><i class="dropdown icon"></i>
  26. <div class="default text">{{.Repository.DefaultBranch}}</div>
  27. <div class="menu transition hidden" tabindex="-1" style="display: block !important;">
  28. {{range .Branches}}
  29. <div class="item" data-value="{{.}}">{{.}}</div>
  30. {{end}}
  31. </div>
  32. </div>
  33. <button class="ui green button">{{$.i18n.Tr "repo.settings.update_settings"}}</button>
  34. </div>
  35. {{end}}
  36. </form>
  37. </div>
  38. <h4 class="ui top attached header">
  39. {{.i18n.Tr "repo.settings.protected_branch"}}
  40. </h4>
  41. <div class="ui attached table segment">
  42. <div class="ui grid padded">
  43. <div class="eight wide column">
  44. <div class="ui fluid dropdown selection" tabindex="0">
  45. <select id="protectedBranch" name="branch" data-url="{{.Repository.Link}}/settings/branches?action=protected_branch">
  46. {{range .LeftBranches}}
  47. <option value="">{{$.i18n.Tr "repo.settings.choose_branch"}}</option>
  48. <option value="{{.}}">{{.}}</option>
  49. {{end}}
  50. </select><i class="dropdown icon"></i>
  51. <div class="default text">{{.i18n.Tr "repo.settings.choose_branch"}}</div>
  52. <div class="menu transition hidden" tabindex="-1" style="display: block !important;">
  53. {{range .LeftBranches}}
  54. <div class="item" data-value="{{.}}">{{.}}</div>
  55. {{end}}
  56. </div>
  57. </div>
  58. </div>
  59. </div>
  60. <div class="ui grid padded">
  61. <div class="sixteen wide column">
  62. <table class="ui single line table padded">
  63. <tbody>
  64. {{range .ProtectedBranches}}
  65. <tr>
  66. <td><div class="ui large label">{{.BranchName}}</div></td>
  67. <td class="right aligned"><button class="rm ui red button" data-url="{{$.Repository.Link}}/settings/branches?action=protected_branch&id={{.ID}}" data-val="{{.BranchName}}">Delete</button></td>
  68. </tr>
  69. {{else}}
  70. <tr class="center aligned"><td>{{.i18n.Tr "repo.settings.no_protected_branch"}}</td></tr>
  71. {{end}}
  72. </tbody>
  73. </table>
  74. </div>
  75. </div>
  76. </div>
  77. </div>
  78. </div>
  79. {{template "base/footer" .}}