spruce up display of the repo list

This commit is contained in:
Joey Hess 2012-07-30 13:31:19 -04:00
parent 9c9db6feb8
commit 1f671ee40c
2 changed files with 13 additions and 5 deletions

View file

@ -171,17 +171,20 @@ introDisplay :: Text -> Widget
introDisplay ident = do
webapp <- lift getYesod
let reldir = relDir webapp
remotelist <- liftIO $ runThreadState (threadState webapp) $ do
l <- liftIO $ runThreadState (threadState webapp) $ do
u <- getUUID
rs <- map Remote.uuid <$> Remote.remoteList
rs' <- snd <$> trustPartition DeadTrusted rs
Remote.prettyListUUIDs $ filter (/= webUUID) $ nub $ u:rs'
let n = length remotelist
let remotelist = zip counter l
let n = length l
let numrepos = show n
let notenough = n < 2
let barelyenough = n == 2
let morethanenough = n > 2
$(widgetFile "intro")
where
counter = map show ([1..] :: [Int])
{- Called by client to get a display of currently in process transfers.
-

View file

@ -14,9 +14,14 @@
$else
<span .badge .badge-success>#{numrepos}</span>
\ repositories and devices:
<ul>
$forall name <- remotelist
<li>#{name}
<table .table .table-striped .table-condensed>
<tbody>
$forall (num, name) <- remotelist
<tr>
<td>
#{num}
<td>
#{name}
<a .btn .btn-primary .btn-large href="@{AddRepositoryR}">Add another repository</a>
<p>
Or just sit back, watch the magic, and get on with using your files.