From f82cdc3d6cda68424f0d1b7611b7bdba9f344a34 Mon Sep 17 00:00:00 2001
From: Lunny Xiao
Date: Fri, 8 May 2026 10:43:31 -0700
Subject: [PATCH] add a link to change the visibility of package
---
options/locale/locale_en-US.json | 3 +++
templates/package/settings.tmpl | 11 +++++++++++
2 files changed, 14 insertions(+)
diff --git a/options/locale/locale_en-US.json b/options/locale/locale_en-US.json
index 29fe931a6f..ad421a4032 100644
--- a/options/locale/locale_en-US.json
+++ b/options/locale/locale_en-US.json
@@ -3623,6 +3623,9 @@
"packages.vagrant.install": "To add a Vagrant box, run the following command:",
"packages.settings.link": "Link this package to a repository",
"packages.settings.link.description": "If you link a package with a repository, the package will appear in the repository's package list. This link does not change the package visibility. Only repositories under the same owner can be linked. Leaving the field empty will remove the link.",
+ "packages.settings.visibility": "Package visibility",
+ "packages.settings.visibility.inherit": "Package visibility is inherited from the owner and cannot be changed independently here. To change it, update the visibility settings of the user or organization that owns this package.",
+ "packages.settings.visibility.button": "Change owner visibility",
"packages.settings.link.select": "Select Repository",
"packages.settings.link.button": "Update Repository Link",
"packages.settings.link.success": "Repository link was successfully updated.",
diff --git a/templates/package/settings.tmpl b/templates/package/settings.tmpl
index d5577a8974..8e7490c469 100644
--- a/templates/package/settings.tmpl
+++ b/templates/package/settings.tmpl
@@ -17,6 +17,17 @@
/ {{ctx.Locale.Tr "repo.settings"}}
+ {{$visibilitySettingsLink := print AppSubUrl "/user/settings"}}
+ {{if .ContextUser.IsOrganization}}
+ {{$visibilitySettingsLink = print .ContextUser.OrganisationLink "/settings"}}
+ {{end}}
+
+