{{template "repo/settings/layout_head" (dict "pageClass" "repository settings updateserver")}}
	<div class="user-main-content twelve wide column">
		<h4 class="ui top attached header">
			{{svg "octicon-broadcast" 16}} Update Server
		</h4>
		<div class="ui attached segment">
			<form class="ui form" method="post" action="{{.RepoLink}}/settings/updateserver">
				{{.CsrfTokenHtml}}

				<div class="inline field">
					<div class="ui checkbox">
						<input name="enable_licensing" type="checkbox" {{if and .RepoUpdateConfig .RepoUpdateConfig.LicensingEnabled}}checked{{end}}>
						<label><strong>Enable Update Server</strong></label>
					</div>
					<p class="help">Serve update feeds from releases and show the Licenses tab for optional key management.</p>
				</div>

				<div class="ui divider"></div>

				<div class="inline field">
					<label>Feed Visibility</label>
					<select name="feed_visibility" class="ui dropdown">
						<option value="public" {{if or (not .RepoUpdateConfig) (eq .RepoUpdateConfig.FeedVisibility "") (eq .RepoUpdateConfig.FeedVisibility "public")}}selected{{end}}>Public (show versions and downloads)</option>
						<option value="no-download" {{if and .RepoUpdateConfig (eq .RepoUpdateConfig.FeedVisibility "no-download")}}selected{{end}}>No downloads (show versions only)</option>
						<option value="hidden" {{if and .RepoUpdateConfig (eq .RepoUpdateConfig.FeedVisibility "hidden")}}selected{{end}}>Hidden (require license key)</option>
					</select>
				</div>

				<div class="inline field">
					<label>Download Gating</label>
					<select name="download_gating" class="ui dropdown">
						<option value="none" {{if or (not .RepoUpdateConfig) (eq .RepoUpdateConfig.DownloadGating "") (eq .RepoUpdateConfig.DownloadGating "none")}}selected{{end}}>None</option>
						<option value="prerelease" {{if and .RepoUpdateConfig (eq .RepoUpdateConfig.DownloadGating "prerelease")}}selected{{end}}>Pre-release only</option>
						<option value="all" {{if and .RepoUpdateConfig (eq .RepoUpdateConfig.DownloadGating "all")}}selected{{end}}>All releases</option>
					</select>
				</div>

				<div class="inline field">
					<div class="ui checkbox">
						<input name="require_update_key" type="checkbox" {{if and .RepoUpdateConfig .RepoUpdateConfig.RequireKey}}checked{{end}}>
						<label>Require license key for update feed</label>
					</div>
				</div>

				<div class="field">
					<button class="ui primary button">Save</button>
				</div>
			</form>
		</div>
	</div>
{{template "repo/settings/layout_footer" .}}
