2012-07-31 06:30:26 +00:00
|
|
|
{- git-annex assistant webapp documentation
|
|
|
|
-
|
2015-01-21 16:50:09 +00:00
|
|
|
- Copyright 2012 Joey Hess <id@joeyh.name>
|
2012-07-31 06:30:26 +00:00
|
|
|
-
|
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)
|
2017-12-14 16:46:57 +00:00
|
|
|
import BuildInfo (packageversion)
|
2017-04-07 22:03:09 +00:00
|
|
|
import BuildInfo
|
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
|
2013-10-02 05:06:59 +00:00
|
|
|
getRepoGroupR = page "About repository groups" (Just About) $
|
2012-12-03 02:33:30 +00:00
|
|
|
$(widgetFile "documentation/repogroup")
|