From 67f6103f87238b34f0b14bd3482547e87a281bac Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 22 Nov 2018 20:56:49 +0100 Subject: [PATCH] Debug javascript setup --- src/Foundation.hs | 2 +- src/Handler/Utils/Form.hs | 2 +- templates/default-layout-wrapper.hamlet | 6 -- templates/default-layout.hamlet | 14 ++-- templates/standalone/alerts.julius | 7 ++ templates/standalone/datepicker.julius | 7 ++ templates/standalone/inputs.julius | 6 ++ templates/standalone/modal.julius | 89 +++++++++++++++--------- templates/standalone/modal.lucius | 9 ++- templates/standalone/showHide.julius | 6 ++ templates/standalone/tooltip.julius | 1 - templates/widgets/asidenav.julius | 6 ++ templates/widgets/form.julius | 7 +- templates/widgets/navbar.hamlet | 6 +- templates/widgets/pageactionprime.hamlet | 4 +- 15 files changed, 116 insertions(+), 56 deletions(-) diff --git a/src/Foundation.hs b/src/Foundation.hs index 301ca8939..da72da1af 100644 --- a/src/Foundation.hs +++ b/src/Foundation.hs @@ -804,7 +804,7 @@ siteLayout headingOverride widget = do return (c, courseRoute, items') mmsgs <- if - | isModal -> return [] + | isModal -> getMessages | otherwise -> do applySystemMessages authTagPivots <- fromMaybe Set.empty <$> getSessionJson SessionInactiveAuthTags diff --git a/src/Handler/Utils/Form.hs b/src/Handler/Utils/Form.hs index 32a1d28d9..d1c9d3e4b 100644 --- a/src/Handler/Utils/Form.hs +++ b/src/Handler/Utils/Form.hs @@ -593,7 +593,7 @@ formResultModal :: (MonadHandler m, RedirectUrl (HandlerSite m) route) => FormRe formResultModal res finalDest handler = maybeT_ $ do messages <- case res of FormMissing -> mzero - FormFailure errs -> return $ map (Message Error . toHtml) errs + FormFailure errs -> mapM_ (addMessage Error . toHtml) errs >> mzero FormSuccess val -> lift . execWriterT $ handler val isModal <- hasCustomHeader HeaderIsModal diff --git a/templates/default-layout-wrapper.hamlet b/templates/default-layout-wrapper.hamlet index b5b94d5d1..c293b607a 100644 --- a/templates/default-layout-wrapper.hamlet +++ b/templates/default-layout-wrapper.hamlet @@ -17,10 +17,4 @@ $newline never