yesod-mangopay 1.4 → 1.5
raw patch · 3 files changed
+18/−8 lines, 3 filesdep +country-codesdep ~mangopay
Dependencies added: country-codes
Dependency ranges changed: mangopay
Files
- app/Base/Util.hs +9/−0
- app/Handler/User.hs +4/−4
- yesod-mangopay.cabal +5/−4
app/Base/Util.hs view
@@ -6,6 +6,7 @@ import Prelude import Foundation +import Data.CountryCodes (CountryCode,countryList) import Data.Text hiding (map) import Control.Arrow ((&&&)) import Data.Maybe (fromMaybe)@@ -14,6 +15,9 @@ import Web.MangoPay +++ -- | localized field localizedFS :: forall master msg. RenderMessage master msg =>@@ -65,4 +69,9 @@ else Nothing in (previous,next) getPaginationNav _ _= (Nothing,Nothing) + +-- | country field+countryField :: RenderMessage site FormMessage =>+ Field (HandlerT site IO) CountryCode+countryField = selectFieldList countryList
app/Handler/User.hs view
@@ -114,8 +114,8 @@ { jdsChangeYear = True -- give a year dropdown , jdsYearRange = "1900:-5" -- 1900 till five years ago }) (localizedFS MsgUserBirthday) (posix2Day <$> uBirthday <$> muser))- <*> areq textField (localizedFS MsgUserNationality) (uNationality <$> muser)- <*> areq textField (localizedFS MsgUserCountry) (uCountryOfResidence <$> muser)+ <*> areq countryField (localizedFS MsgUserNationality) (uNationality <$> muser)+ <*> areq countryField (localizedFS MsgUserCountry) (uCountryOfResidence <$> muser) <*> aopt textField (localizedFS MsgUserOccupation) (uOccupation <$> muser) <*> aopt (selectFieldList ranges) (localizedFS MsgUserIncome) (uIncomeRange <$> muser) <*> aopt textField (localizedFS MsgUserCustomData) (uTag <$> muser)@@ -140,8 +140,8 @@ { jdsChangeYear = True -- give a year dropdown , jdsYearRange = "1900:-5" -- 1900 till five years ago }) (localizedFS MsgUserRepBirthday) (posix2Day <$> lLegalRepresentativeBirthday <$> muser)) - <*> areq textField (localizedFS MsgUserRepNationality) (lLegalRepresentativeNationality <$> muser) - <*> areq textField (localizedFS MsgUserRepCountry) (lLegalRepresentativeCountryOfResidence <$> muser)+ <*> areq countryField (localizedFS MsgUserRepNationality) (lLegalRepresentativeNationality <$> muser) + <*> areq countryField (localizedFS MsgUserRepCountry) (lLegalRepresentativeCountryOfResidence <$> muser) <*> pure Nothing -- value comes from Documents uploaded (I think) <*> aopt textField (localizedFS MsgUserCustomData) (lTag <$> muser) <*> pure Nothing -- value comes from Documents uploaded
yesod-mangopay.cabal view
@@ -1,5 +1,5 @@ name: yesod-mangopay-version: 1.4+version: 1.5 cabal-version: >= 1.8 build-type: Simple author: JP Moresmau <jpmoresmau@gmail.com>@@ -37,7 +37,7 @@ hs-source-dirs: src build-depends: base >= 4 && < 5- , mangopay == 1.4.*+ , mangopay == 1.5.* , containers >= 0.5 && < 0.6 , http-conduit >= 2.0 && < 2.2 , http-types >= 0.8.2 && < 0.9@@ -120,8 +120,9 @@ , yesod-auth >= 1.2.6 , yesod-form >= 1.3.0 && < 1.4 , yesod-persistent- , yesod-static >= 1.2 && < 1.3,- lifted-base >=0.2.2 && <0.3+ , yesod-static >= 1.2 && < 1.3+ , lifted-base >=0.2.2 && <0.3+ , country-codes == 0.1.* if flag(conduit11) build-depends: conduit == 1.1.*