{{$createOrgCancelLink := .CancelLink}}
{{if not $createOrgCancelLink}}{{$createOrgCancelLink = .Req.RequestURI}}{{end}}
<div class="ui small modal" id="create-org-modal" data-cancel-link="{{$createOrgCancelLink}}">
	<a class="inside close icon" role="button" tabindex="0" aria-label="{{ctx.Locale.Tr "close"}}">{{svg "octicon-x" 16}}</a>
	<div class="header">{{ctx.Locale.Tr "new_org"}}</div>
	<form class="ui form" action="{{AppSubUrl}}/org/create" method="post">
		<input type="hidden" name="redirect_to" value="{{$createOrgCancelLink}}">
		<div class="content">
			{{if .Flash.ErrorMsg}}{{ctx.RenderUtils.RenderFlashMessage "error" .Flash.ErrorMsg}}{{end}}

			<div class="required field {{if .Err_OrgName}}error{{end}}">
				<label for="org_name">{{ctx.Locale.Tr "org.org_name_holder"}}</label>
				<input id="org_name" name="org_name" value="{{.org_name}}" autofocus required maxlength="40">
				<span class="help">{{ctx.Locale.Tr "org.org_name_helper"}}</span>
			</div>

			<div class="grouped required field {{if .Err_OrgVisibility}}error{{end}}">
				<label>{{ctx.Locale.Tr "org.settings.visibility"}}</label>
				<div class="field">
					<div class="ui radio checkbox">
						<input id="create-org-visibility-public" class="enable-system-radio" name="visibility" type="radio" value="0" {{if .visibility.IsPublic}}checked{{end}}>
						<label>{{ctx.Locale.Tr "org.settings.visibility.public"}}</label>
					</div>
				</div>
				<div class="field">
					<div class="ui radio checkbox">
						<input id="create-org-visibility-limited" class="enable-system-radio" name="visibility" type="radio" value="1" {{if .visibility.IsLimited}}checked{{end}}>
						<label>{{ctx.Locale.Tr "org.settings.visibility.limited"}}</label>
					</div>
				</div>
				<div class="field">
					<div class="ui radio checkbox">
						<input id="create-org-visibility-private" class="enable-system-radio" name="visibility" type="radio" value="2" {{if .visibility.IsPrivate}}checked{{end}}>
						<label>{{ctx.Locale.Tr "org.settings.visibility.private"}}</label>
					</div>
				</div>
			</div>

			<div class="field" id="permission_box">
				<label>{{ctx.Locale.Tr "org.settings.permission"}}</label>
				<div class="ui checkbox">
					<input id="create-org-repo-admin-change-team-access" type="checkbox" name="repo_admin_change_team_access" {{if .repo_admin_change_team_access}}checked{{end}}>
					<label>{{ctx.Locale.Tr "org.settings.repoadminchangeteam"}}</label>
				</div>
			</div>
		</div>

		<div class="actions">
			<button type="button" class="ui cancel button">
				{{svg "octicon-x"}} {{ctx.Locale.Tr "cancel"}}
			</button>
			<button class="ui primary button">
				{{svg "octicon-check"}} {{ctx.Locale.Tr "org.create_org"}}
			</button>
		</div>
	</form>
</div>
