{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings options")}}

{{.locale.Tr "repo.settings.basic_settings"}}

{{template "base/disable_form_autofill"}} {{.CsrfTokenHtml}}
{{FileSize .Repository.Size}}
{{if not .Repository.IsFork}}
{{if .IsAdmin}} {{else}} {{end}}
{{end}}
{{.CsrfTokenHtml}}
{{/* These variables exist to make the logic in the Settings window easier to comprehend and are not used later on. */}} {{$newMirrorsPartiallyEnabled := or (not .DisableNewPullMirrors) (not .DisableNewPushMirrors)}} {{/* .Repository.IsMirror is not always reliable if the repository is not actively acting as a mirror because of errors. */}} {{$showMirrorSettings := or $newMirrorsPartiallyEnabled .Repository.IsMirror .PullMirror .PushMirrors}} {{$newMirrorsEntirelyEnabled := and (not .DisableNewPullMirrors) (not .DisableNewPushMirrors)}} {{$onlyNewPushMirrorsEnabled := and (not .DisableNewPushMirrors) .DisableNewPullMirrors}} {{$onlyNewPullMirrorsEnabled := and .DisableNewPushMirrors (not .DisableNewPullMirrors)}} {{$existingPushMirror := or .Repository.IsMirror .PushMirrors}} {{$modifyBrokenPullMirror := and .Repository.IsMirror (not .PullMirror)}} {{$isWorkingPullMirror := .PullMirror}} {{if $showMirrorSettings}}

{{.locale.Tr "repo.settings.mirror_settings"}}

{{if $newMirrorsEntirelyEnabled}} {{$.locale.Tr "repo.settings.mirror_settings.docs"}} {{$.locale.Tr "repo.settings.mirror_settings.docs.doc_link_title"}}

{{$.locale.Tr "repo.settings.mirror_settings.docs.pull_mirror_instructions"}} {{$.locale.Tr "repo.settings.mirror_settings.docs.doc_link_title"}}
{{else if $onlyNewPushMirrorsEnabled}} {{$.locale.Tr "repo.settings.mirror_settings.docs.disabled_pull_mirror.instructions"}} {{$.locale.Tr "repo.settings.mirror_settings.docs.doc_link_title"}}
{{else if $onlyNewPullMirrorsEnabled}} {{$.locale.Tr "repo.settings.mirror_settings.docs.disabled_push_mirror.instructions"}} {{$.locale.Tr "repo.settings.mirror_settings.docs.disabled_push_mirror.pull_mirror_warning"}} {{$.locale.Tr "repo.settings.mirror_settings.docs.doc_link_title"}}

{{$.locale.Tr "repo.settings.mirror_settings.docs.disabled_push_mirror.info"}} {{if $existingPushMirror}} {{$.locale.Tr "repo.settings.mirror_settings.docs.can_still_use"}} {{end}} {{else}} {{$.locale.Tr "repo.settings.mirror_settings.docs.no_new_mirrors"}} {{$.locale.Tr "repo.settings.mirror_settings.docs.can_still_use"}}
{{end}} {{if $existingPushMirror}} {{end}} {{if $modifyBrokenPullMirror}} {{/* even if a repo is a pull mirror (IsMirror=true), the PullMirror might still be nil if the mirror migration is broken */}} {{else if $isWorkingPullMirror}} {{end}}{{/* end if: IsMirror */}} {{range .PushMirrors}} {{$address := MirrorRemoteAddress $.Context $.Repository .GetRemoteName true}} {{else}} {{end}} {{if (not .DisableNewPushMirrors)}} {{end}}
{{$.locale.Tr "repo.settings.mirror_settings.mirrored_repository"}} {{$.locale.Tr "repo.settings.mirror_settings.direction"}} {{$.locale.Tr "repo.settings.mirror_settings.last_update"}}
{{$.locale.Tr "repo.settings.mirror_settings.direction.pull"}}: {{$.locale.Tr "error.occurred"}}
{{(MirrorRemoteAddress $.Context .Repository .PullMirror.GetRemoteName false).Address}} {{$.locale.Tr "repo.settings.mirror_settings.direction.pull"}} {{DateTime "full" .PullMirror.UpdatedUnix}}
{{.CsrfTokenHtml}}
{{template "base/disable_form_autofill"}} {{.CsrfTokenHtml}}
{{$address := MirrorRemoteAddress $.Context .Repository .PullMirror.GetRemoteName false}}

{{.locale.Tr "repo.mirror_address_desc"}}

{{.locale.Tr "repo.need_auth"}}

{{.locale.Tr "repo.mirror_password_help"}}

{{if .LFSStartServer}}

{{.locale.Tr "repo.mirror_lfs_endpoint_desc" "https://github.com/git-lfs/git-lfs/blob/main/docs/api/server-discovery.md#server-discovery" | Str2html}}

{{end}}
{{$address.Address}} {{$.locale.Tr "repo.settings.mirror_settings.direction.push"}} {{if .LastUpdateUnix}}{{DateTime "full" .LastUpdateUnix}}{{else}}{{$.locale.Tr "never"}}{{end}} {{if .LastError}}
{{$.locale.Tr "error"}}
{{end}}
{{$.CsrfTokenHtml}}
{{$.CsrfTokenHtml}}
{{$.locale.Tr "repo.settings.mirror_settings.push_mirror.none"}}
{{template "base/disable_form_autofill"}} {{.CsrfTokenHtml}}

{{.locale.Tr "repo.mirror_address_desc"}}

{{.locale.Tr "repo.need_auth"}}
{{end}}

{{.locale.Tr "repo.settings.advanced_settings"}}

{{.CsrfTokenHtml}} {{$isCodeEnabled := .Repository.UnitEnabled $.Context $.UnitTypeCode}} {{$isCodeGlobalDisabled := .UnitTypeCode.UnitGlobalDisabled}}
{{$isWikiEnabled := or (.Repository.UnitEnabled $.Context $.UnitTypeWiki) (.Repository.UnitEnabled $.Context $.UnitTypeExternalWiki)}} {{$isWikiGlobalDisabled := .UnitTypeWiki.UnitGlobalDisabled}} {{$isExternalWikiGlobalDisabled := .UnitTypeExternalWiki.UnitGlobalDisabled}} {{$isBothWikiGlobalDisabled := and $isWikiGlobalDisabled $isExternalWikiGlobalDisabled}}

{{.locale.Tr "repo.settings.external_wiki_url_desc"}}

{{$isIssuesEnabled := or (.Repository.UnitEnabled $.Context $.UnitTypeIssues) (.Repository.UnitEnabled $.Context $.UnitTypeExternalTracker)}} {{$isIssuesGlobalDisabled := .UnitTypeIssues.UnitGlobalDisabled}} {{$isExternalTrackerGlobalDisabled := .UnitTypeExternalTracker.UnitGlobalDisabled}} {{$isIssuesAndExternalGlobalDisabled := and $isIssuesGlobalDisabled $isExternalTrackerGlobalDisabled}}
{{if .Repository.CanEnableTimetracker}}
{{end}}

{{.locale.Tr "repo.settings.external_tracker_url_desc"}}

{{.locale.Tr "repo.settings.tracker_url_format_desc" | Str2html}}

{{$externalTracker := (.Repository.MustGetUnit $.Context $.UnitTypeExternalTracker)}} {{$externalTrackerStyle := $externalTracker.ExternalTrackerConfig.ExternalTrackerStyle}}

{{.locale.Tr "repo.settings.tracker_issue_style.regexp_pattern_desc" | Str2html}}

{{$isProjectsEnabled := .Repository.UnitEnabled $.Context $.UnitTypeProjects}} {{$isProjectsGlobalDisabled := .UnitTypeProjects.UnitGlobalDisabled}}
{{$isReleasesEnabled := .Repository.UnitEnabled $.Context $.UnitTypeReleases}} {{$isReleasesGlobalDisabled := .UnitTypeReleases.UnitGlobalDisabled}}
{{$isPackagesEnabled := .Repository.UnitEnabled $.Context $.UnitTypePackages}} {{$isPackagesGlobalDisabled := .UnitTypePackages.UnitGlobalDisabled}}
{{if .EnableActions}} {{$isActionsEnabled := .Repository.UnitEnabled $.Context $.UnitTypeActions}} {{$isActionsGlobalDisabled := .UnitTypeActions.UnitGlobalDisabled}}
{{end}} {{if not .IsMirror}}
{{$pullRequestEnabled := .Repository.UnitEnabled $.Context $.UnitTypePullRequests}} {{$pullRequestGlobalDisabled := .UnitTypePullRequests.UnitGlobalDisabled}} {{$prUnit := .Repository.MustGetUnit $.Context $.UnitTypePullRequests}}

{{.locale.Tr "repo.settings.merge_style_desc"}}

{{.locale.Tr "repo.settings.default_merge_style_desc"}}

{{end}}

{{.locale.Tr "repo.settings.signing_settings"}}

{{.CsrfTokenHtml}}

{{.locale.Tr "repo.settings.trust_model.default.desc"}}

{{.locale.Tr "repo.settings.trust_model.collaborator.desc"}}

{{.locale.Tr "repo.settings.trust_model.committer.desc"}}

{{.locale.Tr "repo.settings.trust_model.collaboratorcommitter.desc"}}

{{if .IsAdmin}}

{{.locale.Tr "repo.settings.admin_settings"}}

{{.CsrfTokenHtml}}
{{.CsrfTokenHtml}} {{if .CodeIndexerEnabled}}

{{.locale.Tr "repo.settings.admin_code_indexer"}}

{{if .CodeIndexerStatus}} {{ShortSha .CodeIndexerStatus.CommitSha}} {{else}} {{.locale.Tr "repo.settings.admin_indexer_unindexed"}} {{end}}
{{end}}

{{.locale.Tr "repo.settings.admin_stats_indexer"}}

{{if .StatsIndexerStatus}} {{ShortSha .StatsIndexerStatus.CommitSha}} {{else}} {{.locale.Tr "repo.settings.admin_indexer_unindexed"}} {{end}}
{{end}} {{if .Permission.IsOwner}}

{{.locale.Tr "repo.settings.danger_zone"}}

{{if .Repository.IsMirror}}
{{.locale.Tr "repo.settings.convert"}}
{{.locale.Tr "repo.settings.convert_desc"}}
{{end}} {{if and .Repository.IsFork .Repository.Owner.CanCreateRepo}}
{{.locale.Tr "repo.settings.convert_fork"}}
{{.locale.Tr "repo.settings.convert_fork_desc"}}
{{end}}
{{.locale.Tr "repo.settings.transfer"}}
{{if .RepoTransfer}} {{.locale.Tr "repo.settings.transfer_started" .RepoTransfer.Recipient.DisplayName}} {{else}} {{.locale.Tr "repo.settings.transfer_desc"}} {{end}}
{{if .RepoTransfer}}
{{.CsrfTokenHtml}}
{{else}} {{end}}
{{if .Permission.CanRead $.UnitTypeWiki}}
{{.locale.Tr "repo.settings.wiki_delete"}}
{{.locale.Tr "repo.settings.wiki_delete_desc"}}
{{end}}
{{.locale.Tr "repo.settings.delete"}}
{{.locale.Tr "repo.settings.delete_desc"}}
{{if not .Repository.IsMirror}}
{{if .Repository.IsArchived}}
{{.locale.Tr "repo.settings.unarchive.header"}}
{{.locale.Tr "repo.settings.unarchive.text"}}
{{else}}
{{.locale.Tr "repo.settings.archive.header"}}
{{.locale.Tr "repo.settings.archive.text"}}
{{end}}
{{end}}
{{end}}
{{template "repo/settings/layout_footer" .}} {{if .Permission.IsOwner}} {{if .Repository.IsMirror}} {{end}} {{if and .Repository.IsFork .Repository.Owner.CanCreateRepo}} {{end}} {{if .Repository.UnitEnabled $.Context $.UnitTypeWiki}} {{end}} {{if not .Repository.IsMirror}} {{end}} {{end}}