summaryrefslogtreecommitdiff
path: root/Assistant/WebApp.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-08-08 17:07:38 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-08-08 17:07:38 -0400
commit09449792fa50686e2fb9af6c392b8644dddae5d6 (patch)
tree52c706411d5f4d8ec4e28081dacabf83353059bb /Assistant/WebApp.hs
parent94fcd0cf59f94dd29ab171f0875bd25af65fd527 (diff)
factor out onclick javascript
Diffstat (limited to 'Assistant/WebApp.hs')
-rw-r--r--Assistant/WebApp.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/Assistant/WebApp.hs b/Assistant/WebApp.hs
index 5bb2339b3..4418a4d98 100644
--- a/Assistant/WebApp.hs
+++ b/Assistant/WebApp.hs
@@ -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")