From c948696488837616febfcb806b390af1718adb79 Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Thu, 4 Jun 2026 16:38:49 -0500 Subject: [PATCH 1/2] feat(ui): show Update Server tab when no gating, Licenses tab when gated - No gating: tab shows as "Update Server" with broadcast icon - Gated (prerelease/all): tab shows as "Licenses" with key icon and package count badge - Licensing disabled: tab hidden entirely Co-Authored-By: Claude Opus 4.6 (1M context) --- services/context/repo.go | 2 ++ templates/repo/header.tmpl | 10 +++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) 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}} -- 2.52.0 From d6d0d5a11ff8901fc14a57de9c44e8ffd5a0e9c6 Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Thu, 4 Jun 2026 16:43:41 -0500 Subject: [PATCH 2/2] feat(ui): hide license sections on Update Server page when no gating When download_gating is off, the Update Server page only shows feed URLs. License packages, keys, master key, and modals are hidden since they're not relevant without download gating. Co-Authored-By: Claude Opus 4.6 (1M context) --- templates/repo/licenses.tmpl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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}}