summaryrefslogtreecommitdiff
path: root/Assistant/WebApp.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-07-31 17:57:08 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-07-31 17:57:08 -0400
commit4b5ffe8f9b84c20912871b0dfe627d041ce2d99f (patch)
tree95a1950195cc558073bb9e576110019dc156ca10 /Assistant/WebApp.hs
parentbcf5c81593f26a253b514224e3326defd6fa0a8d (diff)
implemented the addrepository form
shiny!
Diffstat (limited to 'Assistant/WebApp.hs')
-rw-r--r--Assistant/WebApp.hs12
1 files changed, 12 insertions, 0 deletions
diff --git a/Assistant/WebApp.hs b/Assistant/WebApp.hs
index 3351aa48f..c2a021246 100644
--- a/Assistant/WebApp.hs
+++ b/Assistant/WebApp.hs
@@ -95,6 +95,11 @@ instance Yesod WebApp where
makeSessionBackend = webAppSessionBackend
jsLoader _ = BottomOfHeadBlocking
+instance RenderMessage WebApp FormMessage where
+ renderMessage _ _ = defaultFormMessage
+
+type Form x = Html -> MForm WebApp WebApp (FormResult x, Widget)
+
data WebAppState = WebAppState
{ showIntro :: Bool
}
@@ -145,3 +150,10 @@ instance PathPiece NotificationId where
instance PathPiece AlertId where
toPathPiece = pack . show
fromPathPiece = readish . unpack
+
+{- Adds the auth parameter as a hidden field on a form. Must be put into
+ - every form. -}
+webAppFormAuthToken :: Widget
+webAppFormAuthToken = do
+ webapp <- lift getYesod
+ [whamlet|<input type="hidden" name="auth" value="#{secretToken webapp}">|]