|
|
@ -57,8 +57,9 @@ const ( |
|
|
|
tplProtectedBranch base.TplName = "repo/settings/protected_branch" |
|
|
|
tplProtectedBranch base.TplName = "repo/settings/protected_branch" |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
// Settings show a repository's settings page
|
|
|
|
// SettingsCtxData is a middleware that sets all the general context data for the
|
|
|
|
func Settings(ctx *context.Context) { |
|
|
|
// settings template.
|
|
|
|
|
|
|
|
func SettingsCtxData(ctx *context.Context) { |
|
|
|
ctx.Data["Title"] = ctx.Tr("repo.settings") |
|
|
|
ctx.Data["Title"] = ctx.Tr("repo.settings") |
|
|
|
ctx.Data["PageIsSettingsOptions"] = true |
|
|
|
ctx.Data["PageIsSettingsOptions"] = true |
|
|
|
ctx.Data["ForcePrivate"] = setting.Repository.ForcePrivate |
|
|
|
ctx.Data["ForcePrivate"] = setting.Repository.ForcePrivate |
|
|
@ -94,15 +95,16 @@ func Settings(ctx *context.Context) { |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
ctx.Data["PushMirrors"] = pushMirrors |
|
|
|
ctx.Data["PushMirrors"] = pushMirrors |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Settings show a repository's settings page
|
|
|
|
|
|
|
|
func Settings(ctx *context.Context) { |
|
|
|
ctx.HTML(http.StatusOK, tplSettingsOptions) |
|
|
|
ctx.HTML(http.StatusOK, tplSettingsOptions) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// SettingsPost response for changes of a repository
|
|
|
|
// SettingsPost response for changes of a repository
|
|
|
|
func SettingsPost(ctx *context.Context) { |
|
|
|
func SettingsPost(ctx *context.Context) { |
|
|
|
form := web.GetForm(ctx).(*forms.RepoSettingForm) |
|
|
|
form := web.GetForm(ctx).(*forms.RepoSettingForm) |
|
|
|
ctx.Data["Title"] = ctx.Tr("repo.settings") |
|
|
|
|
|
|
|
ctx.Data["PageIsSettingsOptions"] = true |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ctx.Data["ForcePrivate"] = setting.Repository.ForcePrivate |
|
|
|
ctx.Data["ForcePrivate"] = setting.Repository.ForcePrivate |
|
|
|
ctx.Data["MirrorsEnabled"] = setting.Mirror.Enabled |
|
|
|
ctx.Data["MirrorsEnabled"] = setting.Mirror.Enabled |
|
|
@ -827,7 +829,7 @@ func handleSettingRemoteAddrError(ctx *context.Context, err error, form *forms.R |
|
|
|
case addrErr.IsProtocolInvalid: |
|
|
|
case addrErr.IsProtocolInvalid: |
|
|
|
ctx.RenderWithErr(ctx.Tr("repo.mirror_address_protocol_invalid"), tplSettingsOptions, form) |
|
|
|
ctx.RenderWithErr(ctx.Tr("repo.mirror_address_protocol_invalid"), tplSettingsOptions, form) |
|
|
|
case addrErr.IsURLError: |
|
|
|
case addrErr.IsURLError: |
|
|
|
ctx.RenderWithErr(ctx.Tr("form.url_error"), tplSettingsOptions, form) |
|
|
|
ctx.RenderWithErr(ctx.Tr("form.url_error", addrErr.Host), tplSettingsOptions, form) |
|
|
|
case addrErr.IsPermissionDenied: |
|
|
|
case addrErr.IsPermissionDenied: |
|
|
|
if addrErr.LocalPath { |
|
|
|
if addrErr.LocalPath { |
|
|
|
ctx.RenderWithErr(ctx.Tr("repo.migrate.permission_denied"), tplSettingsOptions, form) |
|
|
|
ctx.RenderWithErr(ctx.Tr("repo.migrate.permission_denied"), tplSettingsOptions, form) |
|
|
|