From 122f7f85a63c47d7a74c9f13ae4244d362f99ca8 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Mon, 9 May 2011 18:59:36 +0300 Subject: [PATCH] Clean build --- Yesod/Form.hs | 318 +------------------------------------------ Yesod/Form/Core.hs | 298 ---------------------------------------- Yesod/Form/Jquery.hs | 47 +++---- Yesod/Form/Nic.hs | 17 +-- yesod-form.cabal | 7 +- 5 files changed, 33 insertions(+), 654 deletions(-) delete mode 100644 Yesod/Form/Core.hs diff --git a/Yesod/Form.hs b/Yesod/Form.hs index e3afde84..0eab5bcb 100644 --- a/Yesod/Form.hs +++ b/Yesod/Form.hs @@ -7,319 +7,13 @@ {-# LANGUAGE OverloadedStrings #-} -- | Parse forms (and query strings). module Yesod.Form - ( -- * Data types - GForm - , FormResult (..) - , Enctype (..) - , FormFieldSettings (..) - , Textarea (..) - , FieldInfo (..) - -- ** Utilities - , formFailures - {- - -- * Type synonyms - , Form - , Formlet - , FormField - , FormletField - , FormInput - -} - -- * Unwrapping functions - , generateForm - , runFormGet - --, runFormMonadGet - , runFormPost - , runFormPostNoNonce - {- - , runFormMonadPost - , runFormGet' - , runFormPost' - -} - -- ** High-level form post unwrappers - {- - , runFormTable - , runFormDivs - -} - -- * Field/form helpers - , fieldsToTable - , fieldsToDivs - , fieldsToPlain - {- - , checkForm - -} - -- * Type classes - , module Yesod.Form.Class - -- * Template Haskell - --, mkToForm + ( module Yesod.Form.Types + , module Yesod.Form.Functions , module Yesod.Form.Fields + -- FIXME , module Yesod.Form.Class ) where -import Yesod.Form.Core +import Yesod.Form.Types +import Yesod.Form.Functions import Yesod.Form.Fields -import Yesod.Form.Class -import Yesod.Form.Profiles (Textarea (..)) -import Yesod.Widget (GWidget, GGWidget) - -import Text.Hamlet -import Yesod.Request -import Yesod.Handler -import Control.Applicative hiding (optional) -import Data.Maybe (fromMaybe, mapMaybe) -import Control.Monad ((<=<), liftM) -import Language.Haskell.TH.Syntax hiding (lift) -import Database.Persist.Base (EntityDef (..), PersistEntity (entityDef)) -import Data.Char (toUpper, isUpper) -import Control.Arrow ((&&&)) -import Data.List (group, sort) -import Data.Monoid (mempty) -import Data.Text (Text) -import Control.Monad.Trans.RWS (runRWST) - -#if __GLASGOW_HASKELL__ >= 700 -#define HAMLET hamlet -#else -#define HAMLET $hamlet -#endif --- | Display only the actual input widget code, without any decoration. -fieldsToPlain :: (Monad mo, Monad mo') => GForm [FieldInfo (GGWidget master mo' ())] mo a -> GForm (GGWidget master mo' ()) mo a -fieldsToPlain = mapFormXml $ mapM_ fiInput - --- | Display the label, tooltip, input code and errors in a single row of a --- table. -fieldsToTable :: (Monad mo, Monad mo') => GForm [FieldInfo (GGWidget master mo' ())] mo a -> GForm (GGWidget master mo' ()) mo a -fieldsToTable = mapFormXml $ mapM_ go - where - go fi = [HAMLET| - - -