diff --git a/src/Utils/Modal.hs b/src/Utils/Modal.hs index d62b64607..14ce09965 100644 --- a/src/Utils/Modal.hs +++ b/src/Utils/Modal.hs @@ -7,7 +7,6 @@ module Utils.Modal import ClassyPrelude.Yesod import Control.Lens -import Control.Lens.Extras (is) import Utils.Route import Settings (widgetFile) @@ -22,12 +21,11 @@ data Modal site = Modal customModal :: Modal site -> WidgetT site IO () customModal Modal{..} = do - let isDynamic = is _Left modalContent triggerId' <- maybe newIdent return modalTriggerId $(widgetFile "widgets/modal/modal") - route <- for (modalContent ^? _Left) toTextUrl + route <- traverse toTextUrl $ modalContent ^? _Left modalTrigger route triggerId' -- | Create a link to a modal diff --git a/templates/widgets/modal/modal.hamlet b/templates/widgets/modal/modal.hamlet index c87dd4232..001e4a00f 100644 --- a/templates/widgets/modal/modal.hamlet +++ b/templates/widgets/modal/modal.hamlet @@ -1,5 +1,5 @@ $newline never -
+
$case modalContent $of Right content