Merged conflicts.
This commit is contained in:
commit
964d0262ff
952 changed files with 1344 additions and 1161 deletions
|
@ -17,8 +17,7 @@ import (
|
|||
// \/ /_____/ \/ \/ \/ \/ \/
|
||||
|
||||
type CreateOrgForm struct {
|
||||
OrgName string `form:"org_name" binding:"Required;AlphaDashDot;MaxSize(30)"`
|
||||
Email string `form:"email" binding:"Required;Email;MaxSize(50)"`
|
||||
OrgName string `binding:"Required;AlphaDashDot;MaxSize(30)" locale:"org.org_name_holder"`
|
||||
}
|
||||
|
||||
func (f *CreateOrgForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
|
||||
|
@ -26,13 +25,11 @@ func (f *CreateOrgForm) Validate(ctx *macaron.Context, errs binding.Errors) bind
|
|||
}
|
||||
|
||||
type UpdateOrgSettingForm struct {
|
||||
OrgUserName string `form:"uname" binding:"Required;AlphaDashDot;MaxSize(30)" locale:"org.org_name_holder"`
|
||||
OrgFullName string `form:"fullname" binding:"MaxSize(100)"`
|
||||
Email string `form:"email" binding:"Required;Email;MaxSize(50)"`
|
||||
Description string `form:"desc" binding:"MaxSize(255)"`
|
||||
Website string `form:"website" binding:"Url;MaxSize(100)"`
|
||||
Location string `form:"location" binding:"MaxSize(50)"`
|
||||
Avatar string `form:"avatar" binding:"Required;Email;MaxSize(50)"`
|
||||
Name string `binding:"Required;AlphaDashDot;MaxSize(30)" locale:"org.org_name_holder"`
|
||||
FullName string `binding:"MaxSize(100)"`
|
||||
Description string `binding:"MaxSize(255)"`
|
||||
Website string `binding:"Url;MaxSize(100)"`
|
||||
Location string `binding:"MaxSize(50)"`
|
||||
}
|
||||
|
||||
func (f *UpdateOrgSettingForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
|
||||
|
|
|
@ -88,12 +88,12 @@ func (f *SignInForm) Validate(ctx *macaron.Context, errs binding.Errors) binding
|
|||
// \/ \/ \/ \/ \/
|
||||
|
||||
type UpdateProfileForm struct {
|
||||
UserName string `form:"uname" binding:"Required;MaxSize(35)"`
|
||||
FullName string `form:"fullname" binding:"MaxSize(100)"`
|
||||
Email string `form:"email" binding:"Required;Email;MaxSize(254)"`
|
||||
Website string `form:"website" binding:"Url;MaxSize(100)"`
|
||||
Location string `form:"location" binding:"MaxSize(50)"`
|
||||
Avatar string `form:"avatar" binding:"Required;Email;MaxSize(254)"`
|
||||
Name string `binding:"Required;MaxSize(35)"`
|
||||
FullName string `binding:"MaxSize(100)"`
|
||||
Email string `binding:"Required;Email;MaxSize(254)"`
|
||||
Website string `binding:"Url;MaxSize(100)"`
|
||||
Location string `binding:"MaxSize(50)"`
|
||||
Gravatar string `binding:"Required;Email;MaxSize(254)"`
|
||||
}
|
||||
|
||||
func (f *UpdateProfileForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
|
||||
|
@ -101,8 +101,8 @@ func (f *UpdateProfileForm) Validate(ctx *macaron.Context, errs binding.Errors)
|
|||
}
|
||||
|
||||
type UploadAvatarForm struct {
|
||||
Enable bool `form:"enable"`
|
||||
Avatar *multipart.FileHeader `form:"avatar"`
|
||||
Enable bool
|
||||
Avatar *multipart.FileHeader
|
||||
}
|
||||
|
||||
func (f *UploadAvatarForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
|
||||
|
|
|
@ -76,9 +76,8 @@ func ToUtf8WithErr(content []byte) (error, string) {
|
|||
}
|
||||
|
||||
encoding, _ := charset.Lookup(charsetLabel)
|
||||
|
||||
if encoding == nil {
|
||||
return fmt.Errorf("unknow char decoder %s", charsetLabel), string(content)
|
||||
return fmt.Errorf("unknown char decoder %s", charsetLabel), string(content)
|
||||
}
|
||||
|
||||
result, n, err := transform.String(encoding.NewDecoder(), string(content))
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -48,6 +48,7 @@ type Message struct {
|
|||
To []string
|
||||
From string
|
||||
Subject string
|
||||
ReplyTo string
|
||||
Body string
|
||||
Type string
|
||||
Massive bool
|
||||
|
@ -63,7 +64,7 @@ func (m Message) Content() string {
|
|||
}
|
||||
|
||||
// create mail content
|
||||
content := "From: " + m.From + "\r\nSubject: " + m.Subject + "\r\nContent-Type: " + contentType + "\r\n\r\n" + m.Body
|
||||
content := "From: " + m.From + "\r\nReply-To: " + m.ReplyTo + "\r\nSubject: " + m.Subject + "\r\nContent-Type: " + contentType + "\r\n\r\n" + m.Body
|
||||
return content
|
||||
}
|
||||
|
||||
|
@ -252,7 +253,8 @@ func SendAsync(msg *Message) {
|
|||
func NewHtmlMessage(To []string, From, Subject, Body string) Message {
|
||||
return Message{
|
||||
To: To,
|
||||
From: From,
|
||||
From: setting.MailService.From,
|
||||
ReplyTo: From,
|
||||
Subject: Subject,
|
||||
Body: Body,
|
||||
Type: "html",
|
||||
|
|
|
@ -201,6 +201,11 @@ func ExecPath() (string, error) {
|
|||
|
||||
// WorkDir returns absolute path of work directory.
|
||||
func WorkDir() (string, error) {
|
||||
wd := os.Getenv("GOGS_WORK_DIR")
|
||||
if len(wd) > 0 {
|
||||
return wd, nil
|
||||
}
|
||||
|
||||
execPath, err := ExecPath()
|
||||
if err != nil {
|
||||
return execPath, err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue