diff --git a/services/context/repo.go b/services/context/repo.go index 957c27ed0d..a2ae5bff20 100644 --- a/services/context/repo.go +++ b/services/context/repo.go @@ -663,6 +663,8 @@ func repoAssignmentPrepareTemplateData(ctx *Context, data *repoAssignmentPrepare ctx.Data["NumLicensePackages"] = numLicensePackages ctx.Data["EnableLicenses"] = licensingEnabled || numLicensePackages > 0 ctx.Data["LicensingEnabled"] = licensingEnabled + downloadGated := repoUpdateCfg != nil && repoUpdateCfg.DownloadGating != "" && repoUpdateCfg.DownloadGating != "none" + ctx.Data["DownloadGated"] = downloadGated // Determine release page access based on feed visibility mode. feedVis := "public" diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index 06bb146d95..23cebf9b6e 100644 --- a/templates/repo/header.tmpl +++ b/templates/repo/header.tmpl @@ -130,9 +130,13 @@ {{if and .LicensingEnabled .IsSigned}} - {{svg "octicon-key"}} {{ctx.Locale.Tr "repo.licenses"}} - {{if .NumLicensePackages}} - {{CountFmt .NumLicensePackages}} + {{if .DownloadGated}} + {{svg "octicon-key"}} {{ctx.Locale.Tr "repo.licenses"}} + {{if .NumLicensePackages}} + {{CountFmt .NumLicensePackages}} + {{end}} + {{else}} + {{svg "octicon-broadcast"}} {{ctx.Locale.Tr "repo.settings.licensing_section"}} {{end}} {{end}} diff --git a/templates/repo/licenses.tmpl b/templates/repo/licenses.tmpl index 41b6db02f9..fec5e8c7d7 100644 --- a/templates/repo/licenses.tmpl +++ b/templates/repo/licenses.tmpl @@ -3,6 +3,7 @@ {{template "repo/header" .}}
+ {{if .DownloadGated}} {{if .NewMasterKey}}
{{ctx.Locale.Tr "repo.licenses.master_key_created"}}
@@ -224,6 +225,8 @@ {{end}} + {{end}}{{/* end DownloadGated */}} + {{/* ── Update Feed URLs ── */}} {{if .LicensingEnabled}}

@@ -333,7 +336,7 @@ {{end}} {{/* ── Generate Key Modal ── */}} -{{if .IsRepoAdmin}} +{{if and .DownloadGated .IsRepoAdmin}}