protected_branch.tmpl 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. {{template "base/head" .}}
  2. <div class="repository settings branches">
  3. {{template "repo/header" .}}
  4. <div class="ui container">
  5. <div class="ui grid">
  6. {{template "repo/settings/navbar" .}}
  7. <div class="twelve wide column content">
  8. {{template "base/alert" .}}
  9. <h4 class="ui top attached header">
  10. {{.i18n.Tr "repo.settings.branch_protection"}}
  11. </h4>
  12. <div class="ui attached segment branch-protection">
  13. <p>{{.i18n.Tr "repo.settings.branch_protection_desc" .Branch.Name | Str2html}}</p>
  14. <form class="ui form" action="{{.Link}}" method="post">
  15. {{.CsrfTokenHtml}}
  16. <div class="inline field">
  17. <div class="ui checkbox">
  18. <input class="enable-protection" name="protected" type="checkbox" data-target="#protection_box" {{if .Branch.Protected}}checked{{end}}>
  19. <label>{{.i18n.Tr "repo.settings.protect_this_branch"}}</label>
  20. <p class="help">{{.i18n.Tr "repo.settings.protect_this_branch_desc"}}</p>
  21. </div>
  22. </div>
  23. <div id="protection_box" class="fields {{if not .Branch.Protected}}disabled{{end}}">
  24. <div class="field">
  25. <div class="ui checkbox">
  26. <input name="require_pull_request" type="checkbox" {{if .Branch.RequirePullRequest}}checked{{end}}>
  27. <label>{{.i18n.Tr "repo.settings.protect_require_pull_request"}}</label>
  28. <p class="help">{{.i18n.Tr "repo.settings.protect_require_pull_request_desc"}}</p>
  29. </div>
  30. </div>
  31. {{if .IsOrgRepo}}
  32. <div class="field">
  33. <div class="ui checkbox">
  34. <input name="whitelist_committers" type="checkbox" data-target="#whitelist_box">
  35. <label>{{.i18n.Tr "repo.settings.protect_whitelist_committers"}}</label>
  36. <p class="help">{{.i18n.Tr "repo.settings.protect_whitelist_committers_desc"}}</p>
  37. </div>
  38. </div>
  39. {{end}}
  40. </div>
  41. <div class="ui divider"></div>
  42. <div class="field">
  43. <button class="ui green button">{{$.i18n.Tr "repo.settings.update_settings"}}</button>
  44. </div>
  45. </form>
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. </div>
  51. {{template "base/footer" .}}