better word wrapping
authorJoey Hess <joey@kitenet.net>
Wed, 20 Mar 2013 22:21:43 +0000 (18:21 -0400)
committerJoey Hess <joey@kitenet.net>
Wed, 20 Mar 2013 22:21:43 +0000 (18:21 -0400)
Assistant/WebApp/DashBoard.hs
templates/dashboard/transfers.cassius [new file with mode: 0644]
templates/dashboard/transfers.hamlet

index 75c38cdbfabc5ffe0e6d5eb75289f83b7c54e2ca..00738a70c2494ca2ec52a3bd1f25e434cd162d31 100644 (file)
@@ -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 (file)
index 0000000..e9b4fbd
--- /dev/null
@@ -0,0 +1,2 @@
+.forcewrap
+  word-wrap: break-word
index a2340e0a0f4953b23402cfb147aac99f7b7fbe5b..f27709a0eb1d6917d4b2d713b6841bb87123c485 100644 (file)
@@ -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
                     &rarr;