From af43221d2b4a01bad2a9e2b999e09c23c834572f Mon Sep 17 00:00:00 2001 From: Mitchell Rosen Date: Fri, 5 Sep 2014 12:54:04 -0700 Subject: [PATCH] remove duplicate preview warning/buttons, added 'post' action alongside 'preview' --- View/Comment.hs | 29 ++++++++++++++++------------- Widgets/Preview.hs | 7 ------- 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/View/Comment.hs b/View/Comment.hs index 3bc438d3..4aa96966 100644 --- a/View/Comment.hs +++ b/View/Comment.hs @@ -68,29 +68,31 @@ commentForm label content = renderBootstrap3 $ NewComment -- toVisibility True = VisPrivate -- toVisibility _ = VisPublic -commentFormWidget :: SomeMessage App -> Maybe Markdown -> Widget -commentFormWidget label = commentFormWidget' . commentForm label +commentFormWidget :: Text -> SomeMessage App -> Maybe Markdown -> Widget +commentFormWidget post_text label content = commentFormWidget' post_text (commentForm label content) -- intentional duplication of commentFormWidget' because some aspects -- of closing and other markdown aren't identical (such as marking privacy) -closureFormWidget' :: Form NewClosure -> Widget -closureFormWidget' form = do +closureFormWidget' :: Text -> Form NewClosure -> Widget +closureFormWidget' post_text form = do (widget, enctype) <- handlerToWidget $ generateFormPost form [whamlet|
^{widget}