Commits

Luke Plant  committed f348d19

Updated for changes in ella, and added textarea

  • Participants
  • Parent commits 7b04943

Comments (0)

Files changed (2)

File src/Blog/Forms.hs

+{-# LANGUAGE DisambiguateRecordFields #-}
+
 module Blog.Forms
 
 where
 
-import Ella.Forms.Widgets
+import Ella.Forms.Widgets.TextInput (TextInput(..))
+import Ella.Forms.Widgets.Textarea  (Textarea(..))
 
-nameWidget = TextInput { defaultVal = ""
+nameWidget = TextInput { value = ""
                        , size = Just 20
                        , maxlength = Just 50
                        , name = "name"
-                       , identifier = Just "id_name"
+                       , identifier = "id_name"
                        }
 
-emailWidget = TextInput { defaultVal = ""
+emailWidget = TextInput { value = ""
                         , size = Just 20
                         , maxlength = Just 320
                         , name = "email"
-                        , identifier = Just "id_email"
+                        , identifier = "id_email"
                         }
+
+messageWidget = Textarea { value = ""
+                         , cols = Just 60
+                         , rows = Just 20
+                         , name = "message"
+                         , identifier = "id_message"
+                         }

File src/Blog/Templates.hs

 module Blog.Templates
 where
 
-import Blog.Forms (emailWidget, nameWidget)
+import Blog.Forms (emailWidget, nameWidget, messageWidget)
 import Blog.Links
 import Ella.Forms.Widgets (makeLabel)
 import Data.List (intersperse)
             td << emailWidget
            ))))
         +++
-        (textarea ! [rows "10", cols "50"] << "")
+        messageWidget
         +++
         br
         +++