diff --git a/.gitignore b/.gitignore index 398372f..e950c61 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ dist/ .ghc* cabal.project.* *.bak* +.direnv/ +.envrc diff --git a/src/Types.hs b/src/Types.hs index e2bf0b3..14d87c8 100644 --- a/src/Types.hs +++ b/src/Types.hs @@ -9,5 +9,4 @@ import Types.Views as T import Types.User as T import Types.Journal as T import Types.Product as T -import Types.Orphans as T import Types.Configuration as T diff --git a/src/Util.hs b/src/Util.hs index 3f66c42..afcedfc 100644 --- a/src/Util.hs +++ b/src/Util.hs @@ -8,17 +8,15 @@ module Util where import Servant hiding (addHeader) import Servant.Client -import Servant.Client.Core.Request import qualified Text.Blaze.Html5.Attributes as HA +import Text.Blaze.Internal import qualified Data.Text as T import Data.Text.Encoding import Data.Text.I18n -import Data.ByteString.Builder - import Data.List (intercalate) import Data.List.Split (chunksOf) @@ -26,13 +24,11 @@ import Data.String (fromString) import Data.Maybe (fromMaybe) -import Web.Cookie - import Text.Printf (printf) import Network.HTTP.Types.Status -import Control.Monad.Reader (ask, asks) +import Control.Monad.Reader (ask) -- imports from "mateamt" @@ -177,6 +173,9 @@ redirectOverAuth muid mLink mRefine = do } ) +productBgStyle + :: AttributeValue + -> Attribute productBgStyle aid = HA.style $ mconcat [ "background-image: url(#" <> aid <> ");" -- FILLME , "backgronud-color: blue;" @@ -196,6 +195,11 @@ controlInit mcookie = do (ReadState l10n backend _ symbol version) <- ask return (token, muser, loc, l10n, backend, symbol, version) +handleClientErr + :: ClientError + -> Maybe Int + -> Maybe Link + -> UserHandler UserOverviewPage handleClientErr err muid authTargetLink = case err of FailureResponse _ resp -> diff --git a/src/View/Buy.hs b/src/View/Buy.hs index dbb7c64..dfcdba7 100644 --- a/src/View/Buy.hs +++ b/src/View/Buy.hs @@ -13,7 +13,7 @@ import Data.String (fromString) import Data.Text.I18n -import Data.Maybe (isJust, fromJust, fromMaybe) +import Data.Maybe (isJust, fromJust) import Control.Monad (when) @@ -59,8 +59,8 @@ buyConfirmPage l10n locale uid ziptups total forceBuy version mcookie symbol = H.! HA.enctype "application/x-www-form-urlencoded" $ do mapM_ - (\( MT.PurchaseDetail pdid amount - , MT.ProductShortOverview pid ident price _ _ mava) -> + (\( MT.PurchaseDetail _ _ + , MT.ProductShortOverview pid ident price amount _ mava) -> H.div H.! HA.class_ "form-group required" $ do H.input H.! HA.id ("product-select-" <> fromString (show pid)) @@ -141,7 +141,7 @@ buyProductsForm -> H.Html buyProductsForm l10n locale prods = do H.div H.! HA.class_ "tile-list" $ - mapM_ (\(MT.ProductShortOverview pid ident price amount ml maid) -> + mapM_ (\(MT.ProductShortOverview pid ident _ _ _ maid) -> H.div H.! HA.class_ "tile" H.!? diff --git a/src/View/Product.hs b/src/View/Product.hs index 947cc9e..a3b9a7f 100644 --- a/src/View/Product.hs +++ b/src/View/Product.hs @@ -81,7 +81,7 @@ productRefillPage l10n loc version mcookie prodList = H.! HA.enctype "application/x-www-form-urlencoded" $ do mapM_ - (\(MT.ProductShortOverview pid ident price amount ml maid) -> do + (\(MT.ProductShortOverview pid ident _ _ _ maid) -> do H.div H.! HA.class_ "form-group optional" H.!?