2012-07-31 05:11:32 +00:00
|
|
|
{- git-annex assistant webapp configurators
|
|
|
|
-
|
|
|
|
- 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 05:11:32 +00:00
|
|
|
-}
|
|
|
|
|
2012-10-18 14:14:49 +00:00
|
|
|
{-# LANGUAGE TypeFamilies, QuasiQuotes, MultiParamTypeClasses, TemplateHaskell, OverloadedStrings, RankNTypes, CPP #-}
|
2012-07-31 05:11:32 +00:00
|
|
|
|
|
|
|
module Assistant.WebApp.Configurators where
|
|
|
|
|
2012-11-25 04:26:46 +00:00
|
|
|
import Assistant.WebApp.Common
|
2013-03-15 02:10:51 +00:00
|
|
|
import Assistant.WebApp.RepoList
|
2012-11-02 16:59:31 +00:00
|
|
|
#ifdef WITH_XMPP
|
|
|
|
import Assistant.XMPP.Client
|
|
|
|
#endif
|
2012-07-31 05:11:32 +00:00
|
|
|
|
2012-08-03 18:36:16 +00:00
|
|
|
{- The main configuration screen. -}
|
2012-12-30 03:10:18 +00:00
|
|
|
getConfigurationR :: Handler RepHtml
|
|
|
|
getConfigurationR = ifM (inFirstRun)
|
2013-03-18 16:47:44 +00:00
|
|
|
( redirect FirstRepositoryR
|
2012-12-30 03:10:18 +00:00
|
|
|
, page "Configuration" (Just Configuration) $ do
|
2012-11-02 16:59:31 +00:00
|
|
|
#ifdef WITH_XMPP
|
2013-03-16 04:12:28 +00:00
|
|
|
xmppconfigured <- liftAnnex $ isJust <$> getXMPPCreds
|
2012-11-02 16:59:31 +00:00
|
|
|
#else
|
|
|
|
let xmppconfigured = False
|
|
|
|
#endif
|
2012-08-03 18:36:16 +00:00
|
|
|
$(widgetFile "configurators/main")
|
|
|
|
)
|
2013-03-15 02:10:51 +00:00
|
|
|
|
2013-03-15 04:34:42 +00:00
|
|
|
getAddRepositoryR :: Handler RepHtml
|
|
|
|
getAddRepositoryR = page "Add Repository" (Just Configuration) $ do
|
|
|
|
let repolist = repoListDisplay mainRepoSelector
|
2013-03-15 16:47:41 +00:00
|
|
|
$(widgetFile "configurators/addrepository")
|
2013-03-15 02:10:51 +00:00
|
|
|
|
|
|
|
makeMiscRepositories :: Widget
|
2013-03-15 16:47:41 +00:00
|
|
|
makeMiscRepositories = $(widgetFile "configurators/addrepository/misc")
|
2013-03-15 02:10:51 +00:00
|
|
|
|
|
|
|
makeCloudRepositories :: Bool -> Widget
|
2013-03-15 16:47:41 +00:00
|
|
|
makeCloudRepositories onlyTransfer = $(widgetFile "configurators/addrepository/cloud")
|