mirror of
https://github.com/go-gitea/gitea.git
synced 2025-08-04 20:04:46 +00:00
improvements
This commit is contained in:
parent
05e5d6c568
commit
d1f1cf8a29
@ -39,10 +39,6 @@ func (vt VisibleType) IsPrivate() bool {
|
|||||||
return vt == VisibleTypePrivate
|
return vt == VisibleTypePrivate
|
||||||
}
|
}
|
||||||
|
|
||||||
func (vt VisibleType) IsValid() bool {
|
|
||||||
return vt.String() != ""
|
|
||||||
}
|
|
||||||
|
|
||||||
// VisibilityString provides the mode string of the visibility type (public, limited, private)
|
// VisibilityString provides the mode string of the visibility type (public, limited, private)
|
||||||
func (vt VisibleType) String() string {
|
func (vt VisibleType) String() string {
|
||||||
for k, v := range VisibilityModes {
|
for k, v := range VisibilityModes {
|
||||||
|
@ -2844,7 +2844,6 @@ settings.permission = Permissions
|
|||||||
settings.repoadminchangeteam = Repository admin can add and remove access for teams
|
settings.repoadminchangeteam = Repository admin can add and remove access for teams
|
||||||
settings.visibility = Visibility
|
settings.visibility = Visibility
|
||||||
settings.change_visibility = Change Visibility
|
settings.change_visibility = Change Visibility
|
||||||
settings.invalid_visibility = The new visibility is not valid.
|
|
||||||
settings.change_visibility_notices_1 = If the organization is converted to private, the repository stars will be removed and cannot be restored.
|
settings.change_visibility_notices_1 = If the organization is converted to private, the repository stars will be removed and cannot be restored.
|
||||||
settings.change_visibility_notices_2 = Non-members will lose access to the organization’s repositories if visibility is changed to private.
|
settings.change_visibility_notices_2 = Non-members will lose access to the organization’s repositories if visibility is changed to private.
|
||||||
settings.change_visibility_success = The visibility of organization %s has been successfully changed.
|
settings.change_visibility_success = The visibility of organization %s has been successfully changed.
|
||||||
|
@ -233,8 +233,8 @@ func SettingsRenamePost(ctx *context.Context) {
|
|||||||
|
|
||||||
// SettingsChangeVisibilityPost response for change organization visibility
|
// SettingsChangeVisibilityPost response for change organization visibility
|
||||||
func SettingsChangeVisibilityPost(ctx *context.Context) {
|
func SettingsChangeVisibilityPost(ctx *context.Context) {
|
||||||
visibility := structs.VisibilityModes[ctx.FormString("visibility")]
|
visibility, ok := structs.VisibilityModes[ctx.FormString("visibility")]
|
||||||
if !visibility.IsValid() {
|
if !ok {
|
||||||
ctx.Flash.Error(ctx.Tr("invalid_data", visibility))
|
ctx.Flash.Error(ctx.Tr("invalid_data", visibility))
|
||||||
ctx.JSONRedirect(setting.AppSubURL + "/org/" + url.PathEscape(ctx.Org.Organization.Name) + "/settings")
|
ctx.JSONRedirect(setting.AppSubURL + "/org/" + url.PathEscape(ctx.Org.Organization.Name) + "/settings")
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user