From f509c59ac13dffdff6a246572de04150ee295314 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Fri, 28 Aug 2015 23:36:13 +0800 Subject: new create webhook event --- modules/auth/repo_form.go | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'modules/auth/repo_form.go') diff --git a/modules/auth/repo_form.go b/modules/auth/repo_form.go index 748bfa6111..cf713c0cbd 100644 --- a/modules/auth/repo_form.go +++ b/modules/auth/repo_form.go @@ -67,8 +67,22 @@ func (f *RepoSettingForm) Validate(ctx *macaron.Context, errs binding.Errors) bi // \/ \/ \/ \/ \/ \/ type WebhookForm struct { - PushOnly bool - Active bool + Events string + Create bool + Push bool + Active bool +} + +func (f WebhookForm) PushOnly() bool { + return f.Events == "push_only" +} + +func (f WebhookForm) SendEverything() bool { + return f.Events == "send_everything" +} + +func (f WebhookForm) ChooseEvents() bool { + return f.Events == "choose_events" } type NewWebhookForm struct { -- cgit v1.2.3