diff options
author | Lauris BH <lauris@nix.lv> | 2017-12-04 01:14:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-04 01:14:26 +0200 |
commit | 5dc37b187c8b839a15ff73758799f218ddeb3bc9 (patch) | |
tree | b63e5ca72c7b9e72c79408ace82dfcba992b5793 /modules/auth/repo_form.go | |
parent | e59adcde655aac0e8afd3249407c9a0a2b1b1d6b (diff) | |
download | gitea-5dc37b187c8b839a15ff73758799f218ddeb3bc9.tar.gz gitea-5dc37b187c8b839a15ff73758799f218ddeb3bc9.zip |
Add reactions to issues/PR and comments (#2856)
Diffstat (limited to 'modules/auth/repo_form.go')
-rw-r--r-- | modules/auth/repo_form.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/auth/repo_form.go b/modules/auth/repo_form.go index f066fc630f..221f7221a4 100644 --- a/modules/auth/repo_form.go +++ b/modules/auth/repo_form.go @@ -268,6 +268,16 @@ func (f *CreateCommentForm) Validate(ctx *macaron.Context, errs binding.Errors) return validate(errs, ctx.Data, f, ctx.Locale) } +// ReactionForm form for adding and removing reaction +type ReactionForm struct { + Content string `binding:"Required;In(+1,-1,laugh,confused,heart,hooray)"` +} + +// Validate validates the fields +func (f *ReactionForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors { + return validate(errs, ctx.Data, f, ctx.Locale) +} + // _____ .__.__ __ // / \ |__| | ____ _______/ |_ ____ ____ ____ // / \ / \| | | _/ __ \ / ___/\ __\/ _ \ / \_/ __ \ |