1{{template "base/head" .}} 2<div class="page-content organization new team"> 3 {{template "org/header" .}} 4 <div class="ui container"> 5 <div class="ui grid"> 6 <div class="column"> 7 <form class="ui form" action="{{if .PageIsOrgTeamsNew}}{{.OrgLink}}/teams/new{{else}}{{.OrgLink}}/teams/{{.Team.LowerName | PathEscape}}/edit{{end}}" data-delete-url="{{.OrgLink}}/teams/{{.Team.LowerName | PathEscape}}/delete" method="post"> 8 {{.CsrfTokenHtml}} 9 <h3 class="ui top attached header"> 10 {{if .PageIsOrgTeamsNew}}{{.i18n.Tr "org.create_new_team"}}{{else}}{{.i18n.Tr "org.teams.settings"}}{{end}} 11 </h3> 12 <div class="ui attached segment"> 13 {{template "base/alert" .}} 14 <div class="required field {{if .Err_TeamName}}error{{end}}"> 15 <label for="team_name">{{.i18n.Tr "org.team_name"}}</label> 16 {{if eq .Team.LowerName "owners"}} 17 <input type="hidden" name="team_name" value="{{.Team.Name}}"> 18 {{end}} 19 <input id="team_name" name="team_name" value="{{.Team.Name}}" required {{if eq .Team.LowerName "owners"}}disabled{{end}} autofocus> 20 <span class="help">{{.i18n.Tr "org.team_name_helper"}}</span> 21 </div> 22 <div class="field {{if .Err_Description}}error{{end}}"> 23 <label for="description">{{.i18n.Tr "org.team_desc"}}</label> 24 <input id="description" name="description" value="{{.Team.Description}}"> 25 <span class="help">{{.i18n.Tr "org.team_desc_helper"}}</span> 26 </div> 27 {{if not (eq .Team.LowerName "owners")}} 28 <div class="grouped field"> 29 <label>{{.i18n.Tr "org.team_access_desc"}}</label> 30 <br> 31 <div class="field"> 32 <div class="ui radio checkbox"> 33 <input type="radio" name="repo_access" value="specific" {{if not .Team.IncludesAllRepositories}}checked{{end}}> 34 <label>{{.i18n.Tr "org.teams.specific_repositories"}}</label> 35 <span class="help">{{.i18n.Tr "org.teams.specific_repositories_helper" | Str2html}}</span> 36 </div> 37 </div> 38 <div class="field"> 39 <div class="ui radio checkbox"> 40 <input type="radio" name="repo_access" value="all" {{if .Team.IncludesAllRepositories}}checked{{end}}> 41 <label>{{.i18n.Tr "org.teams.all_repositories"}}</label> 42 <span class="help">{{.i18n.Tr "org.teams.all_repositories_helper" | Str2html}}</span> 43 </div> 44 </div> 45 46 <div class="field"> 47 <div class="ui checkbox"> 48 <label for="can_create_org_repo">{{.i18n.Tr "org.teams.can_create_org_repo"}}</label> 49 <input id="can_create_org_repo" name="can_create_org_repo" type="checkbox" {{if .Team.CanCreateOrgRepo}}checked{{end}}> 50 <span class="help">{{.i18n.Tr "org.teams.can_create_org_repo_helper"}}</span> 51 </div> 52 </div> 53 </div> 54 <div class="grouped field"> 55 <label>{{.i18n.Tr "org.team_permission_desc"}}</label> 56 <br> 57 <div class="field"> 58 <div class="ui radio checkbox"> 59 <input type="radio" name="permission" value="read" {{if or .PageIsOrgTeamsNew (eq .Team.AccessMode 1) (eq .Team.AccessMode 2)}}checked{{end}}> 60 <label>{{.i18n.Tr "org.teams.general_access"}}</label> 61 <span class="help">{{.i18n.Tr "org.teams.general_access_helper"}}</span> 62 </div> 63 </div> 64 <div class="field"> 65 <div class="ui radio checkbox"> 66 <input type="radio" name="permission" value="admin" {{if eq .Team.AccessMode 3}}checked{{end}}> 67 <label>{{.i18n.Tr "org.teams.admin_access"}}</label> 68 <span class="help">{{.i18n.Tr "org.teams.admin_access_helper"}}</span> 69 </div> 70 </div> 71 </div> 72 <div class="ui divider"></div> 73 74 <div class="team-units required grouped field"{{if eq .Team.AccessMode 3}} style="display: none"{{end}}> 75 <label>{{.i18n.Tr "org.team_unit_desc"}}</label> 76 <table class="ui celled table"> 77 <thead> 78 <tr> 79 <th class="center aligned">{{.i18n.Tr "units.unit"}}</th> 80 <th class="center aligned">{{.i18n.Tr "org.teams.none_access"}} 81 <i class="circle help icon link tooltip" data-content="{{.i18n.Tr "org.teams.none_access_helper"}}"></i></th> 82 <th class="center aligned">{{.i18n.Tr "org.teams.read_access"}} 83 <i class="circle help icon link tooltip" data-content="{{.i18n.Tr "org.teams.read_access_helper"}}"></i> 84 </th> 85 <th class="center aligned">{{.i18n.Tr "org.teams.write_access"}} 86 <i class="circle help icon link tooltip" data-content="{{.i18n.Tr "org.teams.write_access_helper"}}"></i> 87 </th> 88 </tr> 89 </thead> 90 <tbody> 91 {{range $t, $unit := $.Units}} 92 {{if ge $unit.MaxPerm 2}} 93 <tr> 94 <td> 95 <div {{if $unit.Type.UnitGlobalDisabled}}class="field tooltip" data-content="{{$.i18n.Tr "repo.unit_disabled"}}"{{- else -}}class="field"{{end}}> 96 <div class="ui"> 97 <label>{{$.i18n.Tr $unit.NameKey}}{{if $unit.Type.UnitGlobalDisabled}} {{$.i18n.Tr "org.team_unit_disabled"}}{{end}}</label> 98 <span class="help">{{$.i18n.Tr $unit.DescKey}}</span> 99 </div> 100 </div> 101 </td> 102 <td class="center aligned"> 103 <div class="ui radio checkbox"> 104 <input type="radio" class="hidden" name="unit_{{$unit.Type.Value}}" value="0"{{if or ($unit.Type.UnitGlobalDisabled) (eq ($.Team.UnitAccessMode $unit.Type) 0)}} checked{{end}}> 105 </div> 106 </td> 107 <td class="center aligned"> 108 <div class="ui radio checkbox"> 109 <input type="radio" class="hidden" name="unit_{{$unit.Type.Value}}" value="1"{{if or (eq $.Team.ID 0) (eq ($.Team.UnitAccessMode $unit.Type) 1)}} checked{{end}} {{if $unit.Type.UnitGlobalDisabled}}disabled{{end}}> 110 </div> 111 </td> 112 <td class="center aligned"> 113 <div class="ui radio checkbox"> 114 <input type="radio" class="hidden" name="unit_{{$unit.Type.Value}}" value="2"{{if (eq ($.Team.UnitAccessMode $unit.Type) 2)}} checked{{end}} {{if $unit.Type.UnitGlobalDisabled}}disabled{{end}}> 115 </div> 116 </td> 117 </tr> 118 {{end}} 119 {{end}} 120 </tbody> 121 </table> 122 {{range $t, $unit := $.Units}} 123 {{if lt $unit.MaxPerm 2}} 124 <div {{if $unit.Type.UnitGlobalDisabled}}class="field tooltip" data-content="{{$.i18n.Tr "repo.unit_disabled"}}"{{else}}class="field"{{end}}> 125 <div class="ui checkbox"> 126 <input type="checkbox" class="hidden" name="unit_{{$unit.Type.Value}}" value="1"{{if or (eq $.Team.ID 0) (eq ($.Team.UnitAccessMode $unit.Type) 1)}} checked{{end}} {{if $unit.Type.UnitGlobalDisabled}}disabled{{end}}> 127 <label>{{$.i18n.Tr $unit.NameKey}}{{if $unit.Type.UnitGlobalDisabled}} {{$.i18n.Tr "org.team_unit_disabled"}}{{end}}</label> 128 <span class="help">{{$.i18n.Tr $unit.DescKey}}</span> 129 </div> 130 </div> 131 {{end}} 132 {{end}} 133 </div> 134 {{end}} 135 136 <div class="field"> 137 {{if .PageIsOrgTeamsNew}} 138 <button class="ui green button">{{.i18n.Tr "org.create_team"}}</button> 139 <a class="ui button" href="{{.OrgLink}}/teams">{{.i18n.Tr "cancel"}}</a> 140 {{else}} 141 <button class="ui green button">{{.i18n.Tr "org.teams.update_settings"}}</button> 142 {{if not (eq .Team.LowerName "owners")}} 143 <button class="ui red button delete-button" data-url="{{.OrgLink}}/teams/{{.team_name | PathEscape}}/delete">{{.i18n.Tr "org.teams.delete_team"}}</button> 144 {{end}} 145 {{end}} 146 </div> 147 </div> 148 </form> 149 </div> 150 </div> 151 </div> 152</div> 153 154<div class="ui small basic delete modal"> 155 <div class="ui icon header"> 156 {{svg "octicon-trash"}} 157 {{.i18n.Tr "org.teams.delete_team_title"}} 158 </div> 159 <div class="content"> 160 <p>{{.i18n.Tr "org.teams.delete_team_desc"}}</p> 161 </div> 162 {{template "base/delete_modal_actions" .}} 163</div> 164{{template "base/footer" .}} 165