Worked on reset password views, refactored out password strength to a reusable directive

This commit is contained in:
Torkel Ödegaard
2015-06-08 10:57:01 +02:00
parent e40b462040
commit aa4d60c21e
18 changed files with 259 additions and 112 deletions
+1 -9
View File
@@ -5,7 +5,6 @@ type SendEmailCommand struct {
From string
Subject string
Body string
Type string
Massive bool
Info string
}
@@ -16,13 +15,7 @@ type SendResetPasswordEmailCommand struct {
// create mail content
func (m *SendEmailCommand) Content() string {
// set mail type
contentType := "text/plain; charset=UTF-8"
if m.Type == "html" {
contentType = "text/html; charset=UTF-8"
}
// create mail content
contentType := "text/html; charset=UTF-8"
content := "From: " + m.From + "\r\nSubject: " + m.Subject + "\r\nContent-Type: " + contentType + "\r\n\r\n" + m.Body
return content
}
@@ -34,6 +27,5 @@ func NewSendEmailCommand(To []string, From, Subject, Body string) SendEmailComma
From: From,
Subject: Subject,
Body: Body,
Type: "html",
}
}
+10
View File
@@ -30,6 +30,16 @@ type User struct {
Updated time.Time
}
func (u *User) NameOrFallback() string {
if u.Name != "" {
return u.Name
} else if u.Login != "" {
return u.Login
} else {
return u.Email
}
}
// ---------------------
// COMMANDS