<h4 class="ui top attached error header">
	{{ctx.Locale.Tr "repo.settings.danger_zone"}}
</h4>
<div class="ui attached error danger segment">
	<div class="flex-list">
		<div class="flex-item tw-items-center">
			<div class="flex-item-main">
				<div class="flex-item-title">{{ctx.Locale.Tr "org.settings.visibility"}}</div>
				<div class="flex-item-body">{{ctx.Locale.Tr "org.settings.visibility_desc"}}</div>
			</div>
			<div class="flex-item-trailing">
				<button class="ui basic red show-modal button" data-modal="#change-visibility-org-modal">{{ctx.Locale.Tr "org.settings.change_visibility"}}</button>
			</div>
		</div>

		<div class="flex-item tw-items-center">
			<div class="flex-item-main">
				<div class="flex-item-title">{{ctx.Locale.Tr "org.settings.rename"}}</div>
				<div class="flex-item-body">{{ctx.Locale.Tr "org.settings.rename_desc"}}</div>
			</div>
			<div class="flex-item-trailing">
				<button class="ui basic red show-modal button" data-modal="#rename-org-modal">{{ctx.Locale.Tr "org.settings.rename"}}</button>
			</div>
		</div>

		<div class="flex-item">
			<div class="flex-item-main">
				<div class="flex-item-title">{{ctx.Locale.Tr "org.settings.delete_account"}}</div>
				<div class="flex-item-body">{{ctx.Locale.Tr "org.settings.delete_prompt"}}</div>
			</div>
			<div class="flex-item-trailing">
				<button class="ui basic red show-modal button" data-modal="#delete-org-modal">{{ctx.Locale.Tr "org.settings.delete_account"}}</button>
			</div>
		</div>
	</div>
</div>

<div class="ui small modal" id="change-visibility-org-modal">
	<div class="header">
		{{ctx.Locale.Tr "org.settings.change_visibility"}}
	</div>
	<div class="content">
		<div class="ui warning message">
			<ul>
				<li>{{ctx.Locale.Tr "org.settings.change_visibility_notices_1"}}</li>
				<li>{{ctx.Locale.Tr "org.settings.change_visibility_notices_2"}}</li>
			</ul>
		</div>
		<form class="ui form form-fetch-action" action="{{.Link}}/visibility" method="post">
			<input type="hidden" name="current_visibility" value="{{.CurrentVisibility}}">
			<div class="tw-flex tw-flex-col tw-gap-3">
				<label>{{ctx.Locale.Tr "org.settings.visibility"}}</label>
				<div class="ui radio checkbox">
					<input name="visibility" type="radio" value="public" {{if .CurrentVisibility.IsPublic}}checked{{end}}>
					<label>{{ctx.Locale.Tr "org.settings.visibility.public"}}</label>
				</div>
				<div class="ui radio checkbox">
					<input name="visibility" type="radio" value="limited" {{if .CurrentVisibility.IsLimited}}checked{{end}}>
					<label>{{ctx.Locale.Tr "org.settings.visibility.limited"}}</label>
				</div>
				<div class="ui radio checkbox">
					<input name="visibility" type="radio" value="private" {{if .CurrentVisibility.IsPrivate}}checked{{end}}>
					<label>{{ctx.Locale.Tr "org.settings.visibility.private"}}</label>
				</div>
			</div>

			<div class="actions">
				<button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
				<button class="ui red button">{{ctx.Locale.Tr "org.settings.change_visibility"}}</button>
			</div>
		</form>
	</div>
</div>

<div class="ui small modal" id="rename-org-modal">
	<div class="header">
		{{ctx.Locale.Tr "org.settings.rename"}}
	</div>
	<div class="content">
		<div class="ui warning message">
			<ul>
				<li>{{ctx.Locale.Tr "org.settings.rename_notices_1"}}</li>
				<li>{{ctx.Locale.Tr "org.settings.rename_notices_2"}}</li>
			</ul>
		</div>
		<form class="ui form form-fetch-action" action="{{.Link}}/rename" method="post">
			<div class="field">
				<label>
					{{ctx.Locale.Tr "org.settings.name_confirm"}}
					<span class="tw-text-red">{{.Org.Name}}</span>
				</label>
			</div>
			<div class="required field">
				<label for="org_name_to_rename">{{ctx.Locale.Tr "org.org_name_holder"}}</label>
				<input id="org_name_to_rename" name="org_name" required>
			</div>

			<div class="required field">
				<label>{{ctx.Locale.Tr "org.settings.rename_new_org_name"}}</label>
				<input name="new_org_name" required>
			</div>

			<div class="actions">
				<button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
				<button class="ui red button">{{ctx.Locale.Tr "org.settings.rename"}}</button>
			</div>
		</form>
	</div>
</div>

<div class="ui small modal" id="delete-org-modal">
	<div class="header">
		{{ctx.Locale.Tr "org.settings.delete_account"}}
	</div>
	<div class="content">
		<div class="ui warning message">
			<ul>
				<li>{{ctx.Locale.Tr "org.settings.delete_notices_1"}}</li>
				<li>{{ctx.Locale.Tr "org.settings.delete_notices_2" .Org.Name}}</li>
				<li>{{ctx.Locale.Tr "org.settings.delete_notices_3" .Org.Name}}</li>
				<li>{{ctx.Locale.Tr "org.settings.delete_notices_4" .Org.Name}}</li>
			</ul>
		</div>
		<form class="ui form form-fetch-action" action="{{.Link}}/delete" method="post">
			<div class="field">
				<label>
					{{ctx.Locale.Tr "org.settings.name_confirm"}}
					<span class="tw-text-red">{{.Org.Name}}</span>
				</label>
			</div>
			<div class="required field">
				<label>{{ctx.Locale.Tr "org.org_name_holder"}}</label>
				<input name="org_name" required>
			</div>

			<div class="actions">
				<button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
				<button class="ui red button">{{ctx.Locale.Tr "org.settings.delete_account"}}</button>
			</div>
		</form>
	</div>
</div>
