diff --git a/routers/web/repo/setting/setting.go b/routers/web/repo/setting/setting.go index 1e1d122cd1..d0620c5d03 100644 --- a/routers/web/repo/setting/setting.go +++ b/routers/web/repo/setting/setting.go @@ -703,7 +703,7 @@ func handleSettingsPostAdvanced(ctx *context.Context) { log.Trace("Repository advanced settings updated: %s/%s", ctx.Repo.Owner.Name, repo.Name) ctx.Flash.Success(ctx.Tr("repo.settings.update_settings_success")) - ctx.Redirect(ctx.Repo.RepoLink + "/settings") + ctx.Redirect(ctx.Repo.RepoLink + "/settings/advanced") } func handleSettingsPostSigning(ctx *context.Context) { diff --git a/templates/repo/settings/advanced.tmpl b/templates/repo/settings/advanced.tmpl index 00c438a6ef..f96337a3d5 100644 --- a/templates/repo/settings/advanced.tmpl +++ b/templates/repo/settings/advanced.tmpl @@ -6,9 +6,9 @@
+ {{/* ── Code ── */}} -
-
{{svg "octicon-code" 16}} {{ctx.Locale.Tr "repo.code"}}
+
{{svg "octicon-code" 16}} {{ctx.Locale.Tr "repo.code"}}
{{$isCodeEnabled := .Repository.UnitEnabled ctx ctx.Consts.RepoUnitTypeCode}} {{$isCodeGlobalDisabled := ctx.Consts.RepoUnitTypeCode.UnitGlobalDisabled}}
@@ -16,11 +16,10 @@
-
+
+ {{/* ── Wiki ── */}} -
-
-
{{svg "octicon-book" 16}} {{ctx.Locale.Tr "repo.wiki"}}
+
{{svg "octicon-book" 16}} {{ctx.Locale.Tr "repo.wiki"}}
{{$isInternalWikiEnabled := .Repository.UnitEnabled ctx ctx.Consts.RepoUnitTypeWiki}} {{$isExternalWikiEnabled := .Repository.UnitEnabled ctx ctx.Consts.RepoUnitTypeExternalWiki}} {{$isWikiEnabled := or $isInternalWikiEnabled $isExternalWikiEnabled}} @@ -32,6 +31,7 @@
+
@@ -63,21 +63,20 @@

{{ctx.Locale.Tr "repo.settings.external_wiki_url_desc"}}

-
+
+ {{/* ── Issues ── */}} -
-
-
{{svg "octicon-issue-opened" 16}} {{ctx.Locale.Tr "repo.issues"}}
+
{{svg "octicon-issue-opened" 16}} {{ctx.Locale.Tr "repo.issues"}}
{{$isIssuesEnabled := or (.Repository.UnitEnabled ctx ctx.Consts.RepoUnitTypeIssues) (.Repository.UnitEnabled ctx ctx.Consts.RepoUnitTypeExternalTracker)}} {{$isIssuesGlobalDisabled := ctx.Consts.RepoUnitTypeIssues.UnitGlobalDisabled}} {{$isExternalTrackerGlobalDisabled := ctx.Consts.RepoUnitTypeExternalTracker.UnitGlobalDisabled}} {{$isIssuesAndExternalGlobalDisabled := and $isIssuesGlobalDisabled $isExternalTrackerGlobalDisabled}}
-
+
@@ -164,20 +163,19 @@

{{ctx.Locale.Tr "repo.settings.tracker_issue_style.regexp_pattern_desc"}}

-
+
+ {{/* ── Projects ── */}} -
-
-
{{svg "octicon-project" 16}} {{ctx.Locale.Tr "repo.projects"}}
+
{{svg "octicon-project" 16}} {{ctx.Locale.Tr "repo.projects"}}
{{$isProjectsEnabled := .Repository.UnitEnabled ctx ctx.Consts.RepoUnitTypeProjects}} {{$isProjectsGlobalDisabled := ctx.Consts.RepoUnitTypeProjects.UnitGlobalDisabled}} {{$projectsUnit := .Repository.MustGetUnit ctx ctx.Consts.RepoUnitTypeProjects}}
-
+

{{ctx.Locale.Tr "repo.settings.projects_mode_desc"}} @@ -206,11 +204,10 @@

{{ctx.Locale.Tr "repo.settings.projects_mode_all"}}
- + + {{/* ── Releases ── */}} -
-
-
{{svg "octicon-tag" 16}} {{ctx.Locale.Tr "repo.releases"}}
+
{{svg "octicon-tag" 16}} {{ctx.Locale.Tr "repo.releases"}}
{{$isReleasesEnabled := .Repository.UnitEnabled ctx ctx.Consts.RepoUnitTypeReleases}} {{$isReleasesGlobalDisabled := ctx.Consts.RepoUnitTypeReleases.UnitGlobalDisabled}}
@@ -218,6 +215,7 @@
+
@@ -227,11 +225,20 @@

{{ctx.Locale.Tr "repo.settings.unit_visibility_releases_help"}}

+
+ + {{/* ── Licensing ── */}} +
{{svg "octicon-key" 16}} {{ctx.Locale.Tr "repo.settings.licensing_section"}}
+
+
+ +
+
+

{{ctx.Locale.Tr "repo.settings.enable_licensing_help"}}

+ {{/* ── Packages ── */}} -
-
-
{{svg "octicon-package" 16}} {{ctx.Locale.Tr "repo.packages"}}
+
{{svg "octicon-package" 16}} {{ctx.Locale.Tr "repo.packages"}}
{{$isPackagesEnabled := .Repository.UnitEnabled ctx ctx.Consts.RepoUnitTypePackages}} {{$isPackagesGlobalDisabled := ctx.Consts.RepoUnitTypePackages.UnitGlobalDisabled}}
@@ -239,17 +246,15 @@
-
+ + {{if not .IsMirror}} {{/* ── Pull Requests ── */}} -
-
-
{{svg "octicon-git-pull-request" 16}} {{ctx.Locale.Tr "repo.pulls"}}
+
{{svg "octicon-git-pull-request" 16}} {{ctx.Locale.Tr "repo.pulls"}}
{{$pullRequestEnabled := .Repository.UnitEnabled ctx ctx.Consts.RepoUnitTypePullRequests}} {{$pullRequestGlobalDisabled := ctx.Consts.RepoUnitTypePullRequests.UnitGlobalDisabled}} {{$prUnit := .Repository.MustGetUnit ctx ctx.Consts.RepoUnitTypePullRequests}}
-
@@ -381,7 +386,7 @@
{{end}} -
+
diff --git a/templates/repo/settings/navbar.tmpl b/templates/repo/settings/navbar.tmpl index d08646ae56..ca126fea69 100644 --- a/templates/repo/settings/navbar.tmpl +++ b/templates/repo/settings/navbar.tmpl @@ -7,9 +7,11 @@ {{svg "octicon-tools"}} {{ctx.Locale.Tr "repo.settings.advanced_settings"}} + {{if .LicensingEnabled}} {{svg "octicon-key"}} {{ctx.Locale.Tr "repo.settings.licensing_section"}} + {{end}} {{svg "octicon-list-unordered"}} {{ctx.Locale.Tr "repo.settings.custom_fields"}}