feat(ui): Update Server tab + hide licenses when no gating #480

Merged
jmiller merged 2 commits from dev into main 2026-06-04 21:44:34 +00:00
3 changed files with 15 additions and 4 deletions
+2
View File
@@ -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"
+7 -3
View File
@@ -130,9 +130,13 @@
{{if and .LicensingEnabled .IsSigned}}
<a href="{{.RepoLink}}/licenses" class="{{if .IsLicensesPage}}active {{end}}item">
{{svg "octicon-key"}} {{ctx.Locale.Tr "repo.licenses"}}
{{if .NumLicensePackages}}
<span class="ui small label">{{CountFmt .NumLicensePackages}}</span>
{{if .DownloadGated}}
{{svg "octicon-key"}} {{ctx.Locale.Tr "repo.licenses"}}
{{if .NumLicensePackages}}
<span class="ui small label">{{CountFmt .NumLicensePackages}}</span>
{{end}}
{{else}}
{{svg "octicon-broadcast"}} {{ctx.Locale.Tr "repo.settings.licensing_section"}}
{{end}}
</a>
{{end}}
+6 -1
View File
@@ -3,6 +3,7 @@
{{template "repo/header" .}}
<div class="ui container">
{{if .DownloadGated}}
{{if .NewMasterKey}}
<div class="ui info message">
<div class="header">{{ctx.Locale.Tr "repo.licenses.master_key_created"}}</div>
@@ -224,6 +225,8 @@
</details>
{{end}}
{{end}}{{/* end DownloadGated */}}
{{/* Update Feed URLs */}}
{{if .LicensingEnabled}}
<h4 class="ui top attached header tw-mt-4">
@@ -333,7 +336,7 @@
{{end}}
{{/* Generate Key Modal */}}
{{if .IsRepoAdmin}}
{{if and .DownloadGated .IsRepoAdmin}}
<div class="ui small modal" id="generate-key-modal">
<div class="header">{{svg "octicon-plus"}} {{ctx.Locale.Tr "repo.licenses.generate_key"}}</div>
<div class="content">
@@ -367,6 +370,7 @@
{{end}}
{{/* Delete Package Confirmation Modal */}}
{{if .DownloadGated}}
<div class="ui small modal" id="license-delete-package-modal">
<div class="header">{{svg "octicon-trash"}} {{ctx.Locale.Tr "repo.licenses.delete_package"}}</div>
<div class="content">
@@ -397,5 +401,6 @@
</form>
</div>
</div>
{{end}}{{/* end DownloadGated for modals */}}
{{template "base/footer" .}}