Skip to content

Commit 49ea88b

Browse files
committed
fix org create
1 parent 1195121 commit 49ea88b

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

routers/web/org/org.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ const (
2727
// Create render the page for create organization
2828
func Create(ctx *context.Context) {
2929
ctx.Data["Title"] = ctx.Tr("new_org")
30-
ctx.Data["DefaultOrgVisibilityMode"] = setting.Service.DefaultOrgVisibilityMode
30+
ctx.Data["Visibility"] = setting.Service.DefaultOrgVisibilityMode
31+
ctx.Data["RepoAdminChangeTeamAccess"] = true
32+
3133
if !ctx.Doer.CanCreateOrganization() {
3234
ctx.ServerError("Not allowed", errors.New(ctx.Tr("org.form.create_org_not_allowed")))
3335
return

templates/org/create.tmpl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,23 @@
1111
{{template "base/alert" .}}
1212
<div class="inline required field {{if .Err_OrgName}}error{{end}}">
1313
<label for="org_name">{{.locale.Tr "org.org_name_holder"}}</label>
14-
<input id="org_name" name="org_name" value="{{.org_name}}" autofocus required>
14+
<input id="org_name" name="org_name" value="{{.OrgName}}" autofocus required>
1515
<span class="help">{{.locale.Tr "org.org_name_helper"}}</span>
1616
</div>
1717

1818
<div class="inline field {{if .Err_OrgVisibility}}error{{end}}">
1919
<span class="inline required field"><label for="visibility">{{.locale.Tr "org.settings.visibility"}}</label></span>
2020
<div class="inline-grouped-list">
2121
<div class="ui radio checkbox">
22-
<input class="hidden enable-system-radio" tabindex="0" name="visibility" type="radio" value="0" {{if .DefaultOrgVisibilityMode.IsPublic}}checked{{end}}/>
22+
<input class="hidden enable-system-radio" tabindex="0" name="visibility" type="radio" value="0" {{if .Visibility.IsPublic}}checked{{end}}/>
2323
<label>{{.locale.Tr "org.settings.visibility.public"}}</label>
2424
</div>
2525
<div class="ui radio checkbox">
26-
<input class="hidden enable-system-radio" tabindex="0" name="visibility" type="radio" value="1" {{if .DefaultOrgVisibilityMode.IsLimited}}checked{{end}}/>
26+
<input class="hidden enable-system-radio" tabindex="0" name="visibility" type="radio" value="1" {{if .Visibility.IsLimited}}checked{{end}}/>
2727
<label>{{.locale.Tr "org.settings.visibility.limited"}}</label>
2828
</div>
2929
<div class="ui radio checkbox">
30-
<input class="hidden enable-system-radio" tabindex="0" name="visibility" type="radio" value="2" {{if .DefaultOrgVisibilityMode.IsPrivate}}checked{{end}}/>
30+
<input class="hidden enable-system-radio" tabindex="0" name="visibility" type="radio" value="2" {{if .Visibility.IsPrivate}}checked{{end}}/>
3131
<label>{{.locale.Tr "org.settings.visibility.private"}}</label>
3232
</div>
3333
</div>
@@ -37,7 +37,7 @@
3737
<label>{{.locale.Tr "org.settings.permission"}}</label>
3838
<div class="inline-grouped-list">
3939
<div class="ui checkbox">
40-
<input class="hidden" type="checkbox" name="repo_admin_change_team_access" checked/>
40+
<input class="hidden" type="checkbox" name="repo_admin_change_team_access" {{if .RepoAdminChangeTeamAccess}}checked{{end}}/>
4141
<label>{{.locale.Tr "org.settings.repoadminchangeteam"}}</label>
4242
</div>
4343
</div>

0 commit comments

Comments
 (0)