better word wrapping
This commit is contained in:
parent
dd97273fb7
commit
9e8e1ee1ba
3 changed files with 5 additions and 14 deletions
|
@ -26,7 +26,6 @@ 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.
|
||||
-
|
||||
|
@ -48,16 +47,6 @@ 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)]
|
||||
|
|
2
templates/dashboard/transfers.cassius
Normal file
2
templates/dashboard/transfers.cassius
Normal file
|
@ -0,0 +1,2 @@
|
|||
.forcewrap
|
||||
word-wrap: break-word
|
|
@ -6,11 +6,11 @@
|
|||
<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
|
||||
→
|
||||
|
|
Loading…
Reference in a new issue