diff --git a/Handler/Profile.hs b/Handler/Profile.hs index fe8ece0..4c104ed 100644 --- a/Handler/Profile.hs +++ b/Handler/Profile.hs @@ -79,8 +79,11 @@ userForm maxY u = renderTable $ User <*> aopt doubleField "Latitude" { fsId = Just "latitude" } (Just $ userLatitude u) + <*> aopt (checkBool validGooglePlus ("Not a Google+ link" :: T.Text) urlField) + "Google+ Profile Link" (Just $ userGooglePlus u) where empOpts = map (pack . prettyEmployment &&& id) [minBound..maxBound] + validGooglePlus t = "https://plus.google.com/" `T.isPrefixOf` t getProfileR :: Handler RepHtml getProfileR = do diff --git a/Haskellers.hs b/Haskellers.hs index 8736874..8a3497d 100644 --- a/Haskellers.hs +++ b/Haskellers.hs @@ -422,6 +422,7 @@ instance YesodAuth Haskellers where , userLocation = Nothing , userLongitude = Nothing , userLatitude = Nothing + , userGooglePlus = Nothing } addBIDEmail uid _ <- insert $ Ident (credsIdent creds) uid diff --git a/entities b/entities index 05d5d63..2c8ad18 100644 --- a/entities +++ b/entities @@ -16,6 +16,7 @@ User location Text Maybe longitude Double Maybe Ne latitude Double Maybe Ne + googlePlus Text Maybe Username user UserId username Text diff --git a/hamlet/user.hamlet b/hamlet/user.hamlet index b7069f2..818cfc4 100644 --- a/hamlet/user.hamlet +++ b/hamlet/user.hamlet @@ -27,6 +27,9 @@ $if viewerIsAdmin $maybe w <- userWebsite u
#{w} + $maybe gp <- userGooglePlus u +
+ Google+ Profile $maybe e <- userEmployment u
#{e} $maybe l <- userLocation u