modifySupplierForm :: Supplier -> AForm Handler SupConf
modifySupplierForm sup = SupConf
  <$> areq textField (bfs MsgName) (Just $ supplierIdent sup)
  <*> areq textareaField (bfs MsgAddress) (Just $ supplierAddress sup)
  <*> areq textField (bfs MsgTelNr) (Just $ supplierTel sup)
  <*> areq textField (bfs MsgEmail) (Just $ supplierEmail sup)
  <*> areq textField (bfs MsgCustomerId) (Just $ supplierCustomerId sup)
  <*> aopt (selectField avatars) (bfs MsgSelectAvatar) (Just $ supplierAvatar sup)
  <*  bootstrapSubmit (msgToBSSubmit MsgSubmit)
  where
    avatars = do
      ents <- runDB $ selectList [] [Asc AvatarIdent]
      optionsPairs $ map (\ent -> ((avatarIdent $ entityVal ent), entityKey ent)) ents
modifySupplierForm :: Supplier -> AForm Handler SupConf
modifySupplierForm sup = SupConf
  <$> areq textField (bfs MsgName) (Just $ supplierIdent sup)
  <*> areq textareaField (bfs MsgAddress) (Just $ supplierAddress sup)
  <*> areq textField (bfs MsgTelNr) (Just $ supplierTel sup)
  <*> areq textField (bfs MsgEmail) (Just $ supplierEmail sup)
  <*> areq textField (bfs MsgCustomerId) (Just $ supplierCustomerId sup)
  <*> aopt (selectField avatars) (bfs MsgSelectAvatar) (Just $ supplierAvatar sup)
  <*  bootstrapSubmit (msgToBSSubmit MsgSubmit)
  where
    avatars = do
      ents <- runDB $ selectList [] [Asc AvatarIdent]
      optionsPairs $ map (\ent -> ((avatarIdent $ entityVal ent), entityKey ent)) ents
modifySupplierForm sup = SupConf
  <$> areq textField (bfs MsgName) (Just $ supplierIdent sup)
  <*> areq textareaField (bfs MsgAddress) (Just $ supplierAddress sup)
  <*> areq textField (bfs MsgTelNr) (Just $ supplierTel sup)
  <*> areq textField (bfs MsgEmail) (Just $ supplierEmail sup)
  <*> areq textField (bfs MsgCustomerId) (Just $ supplierCustomerId sup)
  <*> aopt (selectField avatars) (bfs MsgSelectAvatar) (Just $ supplierAvatar sup)
  <*  bootstrapSubmit (msgToBSSubmit MsgSubmit)
  where
    avatars = do
      ents <- runDB $ selectList [] [Asc AvatarIdent]
      optionsPairs $ map (\ent -> ((avatarIdent $ entityVal ent), entityKey ent)) ents