From 4b5ffe8f9b84c20912871b0dfe627d041ce2d99f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 31 Jul 2012 17:57:08 -0400 Subject: implemented the addrepository form shiny! --- Assistant/WebApp.hs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'Assistant/WebApp.hs') 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||] -- cgit v1.2.3