git-annex/Assistant/WebApp/Configurators.hs

45 lines
1.2 KiB
Haskell
Raw Normal View History

2012-07-31 05:11:32 +00:00
{- git-annex assistant webapp configurators
-
- Copyright 2012 Joey Hess <joey@kitenet.net>
-
- 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 RepHtml
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 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 :: Widget
makeCloudRepositories = $(widgetFile "configurators/addrepository/cloud")
makeArchiveRepositories :: Widget
makeArchiveRepositories = $(widgetFile "configurators/addrepository/archive")