diff options
author | Joey Hess <joey@kitenet.net> | 2012-10-31 13:27:56 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-10-31 13:27:56 -0400 |
commit | ee7c7903672d261f82e22192cbf2b5ce736151a9 (patch) | |
tree | 211e0149482b3d0ee3ce5b4b3758f64455a320aa | |
parent | 2bc0c67e19dc2b1a55015b9303476fbcaf73e0e0 (diff) |
avoid using Blaze directly
New 0.5 changes the api, rather gratuitously, so run away. I can juse use
Hamlet here.
-rw-r--r-- | Assistant/Alert.hs | 12 | ||||
-rw-r--r-- | debian/control | 2 | ||||
-rw-r--r-- | doc/bugs/Building_fails:___Not_in_scope:_type_constructor_or_class___96__Html__39__.mdwn | 4 | ||||
-rw-r--r-- | doc/install/fromscratch.mdwn | 2 | ||||
-rw-r--r-- | git-annex.cabal | 2 |
5 files changed, 10 insertions, 12 deletions
diff --git a/Assistant/Alert.hs b/Assistant/Alert.hs index b73a67b67..c729e4de4 100644 --- a/Assistant/Alert.hs +++ b/Assistant/Alert.hs @@ -5,7 +5,7 @@ - Licensed under the GNU GPL version 3 or higher. -} -{-# LANGUAGE RankNTypes, OverloadedStrings #-} +{-# LANGUAGE TemplateHaskell, QuasiQuotes, OverloadedStrings #-} module Assistant.Alert where @@ -18,7 +18,7 @@ import qualified Data.Text as T import Data.Text (Text) import qualified Data.Map as M import Data.String -import Text.Blaze +import Yesod {- Different classes of alerts are displayed differently. -} data AlertClass = Success | Message | Activity | Warning | Error @@ -57,16 +57,16 @@ data Alert = Alert data AlertIcon = ActivityIcon | SuccessIcon | ErrorIcon | InfoIcon | TheCloud -htmlIcon :: AlertIcon -> Html +htmlIcon :: AlertIcon -> GWidget sub master () htmlIcon ActivityIcon = bootStrapIcon "refresh" htmlIcon InfoIcon = bootStrapIcon "info-sign" htmlIcon SuccessIcon = bootStrapIcon "ok" htmlIcon ErrorIcon = bootStrapIcon "exclamation-sign" -- utf-8 umbrella (utf-8 cloud looks too stormy) -htmlIcon TheCloud = preEscapedText "☂" +htmlIcon TheCloud = [whamlet|☂|] -bootStrapIcon :: Text -> Html -bootStrapIcon s = preEscapedText $ T.concat ["<i class=\"icon-", s, "\"></i>"] +bootStrapIcon :: Text -> GWidget sub master () +bootStrapIcon name = [whamlet|<i .icon-#{name}></i>|] {- When clicked, a button always redirects to a URL - It may also run an IO action in the background, which is useful diff --git a/debian/control b/debian/control index 24b204ed7..42ea4cb30 100644 --- a/debian/control +++ b/debian/control @@ -35,8 +35,6 @@ Build-Depends: libghc-wai-logger-dev, libghc-warp-dev, libghc-blaze-builder-dev, - libghc-blaze-html-dev, - libghc-blaze-markup-dev, libghc-crypto-api-dev, libghc-network-multicast-dev, libghc-network-info-dev, diff --git a/doc/bugs/Building_fails:___Not_in_scope:_type_constructor_or_class___96__Html__39__.mdwn b/doc/bugs/Building_fails:___Not_in_scope:_type_constructor_or_class___96__Html__39__.mdwn index 0b916d9b8..6459e3f2e 100644 --- a/doc/bugs/Building_fails:___Not_in_scope:_type_constructor_or_class___96__Html__39__.mdwn +++ b/doc/bugs/Building_fails:___Not_in_scope:_type_constructor_or_class___96__Html__39__.mdwn @@ -184,4 +184,6 @@ git-annex HEAD from git, Ubuntu 12.10. Please provide any additional information below. - +> Hmm, seems that Blaze's API is not stable, and I should avoid using it +> directly. Converted this code to using Hamlet instead for its html +> generation. [[done]] --[[Joey]] diff --git a/doc/install/fromscratch.mdwn b/doc/install/fromscratch.mdwn index d192f0805..000bc8451 100644 --- a/doc/install/fromscratch.mdwn +++ b/doc/install/fromscratch.mdwn @@ -36,8 +36,6 @@ quite a lot. * [wai-logger](http://hackage.haskell.org/package/wai-logger) * [warp](http://hackage.haskell.org/package/warp) * [blaze-builder](http://hackage.haskell.org/package/blaze-builder) - * [blaze-html](http://hackage.haskell.org/package/blaze-html) - * [blaze-markup](http://hackage.haskell.org/package/blaze-markup) * [crypto-api](http://hackage.haskell.org/package/crypto-api) * [hamlet](http://hackage.haskell.org/package/hamlet) * [clientsession](http://hackage.haskell.org/package/clientsession) diff --git a/git-annex.cabal b/git-annex.cabal index 344ef3e59..7f0374a50 100644 --- a/git-annex.cabal +++ b/git-annex.cabal @@ -89,7 +89,7 @@ Executable git-annex if flag(Webapp) && flag(Assistant) Build-Depends: yesod, yesod-static, case-insensitive, http-types, transformers, wai, wai-logger, warp, blaze-builder, - blaze-html, blaze-markup, crypto-api, hamlet, clientsession, + crypto-api, hamlet, clientsession, template-haskell, yesod-default (>= 1.1.0), data-default CPP-Options: -DWITH_WEBAPP |