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.

123 lines
5.4 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. <div class="field">
  83. <div class="ui toggle checkbox">
  84. <input type="checkbox" class="hidden" name="units" value="{{$unit.Type.Value}}"{{if or (eq $.Team.ID 0) ($.Team.UnitEnabled $unit.Type)}} checked{{end}}>
  85. <label>{{$.i18n.Tr $unit.NameKey}}</label>
  86. <span class="help">{{$.i18n.Tr $unit.DescKey}}</span>
  87. </div>
  88. </div>
  89. {{end}}
  90. </div>
  91. <div class="ui divider"></div>
  92. {{end}}
  93. <div class="field">
  94. {{if .PageIsOrgTeamsNew}}
  95. <button class="ui green button">{{.i18n.Tr "org.create_team"}}</button>
  96. <a class="ui button" href="{{.OrgLink}}/teams">{{.i18n.Tr "cancel"}}</a>
  97. {{else}}
  98. <button class="ui green button">{{.i18n.Tr "org.teams.update_settings"}}</button>
  99. {{if not (eq .Team.LowerName "owners")}}
  100. <button class="ui red button delete-button" data-url="{{.OrgLink}}/teams/{{.team_name}}/delete">{{.i18n.Tr "org.teams.delete_team"}}</button>
  101. {{end}}
  102. {{end}}
  103. </div>
  104. </div>
  105. </form>
  106. </div>
  107. </div>
  108. </div>
  109. <div class="ui small basic delete modal">
  110. <div class="ui icon header">
  111. <i class="trash icon"></i>
  112. {{.i18n.Tr "org.teams.delete_team_title"}}
  113. </div>
  114. <div class="content">
  115. <p>{{.i18n.Tr "org.teams.delete_team_desc"}}</p>
  116. </div>
  117. {{template "base/delete_modal_actions" .}}
  118. </div>
  119. {{template "base/footer" .}}