From 5332e22c134ee8bcf71c320988cfb0aa8f4ea4b0 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 14 Oct 2018 17:24:19 +0200 Subject: [PATCH] img_modal_svg --- src/Foundation.hs | 1 - src/Handler/Utils/Templates.hs | 15 +++++++-------- static/img/modal.svg | 7 +++++++ 3 files changed, 14 insertions(+), 9 deletions(-) create mode 100644 static/img/modal.svg diff --git a/src/Foundation.hs b/src/Foundation.hs index 105c859ab..558e13e8e 100644 --- a/src/Foundation.hs +++ b/src/Foundation.hs @@ -75,7 +75,6 @@ import qualified Control.Monad.Catch as C import System.FilePath -import Handler.Utils.Templates import Handler.Utils.StudyFeatures import Control.Lens import Utils diff --git a/src/Handler/Utils/Templates.hs b/src/Handler/Utils/Templates.hs index bb89397b1..d23e6b31e 100644 --- a/src/Handler/Utils/Templates.hs +++ b/src/Handler/Utils/Templates.hs @@ -4,12 +4,9 @@ module Handler.Utils.Templates where import Data.Either (isLeft) -import Import.NoFoundation +import Import -lipsum :: WidgetT site IO () -lipsum = $(widgetFile "widgets/lipsum") - -modal :: WidgetT site IO () -> Either (Route site) (WidgetT site IO ()) -> WidgetT site IO () +modal :: WidgetT UniWorX IO () -> Either (Route UniWorX) (WidgetT UniWorX IO ()) -> WidgetT UniWorX IO () modal modalTrigger modalContent = do let modalDynamic = isLeft modalContent modalId <- newIdent @@ -18,14 +15,16 @@ modal modalTrigger modalContent = do case modalContent of -- TODO: refactor this. preferably put svg in separte file somewhere in static? Left route -> [whamlet| + $newline never
- + ^{modalTrigger} |] - Right content -> [whamlet| + Right _ -> [whamlet| + $newline never
- + ^{modalTrigger} |] diff --git a/static/img/modal.svg b/static/img/modal.svg new file mode 100644 index 000000000..a4a08bb48 --- /dev/null +++ b/static/img/modal.svg @@ -0,0 +1,7 @@ + + + + + + +