2012-07-31 06:30:26 +00:00
|
|
|
{- git-annex assistant webapp documentation
|
|
|
|
-
|
|
|
|
- Copyright 2012 Joey Hess <joey@kitenet.net>
|
|
|
|
-
|
2012-09-24 18:48:47 +00:00
|
|
|
- Licensed under the GNU AGPL version 3 or higher.
|
2012-07-31 06:30:26 +00:00
|
|
|
-}
|
|
|
|
|
|
|
|
{-# LANGUAGE TypeFamilies, QuasiQuotes, MultiParamTypeClasses, TemplateHaskell, OverloadedStrings, RankNTypes #-}
|
|
|
|
|
|
|
|
module Assistant.WebApp.Documentation where
|
|
|
|
|
2012-09-27 20:47:52 +00:00
|
|
|
import Assistant.Common
|
2012-07-31 06:30:26 +00:00
|
|
|
import Assistant.WebApp
|
2012-09-02 04:27:48 +00:00
|
|
|
import Assistant.WebApp.Types
|
2012-07-31 06:30:26 +00:00
|
|
|
import Assistant.WebApp.SideBar
|
2012-09-27 20:47:52 +00:00
|
|
|
import Assistant.Install (standaloneOSXAppBase)
|
2012-07-31 06:30:26 +00:00
|
|
|
import Utility.Yesod
|
|
|
|
|
|
|
|
import Yesod
|
|
|
|
|
2012-09-27 20:47:52 +00:00
|
|
|
{- The full license info may be included in a file on disk that can
|
|
|
|
- be read in and displayed. -}
|
|
|
|
licenseFile :: IO (Maybe FilePath)
|
|
|
|
licenseFile = do
|
|
|
|
base <- standaloneOSXAppBase
|
|
|
|
return $ (</> "LICENSE") <$> base
|
|
|
|
|
2012-07-31 06:30:26 +00:00
|
|
|
getAboutR :: Handler RepHtml
|
|
|
|
getAboutR = bootstrap (Just About) $ do
|
2012-08-04 00:40:34 +00:00
|
|
|
sideBarDisplay
|
2012-07-31 06:30:26 +00:00
|
|
|
setTitle "About git-annex"
|
2012-09-27 20:47:52 +00:00
|
|
|
builtinlicense <- isJust <$> liftIO licenseFile
|
2012-07-31 06:30:26 +00:00
|
|
|
$(widgetFile "documentation/about")
|
2012-09-27 20:47:52 +00:00
|
|
|
|
|
|
|
getLicenseR :: Handler RepHtml
|
|
|
|
getLicenseR = do
|
|
|
|
v <- liftIO licenseFile
|
|
|
|
case v of
|
|
|
|
Nothing -> redirect AboutR
|
|
|
|
Just f -> bootstrap (Just About) $ do
|
|
|
|
sideBarDisplay
|
|
|
|
setTitle "License"
|
|
|
|
license <- liftIO $ readFile f
|
|
|
|
$(widgetFile "documentation/license")
|