webapp: Check annex.version.
This commit is contained in:
parent
2430302379
commit
9c20185f55
9 changed files with 80 additions and 52 deletions
|
@ -52,11 +52,12 @@ webAppThread
|
|||
:: AssistantData
|
||||
-> UrlRenderer
|
||||
-> Bool
|
||||
-> Maybe String
|
||||
-> Maybe HostName
|
||||
-> Maybe (IO Url)
|
||||
-> Maybe (Url -> FilePath -> IO ())
|
||||
-> NamedThread
|
||||
webAppThread assistantdata urlrenderer noannex listenhost postfirstrun onstartup = thread $ liftIO $ do
|
||||
webAppThread assistantdata urlrenderer noannex cannotrun listenhost postfirstrun onstartup = thread $ liftIO $ do
|
||||
#ifdef __ANDROID__
|
||||
when (isJust listenhost) $
|
||||
-- See Utility.WebApp
|
||||
|
@ -68,6 +69,7 @@ webAppThread assistantdata urlrenderer noannex listenhost postfirstrun onstartup
|
|||
<*> getreldir
|
||||
<*> pure staticRoutes
|
||||
<*> pure postfirstrun
|
||||
<*> pure cannotrun
|
||||
<*> pure noannex
|
||||
<*> pure listenhost
|
||||
setUrlRenderer urlrenderer $ yesodRender webapp (pack "")
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -44,6 +44,7 @@ data WebApp = WebApp
|
|||
, relDir :: Maybe FilePath
|
||||
, getStatic :: Static
|
||||
, postFirstRun :: Maybe (IO String)
|
||||
, cannotRun :: Maybe String
|
||||
, noAnnex :: Bool
|
||||
, listenHost ::Maybe HostName
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue