diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 612e831dad..0f1b894393 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -2843,11 +2843,11 @@ settings.visibility = Visibility settings.change_visibility = Change Visibility settings.invalid_visibility = The new visibility is not valid. settings.change_visibility_notices_1 = This operation CANNOT be undone. -settings.change_visibility_notices_2 = Some users will no longer be able to access the organization’s repositories. -settings.change_visibility_no_change = There has been no change in visibility. +settings.change_visibility_notices_2 = Non-members will lose access to the organization’s repositories if visibility is changed to private. +settings.change_visibility_no_change = You did not make any changes to visibility. settings.change_visibility_failed = Failed to change the visibility of %s due to an internal error. settings.change_visibility_success = The visibility of organization %s has been successfully changed. -settings.visibility_desc = Change the organization visibility +settings.visibility_desc = Change who can view the organization and its repositories. settings.visibility.public = Public settings.visibility.limited = Limited (Visible to authenticated users only) settings.visibility.limited_shortname = Limited diff --git a/routers/web/org/setting.go b/routers/web/org/setting.go index 8d62c2edab..d2965c2c3e 100644 --- a/routers/web/org/setting.go +++ b/routers/web/org/setting.go @@ -233,7 +233,7 @@ func SettingsRenamePost(ctx *context.Context) { // SettingsChangeVisibilityPost response for change organization visibility func SettingsChangeVisibilityPost(ctx *context.Context) { - visibility := structs.VisibleType(ctx.FormInt("visibility")) + visibility := structs.VisibilityModes[ctx.FormString("visibility")] if !visibility.IsValid() { ctx.JSONError(ctx.Tr("org.settings.invalid_visibility")) return diff --git a/templates/org/settings/options_dangerzone.tmpl b/templates/org/settings/options_dangerzone.tmpl index c21cbbde4b..f761c4ea7e 100644 --- a/templates/org/settings/options_dangerzone.tmpl +++ b/templates/org/settings/options_dangerzone.tmpl @@ -48,25 +48,26 @@
diff --git a/web_src/js/features/org-settings.ts b/web_src/js/features/org-settings.ts new file mode 100644 index 0000000000..4d20f55021 --- /dev/null +++ b/web_src/js/features/org-settings.ts @@ -0,0 +1,25 @@ +function initOrgVisibilityChange() { + const visibilityModal = document.querySelector('#change-visibility-org-modal'); + if (!visibilityModal) return; + + const visibilitySelect = visibilityModal.querySelectorAll