newSupplierForm :: AForm Handler Supplier
newSupplierForm = Supplier
  <$> areq textField (bfs MsgName) Nothing
  <*> areq textareaField (bfs MsgAddress) Nothing
  <*> areq textField (bfs MsgTelNr) Nothing
  <*> areq emailField (bfs MsgEmail) Nothing
  <*> areq textField (bfs MsgCustomerId) Nothing
  <*> aopt (selectField avatars) (bfs MsgSelectAvatar) Nothing
  <*  bootstrapSubmit (msgToBSSubmit MsgSubmit)
  where
    avatars = do
      ents <- runDB $ selectList [] [Asc AvatarIdent]
      optionsPairs $ map (\ent -> ((avatarIdent $ entityVal ent), entityKey ent)) ents
newSupplierForm :: AForm Handler Supplier
newSupplierForm = Supplier
  <$> areq textField (bfs MsgName) Nothing
  <*> areq textareaField (bfs MsgAddress) Nothing
  <*> areq textField (bfs MsgTelNr) Nothing
  <*> areq emailField (bfs MsgEmail) Nothing
  <*> areq textField (bfs MsgCustomerId) Nothing
  <*> aopt (selectField avatars) (bfs MsgSelectAvatar) Nothing
  <*  bootstrapSubmit (msgToBSSubmit MsgSubmit)
  where
    avatars = do
      ents <- runDB $ selectList [] [Asc AvatarIdent]
      optionsPairs $ map (\ent -> ((avatarIdent $ entityVal ent), entityKey ent)) ents
newSupplierForm = Supplier
  <$> areq textField (bfs MsgName) Nothing
  <*> areq textareaField (bfs MsgAddress) Nothing
  <*> areq textField (bfs MsgTelNr) Nothing
  <*> areq emailField (bfs MsgEmail) Nothing
  <*> areq textField (bfs MsgCustomerId) Nothing
  <*> aopt (selectField avatars) (bfs MsgSelectAvatar) Nothing
  <*  bootstrapSubmit (msgToBSSubmit MsgSubmit)
  where
    avatars = do
      ents <- runDB $ selectList [] [Asc AvatarIdent]
      optionsPairs $ map (\ent -> ((avatarIdent $ entityVal ent), entityKey ent)) ents