forked from NYANDEV/forgejo
custom avatar upload
This commit is contained in:
parent
3c3f7c2a56
commit
55dfe2c978
20 changed files with 239 additions and 97 deletions
|
@ -5,6 +5,8 @@
|
|||
package auth
|
||||
|
||||
import (
|
||||
"mime/multipart"
|
||||
|
||||
"github.com/Unknwon/macaron"
|
||||
"github.com/macaron-contrib/binding"
|
||||
)
|
||||
|
@ -86,6 +88,14 @@ func (f *UpdateProfileForm) Validate(ctx *macaron.Context, errs binding.Errors)
|
|||
return validate(errs, ctx.Data, f, ctx.Locale)
|
||||
}
|
||||
|
||||
type UploadAvatarForm struct {
|
||||
Avatar *multipart.FileHeader `form:"avatar" binding:"Required"`
|
||||
}
|
||||
|
||||
func (f *UploadAvatarForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
|
||||
return validate(errs, ctx.Data, f, ctx.Locale)
|
||||
}
|
||||
|
||||
type ChangePasswordForm struct {
|
||||
OldPassword string `form:"old_password" binding:"Required;MinSize(6);MaxSize(255)"`
|
||||
Password string `form:"password" binding:"Required;MinSize(6);MaxSize(255)"`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue