{{template "base/head" .}}
{{template "repo/header" .}} {{template "repo/settings/navbar" .}}
{{template "base/alert" .}}

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

{{template "base/disable_form_autofill"}} {{.CsrfTokenHtml}}
{{FileSize .Repository.Size}}
{{if not .Repository.IsFork}}
{{if .IsAdmin}} {{else}} {{end}}
{{end}}
{{.CsrfTokenHtml}}
{{$.i18n.Tr "settings.delete_current_avatar"}}
{{if .MirrorsEnabled}}

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

{{$.i18n.Tr "repo.settings.mirror_settings.docs" | Safe}} {{if or .Repository.IsMirror .Repository.PushMirrors}} {{end}} {{if .Repository.IsMirror}} {{end}} {{range .Repository.PushMirrors}} {{$address := MirrorRemoteAddress .}} {{else}} {{end}} {{if (not .DisableNewPushMirrors)}} {{end}}
{{$.i18n.Tr "repo.settings.mirror_settings.mirrored_repository"}} {{$.i18n.Tr "repo.settings.mirror_settings.direction"}} {{$.i18n.Tr "repo.settings.mirror_settings.last_update"}}
{{(MirrorRemoteAddress .Mirror).Address}} {{$.i18n.Tr "repo.settings.mirror_settings.direction.pull"}} {{.Mirror.UpdatedUnix.AsTime}}
{{.CsrfTokenHtml}}
{{template "base/disable_form_autofill"}} {{.CsrfTokenHtml}}
{{$address := MirrorRemoteAddress .Mirror}}

{{.i18n.Tr "repo.mirror_address_desc"}}

{{.i18n.Tr "repo.need_auth"}}

{{.i18n.Tr "repo.mirror_password_help"}}

{{if .LFSStartServer}}

{{.i18n.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}} {{$.i18n.Tr "repo.settings.mirror_settings.direction.push"}} {{if .LastUpdateUnix}}{{.LastUpdateUnix.AsTime}}{{else}}{{$.i18n.Tr "never"}}{{end}} {{if .LastError}}
{{$.i18n.Tr "error"}}
{{end}}
{{$.CsrfTokenHtml}}
{{$.CsrfTokenHtml}}
{{$.i18n.Tr "repo.settings.mirror_settings.push_mirror.none"}}
{{template "base/disable_form_autofill"}} {{.CsrfTokenHtml}}

{{.i18n.Tr "repo.mirror_address_desc"}}

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

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

{{.CsrfTokenHtml}} {{$isWikiEnabled := or (.Repository.UnitEnabled $.UnitTypeWiki) (.Repository.UnitEnabled $.UnitTypeExternalWiki)}}
{{if and (.UnitTypeWiki.UnitGlobalDisabled) (.UnitTypeExternalWiki.UnitGlobalDisabled)}}
{{else}}
{{end}}
{{if .UnitTypeWiki.UnitGlobalDisabled}}
{{else}}
{{end}}
{{if .UnitTypeExternalWiki.UnitGlobalDisabled}}
{{else}}
{{end}}

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

{{$isIssuesEnabled := or (.Repository.UnitEnabled $.UnitTypeIssues) (.Repository.UnitEnabled $.UnitTypeExternalTracker)}}
{{if and (.UnitTypeIssues.UnitGlobalDisabled) (.UnitTypeExternalTracker.UnitGlobalDisabled)}}
{{else}}
{{end}}
{{if .UnitTypeIssues.UnitGlobalDisabled}}
{{else}}
{{end}}
{{if .Repository.CanEnableTimetracker}}
{{end}}
{{if .UnitTypeExternalTracker.UnitGlobalDisabled}}
{{else}}
{{end}}

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

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

{{$externalTracker := (.Repository.MustGetUnit $.UnitTypeExternalTracker)}} {{$externalTrackerStyle := $externalTracker.ExternalTrackerConfig.ExternalTrackerStyle}}
{{$isProjectsEnabled := .Repository.UnitEnabled $.UnitTypeProjects}}
{{if .UnitTypeProjects.UnitGlobalDisabled}}
{{else}}
{{end}}
{{if not .IsMirror}}
{{$pullRequestEnabled := .Repository.UnitEnabled $.UnitTypePullRequests}} {{$prUnit := .Repository.MustGetUnit $.UnitTypePullRequests}}
{{if .UnitTypePullRequests.UnitGlobalDisabled}}
{{else}}
{{end}}

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

{{end}}

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

{{.CsrfTokenHtml}}

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

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

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

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

{{if .IsAdmin}}

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

{{.CsrfTokenHtml}}
{{end}} {{if .Permission.IsOwner}}

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

{{if .Repository.IsMirror}}
{{.i18n.Tr "repo.settings.convert"}}

{{.i18n.Tr "repo.settings.convert_desc"}}

{{end}} {{if and .Repository.IsFork .Repository.Owner.CanCreateRepo}}
{{.i18n.Tr "repo.settings.convert_fork"}}

{{.i18n.Tr "repo.settings.convert_fork_desc"}}

{{end}}
{{if .RepoTransfer}}
{{.CsrfTokenHtml}}
{{ else }} {{ end }}
{{.i18n.Tr "repo.settings.transfer"}}
{{if .RepoTransfer}}

{{.i18n.Tr "repo.settings.transfer_started" .RepoTransfer.Recipient.DisplayName}}

{{else}}

{{.i18n.Tr "repo.settings.transfer_desc"}}

{{end}}
{{if .Permission.CanRead $.UnitTypeWiki}}
{{.i18n.Tr "repo.settings.wiki_delete"}}

{{.i18n.Tr "repo.settings.wiki_delete_desc"}}

{{end}}
{{.i18n.Tr "repo.settings.delete"}}

{{.i18n.Tr "repo.settings.delete_desc"}}

{{if not .Repository.IsMirror}}
{{if .Repository.IsArchived}}
{{.i18n.Tr "repo.settings.unarchive.header"}}

{{.i18n.Tr "repo.settings.unarchive.text"}}

{{else}}
{{.i18n.Tr "repo.settings.archive.header"}}

{{.i18n.Tr "repo.settings.archive.text"}}

{{end}}
{{end}}
{{end}}
{{if .Permission.IsOwner}} {{if .Repository.IsMirror}} {{end}} {{if and .Repository.IsFork .Repository.Owner.CanCreateRepo}} {{end}} {{if .Repository.UnitEnabled $.UnitTypeWiki}} {{end}} {{if not .Repository.IsMirror}} {{end}} {{end}} {{template "base/footer" .}}