git-annex/Assistant/WebApp/Configurators.hs

53 lines
1.5 KiB
Haskell
Raw Normal View History

2012-07-31 05:11:32 +00:00
{- git-annex assistant webapp configurators
-
- Copyright 2012 Joey Hess <id@joeyh.name>
2012-07-31 05:11:32 +00:00
-
- Licensed under the GNU AGPL version 3 or higher.
2012-07-31 05:11:32 +00:00
-}
2013-06-05 01:02:09 +00:00
{-# LANGUAGE QuasiQuotes, TemplateHaskell, OverloadedStrings, 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
{- The main configuration screen. -}
getConfigurationR :: Handler Html
2013-10-02 05:06:59 +00:00
getConfigurationR = ifM inFirstRun
( redirect FirstRepositoryR
, page "Configuration" (Just Configuration) $ do
2012-11-02 16:59:31 +00:00
#ifdef WITH_XMPP
xmppconfigured <- liftAnnex $ isJust <$> getXMPPCreds
2012-11-02 16:59:31 +00:00
#else
let xmppconfigured = False
#endif
$(widgetFile "configurators/main")
)
2013-03-15 02:10:51 +00:00
getAddRepositoryR :: Handler Html
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 :: Widget
makeCloudRepositories = $(widgetFile "configurators/addrepository/cloud")
makeXMPPConnection :: Widget
makeXMPPConnection = $(widgetFile "configurators/addrepository/xmppconnection")
makeSshRepository :: Widget
makeSshRepository = $(widgetFile "configurators/addrepository/ssh")
makeConnectionRepositories :: Widget
makeConnectionRepositories = $(widgetFile "configurators/addrepository/connection")
makeArchiveRepositories :: Widget
makeArchiveRepositories = $(widgetFile "configurators/addrepository/archive")