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
|
|
|
-}
|
|
|
|
|
2013-06-05 01:02:09 +00:00
|
|
|
{-# LANGUAGE QuasiQuotes, TemplateHaskell, OverloadedStrings #-}
|
2012-07-31 06:30:26 +00:00
|
|
|
|
|
|
|
module Assistant.WebApp.Documentation where
|
|
|
|
|
2012-11-25 04:26:46 +00:00
|
|
|
import Assistant.WebApp.Common
|
2012-09-28 23:08:13 +00:00
|
|
|
import Assistant.Install (standaloneAppBase)
|
2012-09-27 22:09:05 +00:00
|
|
|
import Build.SysConfig (packageversion)
|
2013-03-09 18:59:38 +00:00
|
|
|
import BuildFlags
|
2012-07-31 06:30:26 +00:00
|
|
|
|
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
|
2012-09-28 23:08:13 +00:00
|
|
|
base <- standaloneAppBase
|
2012-09-27 20:47:52 +00:00
|
|
|
return $ (</> "LICENSE") <$> base
|
|
|
|
|
2013-06-27 05:15:28 +00:00
|
|
|
getAboutR :: Handler Html
|
2012-11-25 04:26:46 +00:00
|
|
|
getAboutR = page "About git-annex" (Just About) $ do
|
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
|
|
|
|
2013-06-27 05:15:28 +00:00
|
|
|
getLicenseR :: Handler Html
|
2012-09-27 20:47:52 +00:00
|
|
|
getLicenseR = do
|
|
|
|
v <- liftIO licenseFile
|
|
|
|
case v of
|
|
|
|
Nothing -> redirect AboutR
|
2012-11-25 04:26:46 +00:00
|
|
|
Just f -> customPage (Just About) $ do
|
2012-09-28 23:08:13 +00:00
|
|
|
-- no sidebar, just pages of legalese..
|
2012-09-27 20:47:52 +00:00
|
|
|
setTitle "License"
|
|
|
|
license <- liftIO $ readFile f
|
|
|
|
$(widgetFile "documentation/license")
|
2012-12-03 02:33:30 +00:00
|
|
|
|
2013-06-27 05:15:28 +00:00
|
|
|
getRepoGroupR :: Handler Html
|
2012-12-03 02:33:30 +00:00
|
|
|
getRepoGroupR = page "About repository groups" (Just About) $ do
|
|
|
|
$(widgetFile "documentation/repogroup")
|