modalPrompt :: String -> (String -> Action) -> Action -> State -> Widget Action
modalPrompt id' inputAction buttonAction _ = inputWidget <|> closeButtonWidget
  where
    inputWidget = Ulmus.newWidget (id' ++ " .input-container") $ do
      _ <- getString Nothing
            `fire` OnKeyUp
      projPath <- liftIO $ getValueFromId ("#" ++ id' ++ " event input")
      return (inputAction projPath)

    closeButtonWidget = Ulmus.newWidget (id' ++ "closeButton") $ wlink buttonAction $
      a ! atr "class" "modal-action modal-close waves-effect btn-flat waves-purple" $
          i ! atr "class" "material-icons" $ ("input" :: String)
modalPrompt :: String -> (String -> Action) -> Action -> State -> Widget Action
modalPrompt id' inputAction buttonAction _ = inputWidget <|> closeButtonWidget
  where
    inputWidget = Ulmus.newWidget (id' ++ " .input-container") $ do
      _ <- getString Nothing
            `fire` OnKeyUp
      projPath <- liftIO $ getValueFromId ("#" ++ id' ++ " event input")
      return (inputAction projPath)

    closeButtonWidget = Ulmus.newWidget (id' ++ "closeButton") $ wlink buttonAction $
      a ! atr "class" "modal-action modal-close waves-effect btn-flat waves-purple" $
          i ! atr "class" "material-icons" $ ("input" :: String)
modalPrompt id' inputAction buttonAction _ = inputWidget <|> closeButtonWidget
  where
    inputWidget = Ulmus.newWidget (id' ++ " .input-container") $ do
      _ <- getString Nothing
            `fire` OnKeyUp
      projPath <- liftIO $ getValueFromId ("#" ++ id' ++ " event input")
      return (inputAction projPath)

    closeButtonWidget = Ulmus.newWidget (id' ++ "closeButton") $ wlink buttonAction $
      a ! atr "class" "modal-action modal-close waves-effect btn-flat waves-purple" $
          i ! atr "class" "material-icons" $ ("input" :: String)