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")