import Text.Hamlet
import qualified Data.Map as M
import Control.Concurrent
-import qualified Data.Text as T
{- A display of currently running and queued transfers.
-
isrunning info = not $
transferPaused info || isNothing (startedTime info)
-{- Long filenames can mess up the transfer display, due to the
- - browser not word-wrapping them because it thinks this_is/all_one_word.
- -
- - To deal with this, insert zero-width spaces every 10 characters.
- -}
-segmentFilePath :: FilePath -> T.Text
-segmentFilePath = T.intercalate zspace . T.chunksOf 10 . T.pack
- where
- zspace = T.singleton '\8203'
-
{- Simplifies a list of transfers, avoiding display of redundant
- equivilant transfers. -}
simplifyTransfers :: [(Transfer, TransferInfo)] -> [(Transfer, TransferInfo)]
<div .row-fluid>
<div .span10>
<div .row-fluid>
- <h3>
+ <h3 .forcewrap>
$maybe file <- associatedFile info
- #{segmentFilePath file}
+ #{file}
$nothing
- #{segmentFilePath $ key2file $ transferKey transfer}
+ #{key2file $ transferKey transfer}
$case transferDirection transfer
$of Upload
→