webapp: Improve wording of intro display. Closes: #689848

This commit is contained in:
Joey Hess 2012-10-11 15:00:43 -04:00
parent bf11d3d8ae
commit 4ef6dac5c2
4 changed files with 13 additions and 17 deletions

View file

@ -41,7 +41,7 @@ getRepositoriesR :: Handler RepHtml
getRepositoriesR = bootstrap (Just Config) $ do getRepositoriesR = bootstrap (Just Config) $ do
sideBarDisplay sideBarDisplay
setTitle "Repositories" setTitle "Repositories"
repolist <- lift $ repoList False repolist <- lift $ repoList False True
$(widgetFile "configurators/repositories") $(widgetFile "configurators/repositories")
data SetupRepo = EnableRepo (Route WebApp) | EditRepo (Route WebApp) data SetupRepo = EnableRepo (Route WebApp) | EditRepo (Route WebApp)
@ -54,9 +54,9 @@ setupRepoLink :: SetupRepo -> Route WebApp
setupRepoLink (EnableRepo r) = r setupRepoLink (EnableRepo r) = r
setupRepoLink (EditRepo r) = r setupRepoLink (EditRepo r) = r
{- A numbered list of known repositories, including the current one. -} {- A numbered list of known repositories. -}
repoList :: Bool -> Handler [(String, String, SetupRepo)] repoList :: Bool -> Bool -> Handler [(String, String, SetupRepo)]
repoList onlyconfigured repoList onlyconfigured includehere
| onlyconfigured = list =<< configured | onlyconfigured = list =<< configured
| otherwise = list =<< (++) <$> configured <*> unconfigured | otherwise = list =<< (++) <$> configured <*> unconfigured
where where
@ -65,8 +65,9 @@ repoList onlyconfigured
(liftIO . getDaemonStatus =<< daemonStatus <$> getYesod) (liftIO . getDaemonStatus =<< daemonStatus <$> getYesod)
runAnnex [] $ do runAnnex [] $ do
u <- getUUID u <- getUUID
let l = u : map Remote.uuid rs let l = map Remote.uuid rs
return $ zip l (map editlink l) let l' = if includehere then u : l else l
return $ zip l' (map editlink l')
editlink = EditRepo . EditRepositoryR editlink = EditRepo . EditRepositoryR
unconfigured = runAnnex [] $ do unconfigured = runAnnex [] $ do
m <- readRemoteLog m <- readRemoteLog
@ -92,12 +93,10 @@ repoList onlyconfigured
introDisplay :: Text -> Widget introDisplay :: Text -> Widget
introDisplay ident = do introDisplay ident = do
webapp <- lift getYesod webapp <- lift getYesod
repolist <- lift $ repoList True repolist <- lift $ repoList True False
let n = length repolist let n = length repolist
let numrepos = show n let numrepos = show n
let notenough = n < enough let notenough = n < enough
let barelyenough = n == enough
let morethanenough = n > enough
$(widgetFile "configurators/intro") $(widgetFile "configurators/intro")
lift $ modifyWebAppState $ \s -> s { showIntro = False } lift $ modifyWebAppState $ \s -> s { showIntro = False }
where where

1
debian/changelog vendored
View file

@ -8,6 +8,7 @@ git-annex (3.20121010) UNRELEASED; urgency=low
* test: Fix threaded runtime hang. * test: Fix threaded runtime hang.
* Makefile: Avoid building with -threaded if the ghc threaded runtime does * Makefile: Avoid building with -threaded if the ghc threaded runtime does
not exist. not exist.
* webapp: Improve wording of intro display. Closes: #689848
-- Joey Hess <joeyh@debian.org> Wed, 10 Oct 2012 12:59:25 -0400 -- Joey Hess <joeyh@debian.org> Wed, 10 Oct 2012 12:59:25 -0400

View file

@ -3,18 +3,14 @@
<h2> <h2>
git-annex is watching over your files in <small><tt>#{reldir}</tt></small> git-annex is watching over your files in <small><tt>#{reldir}</tt></small>
<p> <p>
It will automatically notice changes, and keep files in sync between # It will automatically notice changes, and keep files in sync #
$if notenough $if notenough
repositories on your devices ... with repositories elsewhere ...
<h2> <h2>
But no other repositories are set up yet. But no other repositories are set up yet.
<a .btn .btn-primary .btn-large href="@{RepositoriesR}">Add another repository</a> <a .btn .btn-primary .btn-large href="@{RepositoriesR}">Add another repository</a>
$else $else
$if barelyenough \ with these repositories:
<span .badge .badge-warning>#{numrepos}</span>
$else
<span .badge .badge-success>#{numrepos}</span>
\ repositories and devices:
<table .table .table-striped .table-condensed> <table .table .table-striped .table-condensed>
<tbody> <tbody>
$forall (num, name, _) <- repolist $forall (num, name, _) <- repolist

View file

@ -3,7 +3,7 @@
git-annex watches over your files git-annex watches over your files
<p> <p>
It will automatically notice changes, and keep files in sync between # It will automatically notice changes, and keep files in sync between #
repositories and devices. here and repositories elsewhere.
<p> <p>
For full details, see # For full details, see #
<a href="http://git-annex.branchable.com/">the git-annex website</a>. <a href="http://git-annex.branchable.com/">the git-annex website</a>.