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.

127 lines
5.6 KiB

9 years ago
9 years ago
9 years ago
  1. {{template "base/head" .}}
  2. <div class="organization new team">
  3. {{template "org/header" .}}
  4. <div class="ui middle very relaxed page grid">
  5. <div class="column">
  6. <form class="ui form" action="{{if .PageIsOrgTeamsNew}}{{.OrgLink}}/teams/new{{else}}{{.OrgLink}}/teams/{{.Team.LowerName}}/edit{{end}}" data-delete-url="{{.OrgLink}}/teams/{{.Team.LowerName}}/delete" method="post">
  7. {{.CsrfTokenHtml}}
  8. <h3 class="ui top attached header">
  9. {{if .PageIsOrgTeamsNew}}{{.i18n.Tr "org.create_new_team"}}{{else}}{{.i18n.Tr "org.teams.settings"}}{{end}}
  10. </h3>
  11. <div class="ui attached segment">
  12. {{template "base/alert" .}}
  13. <div class="required field {{if .Err_TeamName}}error{{end}}">
  14. <label for="team_name">{{.i18n.Tr "org.team_name"}}</label>
  15. {{if eq .Team.LowerName "owners"}}
  16. <input type="hidden" name="team_name" value="{{.Team.Name}}">
  17. {{end}}
  18. <input id="team_name" name="team_name" value="{{.Team.Name}}" required {{if eq .Team.LowerName "owners"}}disabled{{end}} autofocus>
  19. <span class="help">{{.i18n.Tr "org.team_name_helper"}}</span>
  20. </div>
  21. <div class="field {{if .Err_Description}}error{{end}}">
  22. <label for="description">{{.i18n.Tr "org.team_desc"}}</label>
  23. <input id="description" name="description" value="{{.Team.Description}}">
  24. <span class="help">{{.i18n.Tr "org.team_desc_helper"}}</span>
  25. </div>
  26. {{if not (eq .Team.LowerName "owners")}}
  27. <div class="grouped field">
  28. <label>{{.i18n.Tr "org.team_access_desc"}}</label>
  29. <br>
  30. <div class="field">
  31. <div class="ui radio checkbox">
  32. <input type="radio" name="repo_access" value="specific" {{if not .Team.IncludesAllRepositories}}checked{{end}}>
  33. <label>{{.i18n.Tr "org.teams.specific_repositories"}}</label>
  34. <span class="help">{{.i18n.Tr "org.teams.specific_repositories_helper" | Str2html}}</span>
  35. </div>
  36. </div>
  37. <div class="field">
  38. <div class="ui radio checkbox">
  39. <input type="radio" name="repo_access" value="all" {{if .Team.IncludesAllRepositories}}checked{{end}}>
  40. <label>{{.i18n.Tr "org.teams.all_repositories"}}</label>
  41. <span class="help">{{.i18n.Tr "org.teams.all_repositories_helper" | Str2html}}</span>
  42. </div>
  43. </div>
  44. <div class="field">
  45. <div class="ui checkbox">
  46. <label for="can_create_org_repo">{{.i18n.Tr "org.teams.can_create_org_repo"}}</label>
  47. <input id="can_create_org_repo" name="can_create_org_repo" type="checkbox" {{if .Team.CanCreateOrgRepo}}checked{{end}}>
  48. <span class="help">{{.i18n.Tr "org.teams.can_create_org_repo_helper"}}</span>
  49. </div>
  50. </div>
  51. </div>
  52. <div class="grouped field">
  53. <label>{{.i18n.Tr "org.team_permission_desc"}}</label>
  54. <br>
  55. <div class="field">
  56. <div class="ui radio checkbox">
  57. <input type="radio" name="permission" value="read" {{if or .PageIsOrgTeamsNew (eq .Team.Authorize 1)}}checked{{end}}>
  58. <label>{{.i18n.Tr "org.teams.read_access"}}</label>
  59. <span class="help">{{.i18n.Tr "org.teams.read_access_helper"}}</span>
  60. </div>
  61. </div>
  62. <div class="field">
  63. <div class="ui radio checkbox">
  64. <input type="radio" name="permission" value="write" {{if eq .Team.Authorize 2}}checked{{end}}>
  65. <label>{{.i18n.Tr "org.teams.write_access"}}</label>
  66. <span class="help">{{.i18n.Tr "org.teams.write_access_helper"}}</span>
  67. </div>
  68. </div>
  69. <div class="field">
  70. <div class="ui radio checkbox">
  71. <input type="radio" name="permission" value="admin" {{if eq .Team.Authorize 3}}checked{{end}}>
  72. <label>{{.i18n.Tr "org.teams.admin_access"}}</label>
  73. <span class="help">{{.i18n.Tr "org.teams.admin_access_helper"}}</span>
  74. </div>
  75. </div>
  76. </div>
  77. <div class="ui divider"></div>
  78. <div class="team-units required grouped field"{{if eq .Team.Authorize 3}} style="display: none"{{end}}>
  79. <label>{{.i18n.Tr "org.team_unit_desc"}}</label>
  80. <br>
  81. {{range $t, $unit := $.Units}}
  82. {{if $unit.Type.UnitGlobalDisabled}}
  83. <div class="field poping up" data-content="{{$.i18n.Tr "repo.unit_disabled"}}">
  84. {{else}}
  85. <div class="field">
  86. {{end}}
  87. <div class="ui toggle checkbox">
  88. <input type="checkbox" class="hidden" name="units" value="{{$unit.Type.Value}}"{{if or (eq $.Team.ID 0) ($.Team.UnitEnabled $unit.Type)}} checked{{end}}>
  89. <label>{{$.i18n.Tr $unit.NameKey}}{{if $unit.Type.UnitGlobalDisabled}} {{$.i18n.Tr "org.team_unit_disabled"}}{{end}}</label>
  90. <span class="help">{{$.i18n.Tr $unit.DescKey}}</span>
  91. </div>
  92. </div>
  93. {{end}}
  94. </div>
  95. <div class="ui divider"></div>
  96. {{end}}
  97. <div class="field">
  98. {{if .PageIsOrgTeamsNew}}
  99. <button class="ui green button">{{.i18n.Tr "org.create_team"}}</button>
  100. <a class="ui button" href="{{.OrgLink}}/teams">{{.i18n.Tr "cancel"}}</a>
  101. {{else}}
  102. <button class="ui green button">{{.i18n.Tr "org.teams.update_settings"}}</button>
  103. {{if not (eq .Team.LowerName "owners")}}
  104. <button class="ui red button delete-button" data-url="{{.OrgLink}}/teams/{{.team_name}}/delete">{{.i18n.Tr "org.teams.delete_team"}}</button>
  105. {{end}}
  106. {{end}}
  107. </div>
  108. </div>
  109. </form>
  110. </div>
  111. </div>
  112. </div>
  113. <div class="ui small basic delete modal">
  114. <div class="ui icon header">
  115. <i class="trash icon"></i>
  116. {{.i18n.Tr "org.teams.delete_team_title"}}
  117. </div>
  118. <div class="content">
  119. <p>{{.i18n.Tr "org.teams.delete_team_desc"}}</p>
  120. </div>
  121. {{template "base/delete_modal_actions" .}}
  122. </div>
  123. {{template "base/footer" .}}