Fork to maintain patches against the official gitea for https://code.ceondo.com https://github.com/go-gitea/gitea

protected_branch.tmpl 2.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. {{template "base/head" .}}
  2. <div class="repository settings branches">
  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.settings.branch_protection" .Branch.BranchName | Str2html}}
  9. </h4>
  10. <div class="ui attached segment branch-protection">
  11. <form class="ui form" action="{{.Link}}" method="post">
  12. {{.CsrfTokenHtml}}
  13. <div class="inline field">
  14. <div class="ui checkbox">
  15. <input class="enable-protection" name="protected" type="checkbox" data-target="#protection_box" {{if .Branch.IsProtected}}checked{{end}}>
  16. <label>{{.i18n.Tr "repo.settings.protect_this_branch"}}</label>
  17. <p class="help">{{.i18n.Tr "repo.settings.protect_this_branch_desc"}}</p>
  18. </div>
  19. </div>
  20. <div id="protection_box" class="fields {{if not .Branch.IsProtected}}disabled{{end}}">
  21. <div class="field">
  22. <div class="ui checkbox">
  23. <input class="enable-whitelist" name="enable_whitelist" type="checkbox" data-target="#whitelist_box" {{if .Branch.EnableWhitelist}}checked{{end}}>
  24. <label>{{.i18n.Tr "repo.settings.protect_whitelist_committers"}}</label>
  25. <p class="help">{{.i18n.Tr "repo.settings.protect_whitelist_committers_desc"}}</p>
  26. </div>
  27. </div>
  28. <div id="whitelist_box" class="fields {{if not .Branch.EnableWhitelist}}disabled{{end}}">
  29. <div class="whitelist field">
  30. <label>{{.i18n.Tr "repo.settings.protect_whitelist_users"}}</label>
  31. <div class="ui multiple search selection dropdown">
  32. <input type="hidden" name="whitelist_users" value="{{.whitelist_users}}">
  33. <div class="default text">{{.i18n.Tr "repo.settings.protect_whitelist_search_users"}}</div>
  34. <div class="menu">
  35. {{range .Users}}
  36. <div class="item" data-value="{{.ID}}">
  37. <img class="ui mini image" src="{{.RelAvatarLink}}">
  38. {{.Name}}
  39. </div>
  40. {{end}}
  41. </div>
  42. </div>
  43. </div>
  44. {{if .Owner.IsOrganization}}
  45. <br>
  46. <div class="whitelist field">
  47. <label>{{.i18n.Tr "repo.settings.protect_whitelist_teams"}}</label>
  48. <div class="ui multiple search selection dropdown">
  49. <input type="hidden" name="whitelist_teams" value="{{.whitelist_teams}}">
  50. <div class="default text">{{.i18n.Tr "repo.settings.protect_whitelist_search_teams"}}</div>
  51. <div class="menu">
  52. {{range .Teams}}
  53. <div class="item" data-value="{{.ID}}">
  54. <i class="octicon octicon-jersey"></i>
  55. {{.Name}}
  56. </div>
  57. {{end}}
  58. </div>
  59. </div>
  60. </div>
  61. {{end}}
  62. </div>
  63. </div>
  64. <div class="ui divider"></div>
  65. <div class="field">
  66. <button class="ui green button">{{$.i18n.Tr "repo.settings.update_settings"}}</button>
  67. </div>
  68. </form>
  69. </div>
  70. </div>
  71. </div>
  72. {{template "base/footer" .}}