From: Joey Hess Date: Wed, 20 Mar 2013 22:21:43 +0000 (-0400) Subject: better word wrapping X-Git-Tag: archive/raspbian/10.20250416-2+rpi1~1^2~4777 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=9e8e1ee1bafdee2d4a87bbb63c0064a8840c5185;p=git-annex.git better word wrapping --- diff --git a/Assistant/WebApp/DashBoard.hs b/Assistant/WebApp/DashBoard.hs index 75c38cdbfa..00738a70c2 100644 --- a/Assistant/WebApp/DashBoard.hs +++ b/Assistant/WebApp/DashBoard.hs @@ -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)] diff --git a/templates/dashboard/transfers.cassius b/templates/dashboard/transfers.cassius new file mode 100644 index 0000000000..e9b4fbdfbf --- /dev/null +++ b/templates/dashboard/transfers.cassius @@ -0,0 +1,2 @@ +.forcewrap + word-wrap: break-word diff --git a/templates/dashboard/transfers.hamlet b/templates/dashboard/transfers.hamlet index a2340e0a0f..f27709a0eb 100644 --- a/templates/dashboard/transfers.hamlet +++ b/templates/dashboard/transfers.hamlet @@ -6,11 +6,11 @@
-

+

$maybe file <- associatedFile info - #{segmentFilePath file} + #{file} $nothing - #{segmentFilePath $ key2file $ transferKey transfer} + #{key2file $ transferKey transfer} $case transferDirection transfer $of Upload →