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

1
debian/changelog vendored
View file

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

View file

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

View file

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