2012-07-31 02:30:26 -04:00
|
|
|
{- git-annex assistant webapp documentation
|
|
|
|
-
|
2015-01-21 12:50:09 -04:00
|
|
|
- Copyright 2012 Joey Hess <id@joeyh.name>
|
2012-07-31 02:30:26 -04:00
|
|
|
-
|
2012-09-24 14:48:47 -04:00
|
|
|
- Licensed under the GNU AGPL version 3 or higher.
|
2012-07-31 02:30:26 -04:00
|
|
|
-}
|
|
|
|
|
2013-06-04 21:02:09 -04:00
|
|
|
{-# LANGUAGE QuasiQuotes, TemplateHaskell, OverloadedStrings #-}
|
2012-07-31 02:30:26 -04:00
|
|
|
|
|
|
|
module Assistant.WebApp.Documentation where
|
|
|
|
|
2012-11-25 00:26:46 -04:00
|
|
|
import Assistant.WebApp.Common
|
2012-09-28 19:08:13 -04:00
|
|
|
import Assistant.Install (standaloneAppBase)
|
2017-12-14 12:46:57 -04:00
|
|
|
import BuildInfo (packageversion)
|
2018-01-02 13:47:51 -04:00
|
|
|
import BuildFlags
|
2012-07-31 02:30:26 -04:00
|
|
|
|
2012-09-27 16:47:52 -04: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 19:08:13 -04:00
|
|
|
base <- standaloneAppBase
|
2012-09-27 16:47:52 -04:00
|
|
|
return $ (</> "LICENSE") <$> base
|
|
|
|
|
2013-06-27 01:15:28 -04:00
|
|
|
getAboutR :: Handler Html
|
2012-11-25 00:26:46 -04:00
|
|
|
getAboutR = page "About git-annex" (Just About) $ do
|
2012-09-27 16:47:52 -04:00
|
|
|
builtinlicense <- isJust <$> liftIO licenseFile
|
2012-07-31 02:30:26 -04:00
|
|
|
$(widgetFile "documentation/about")
|
2012-09-27 16:47:52 -04:00
|
|
|
|
2013-06-27 01:15:28 -04:00
|
|
|
getLicenseR :: Handler Html
|
2012-09-27 16:47:52 -04:00
|
|
|
getLicenseR = do
|
|
|
|
v <- liftIO licenseFile
|
|
|
|
case v of
|
|
|
|
Nothing -> redirect AboutR
|
2012-11-25 00:26:46 -04:00
|
|
|
Just f -> customPage (Just About) $ do
|
2012-09-28 19:08:13 -04:00
|
|
|
-- no sidebar, just pages of legalese..
|
2012-09-27 16:47:52 -04:00
|
|
|
setTitle "License"
|
|
|
|
license <- liftIO $ readFile f
|
|
|
|
$(widgetFile "documentation/license")
|
2012-12-02 22:33:30 -04:00
|
|
|
|
2013-06-27 01:15:28 -04:00
|
|
|
getRepoGroupR :: Handler Html
|
2013-10-02 01:06:59 -04:00
|
|
|
getRepoGroupR = page "About repository groups" (Just About) $
|
2012-12-02 22:33:30 -04:00
|
|
|
$(widgetFile "documentation/repogroup")
|