{{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}}
{{$.locale.Tr "settings.delete_current_avatar"}}
{{if .MirrorsEnabled}}

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

{{$.locale.Tr "repo.settings.mirror_settings.docs" | Safe}} {{if or .Repository.IsMirror .PushMirrors}} {{end}} {{if .Repository.IsMirror}} {{end}} {{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"}}
{{(MirrorRemoteAddress $.Context .Repository .Mirror.GetRemoteName false).Address}} {{$.locale.Tr "repo.settings.mirror_settings.direction.pull"}} {{template "shared/datetime/full" (dict "Datetime" .Mirror.UpdatedUnix.FormatLong "Fallback" .Mirror.UpdatedUnix.AsTime)}}
{{.CsrfTokenHtml}}
{{template "base/disable_form_autofill"}} {{.CsrfTokenHtml}}
{{$address := MirrorRemoteAddress $.Context .Repository .Mirror.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}}{{template "shared/datetime/full" (dict "Datetime" .LastUpdateUnix.FormatLong "Fallback" .LastUpdateUnix.AsTime)}}{{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}}
{{if .UnitTypeCode.UnitGlobalDisabled}}
{{else}}
{{end}}
{{$isWikiEnabled := or (.Repository.UnitEnabled $.Context $.UnitTypeWiki) (.Repository.UnitEnabled $.Context $.UnitTypeExternalWiki)}}
{{if and (.UnitTypeWiki.UnitGlobalDisabled) (.UnitTypeExternalWiki.UnitGlobalDisabled)}}
{{else}}
{{end}}
{{if .UnitTypeWiki.UnitGlobalDisabled}}
{{else}}
{{end}}
{{if .UnitTypeExternalWiki.UnitGlobalDisabled}}
{{else}}
{{end}}

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

{{$isIssuesEnabled := or (.Repository.UnitEnabled $.Context $.UnitTypeIssues) (.Repository.UnitEnabled $.Context $.UnitTypeExternalTracker)}}
{{if and (.UnitTypeIssues.UnitGlobalDisabled) (.UnitTypeExternalTracker.UnitGlobalDisabled)}}
{{else}}
{{end}}
{{if .UnitTypeIssues.UnitGlobalDisabled}}
{{else}}
{{end}}
{{if .Repository.CanEnableTimetracker}}
{{end}}
{{if .UnitTypeExternalTracker.UnitGlobalDisabled}}
{{else}}
{{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}}
{{if .UnitTypeProjects.UnitGlobalDisabled}}
{{else}}
{{end}}
{{$isReleasesEnabled := .Repository.UnitEnabled $.Context $.UnitTypeReleases}}
{{if .UnitTypeReleases.UnitGlobalDisabled}}
{{else}}
{{end}}
{{$isPackagesEnabled := .Repository.UnitEnabled $.Context $.UnitTypePackages}}
{{if .UnitTypePackages.UnitGlobalDisabled}}
{{else}}
{{end}}
{{if .EnableActions}} {{$isActionsEnabled := .Repository.UnitEnabled $.Context $.UnitTypeActions}}
{{if .UnitTypeActions.UnitGlobalDisabled}}
{{else}}
{{end}}
{{end}} {{if not .IsMirror}}
{{$pullRequestEnabled := .Repository.UnitEnabled $.Context $.UnitTypePullRequests}} {{$prUnit := .Repository.MustGetUnit $.Context $.UnitTypePullRequests}}
{{if .UnitTypePullRequests.UnitGlobalDisabled}}
{{else}}
{{end}}

{{.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}}
{{if .RepoTransfer}}
{{.CsrfTokenHtml}}
{{else}} {{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 .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}}