webapp: Check annex.version.

This commit is contained in:
Joey Hess 2013-11-17 14:58:35 -04:00
parent 2430302379
commit 9c20185f55
9 changed files with 80 additions and 52 deletions

View file

@ -52,16 +52,19 @@ page title navbaritem content = customPage navbaritem $ do
customPage :: Maybe NavBarItem -> Widget -> Handler Html
customPage navbaritem content = do
webapp <- getYesod
navbar <- map navdetails <$> selectNavBar
pageinfo <- widgetToPageContent $ do
addStylesheet $ StaticR css_bootstrap_css
addStylesheet $ StaticR css_bootstrap_responsive_css
addScript $ StaticR jquery_full_js
addScript $ StaticR js_bootstrap_dropdown_js
addScript $ StaticR js_bootstrap_modal_js
addScript $ StaticR js_bootstrap_collapse_js
$(widgetFile "page")
giveUrlRenderer $(Hamlet.hamletFile $ hamletTemplate "bootstrap")
case cannotRun webapp of
Nothing -> do
navbar <- map navdetails <$> selectNavBar
pageinfo <- widgetToPageContent $ do
addStylesheet $ StaticR css_bootstrap_css
addStylesheet $ StaticR css_bootstrap_responsive_css
addScript $ StaticR jquery_full_js
addScript $ StaticR js_bootstrap_dropdown_js
addScript $ StaticR js_bootstrap_modal_js
addScript $ StaticR js_bootstrap_collapse_js
$(widgetFile "page")
giveUrlRenderer $(Hamlet.hamletFile $ hamletTemplate "bootstrap")
Just msg -> error msg
where
navdetails i = (navBarName i, navBarRoute i, Just i == navbaritem)

View file

@ -44,6 +44,7 @@ data WebApp = WebApp
, relDir :: Maybe FilePath
, getStatic :: Static
, postFirstRun :: Maybe (IO String)
, cannotRun :: Maybe String
, noAnnex :: Bool
, listenHost ::Maybe HostName
}