From e1dcd1105168e9a66f5bfcdb3e169580ad21a2e3 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Mon, 13 Mar 2017 06:00:37 -0400 Subject: [PATCH] repo/settings: improve Git hook editor --- routers/repo/setting.go | 3 ++- templates/repo/settings/githook_edit.tmpl | 12 ++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/routers/repo/setting.go b/routers/repo/setting.go index 015c42c16..6ccd058a3 100644 --- a/routers/repo/setting.go +++ b/routers/repo/setting.go @@ -499,6 +499,7 @@ func SettingsGitHooks(ctx *context.Context) { func SettingsGitHooksEdit(ctx *context.Context) { ctx.Data["Title"] = ctx.Tr("repo.settings.githooks") ctx.Data["PageIsSettingsGitHooks"] = true + ctx.Data["RequireSimpleMDE"] = true name := ctx.Params(":name") hook, err := ctx.Repo.GitRepo.GetHook(name) @@ -530,7 +531,7 @@ func SettingsGitHooksEditPost(ctx *context.Context) { ctx.Handle(500, "hook.Update", err) return } - ctx.Redirect(ctx.Repo.RepoLink + "/settings/hooks/git") + ctx.Redirect(ctx.Data["Link"].(string)) } func SettingsDeployKeys(ctx *context.Context) { diff --git a/templates/repo/settings/githook_edit.tmpl b/templates/repo/settings/githook_edit.tmpl index d139fd3f3..807c590dc 100644 --- a/templates/repo/settings/githook_edit.tmpl +++ b/templates/repo/settings/githook_edit.tmpl @@ -16,11 +16,11 @@ {{with .Hook}}
- {{.Name}} + {{.Name}}
- +
@@ -33,4 +33,12 @@
+ + + {{template "base/footer" .}}