factor out onclick javascript

This commit is contained in:
Joey Hess 2012-08-08 17:07:38 -04:00
parent 94fcd0cf59
commit 09449792fa
6 changed files with 16 additions and 11 deletions

View file

@ -165,3 +165,11 @@ webAppFormAuthToken :: Widget
webAppFormAuthToken = do
webapp <- lift getYesod
[whamlet|<input type="hidden" name="auth" value="#{secretToken webapp}">|]
{- A button with an icon, and maybe label, that can be clicked to perform
- some action.
- With javascript, clicking it POSTs the Route, and remains on the same
- page.
- With noscript, clicking it GETs the Route. -}
actionButton :: Route WebApp -> (Maybe String) -> String -> String -> Widget
actionButton route label buttonclass iconclass = $(widgetFile "actionbutton")

View file

@ -53,7 +53,6 @@ sideBarDisplay = do
addalert :: AlertId -> Bool -> Bool -> Text -> Maybe Text -> Text -> Maybe String -> Widget
addalert i closable block divclass heading message icon = do
let alertid = show i
let closealert = CloseAlert i
$(widgetFile "sidebar/alert")
{- Called by client to get a sidebar display.