1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-08-03 00:45:22 +02:00

Add reactions to issues/PR and comments (#2856)

This commit is contained in:
Lauris BH 2017-12-04 01:14:26 +02:00 committed by GitHub
parent e59adcde65
commit 5dc37b187c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 677 additions and 8 deletions

View file

@ -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)
}
// _____ .__.__ __
// / \ |__| | ____ _______/ |_ ____ ____ ____
// / \ / \| | | _/ __ \ / ___/\ __\/ _ \ / \_/ __ \