webapp: Force wrap long filenames in transfer display.
This commit is contained in:
parent
cdb21649d0
commit
78c1cf5564
3 changed files with 14 additions and 2 deletions
|
@ -25,6 +25,7 @@ import qualified Git
|
||||||
import Text.Hamlet
|
import Text.Hamlet
|
||||||
import qualified Data.Map as M
|
import qualified Data.Map as M
|
||||||
import Control.Concurrent
|
import Control.Concurrent
|
||||||
|
import qualified Data.Text as T
|
||||||
|
|
||||||
{- A display of currently running and queued transfers.
|
{- A display of currently running and queued transfers.
|
||||||
-
|
-
|
||||||
|
@ -42,6 +43,16 @@ transfersDisplay warnNoScript = do
|
||||||
isrunning info = not $
|
isrunning info = not $
|
||||||
transferPaused info || isNothing (startedTime info)
|
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
|
{- Simplifies a list of transfers, avoiding display of redundant
|
||||||
- equivilant transfers. -}
|
- equivilant transfers. -}
|
||||||
simplifyTransfers :: [(Transfer, TransferInfo)] -> [(Transfer, TransferInfo)]
|
simplifyTransfers :: [(Transfer, TransferInfo)] -> [(Transfer, TransferInfo)]
|
||||||
|
|
1
debian/changelog
vendored
1
debian/changelog
vendored
|
@ -23,6 +23,7 @@ git-annex (4.20130315) UNRELEASED; urgency=low
|
||||||
repository when in indirect mode.
|
repository when in indirect mode.
|
||||||
* webapp: Improved alerts displayed when syncing with remotes, and
|
* webapp: Improved alerts displayed when syncing with remotes, and
|
||||||
when syncing with a remote fails.
|
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
|
-- Joey Hess <joeyh@debian.org> Fri, 15 Mar 2013 00:10:07 -0400
|
||||||
|
|
||||||
|
|
|
@ -11,9 +11,9 @@
|
||||||
<div .row-fluid>
|
<div .row-fluid>
|
||||||
<h3>
|
<h3>
|
||||||
$maybe file <- associatedFile info
|
$maybe file <- associatedFile info
|
||||||
#{file}
|
#{segmentFilePath file}
|
||||||
$nothing
|
$nothing
|
||||||
#{key2file $ transferKey transfer}
|
#{segmentFilePath $ key2file $ transferKey transfer}
|
||||||
$case transferDirection transfer
|
$case transferDirection transfer
|
||||||
$of Upload
|
$of Upload
|
||||||
→
|
→
|
||||||
|
|
Loading…
Add table
Reference in a new issue