webapp: Force wrap long filenames in transfer display.

This commit is contained in:
Joey Hess 2013-03-18 19:09:05 -04:00
parent cdb21649d0
commit 78c1cf5564
3 changed files with 14 additions and 2 deletions

View file

@ -25,6 +25,7 @@ import qualified Git
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.
-
@ -42,6 +43,16 @@ transfersDisplay warnNoScript = do
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)]

1
debian/changelog vendored
View file

@ -23,6 +23,7 @@ git-annex (4.20130315) UNRELEASED; urgency=low
repository when in indirect mode.
* webapp: Improved alerts displayed when syncing with remotes, and
when syncing with a remote fails.
* webapp: Force wrap long filenames in transfer display.
-- Joey Hess <joeyh@debian.org> Fri, 15 Mar 2013 00:10:07 -0400

View file

@ -11,9 +11,9 @@
<div .row-fluid>
<h3>
$maybe file <- associatedFile info
#{file}
#{segmentFilePath file}
$nothing
#{key2file $ transferKey transfer}
#{segmentFilePath $ key2file $ transferKey transfer}
$case transferDirection transfer
$of Upload
&rarr;