From a1c4553928369068e019f350a6736c62effb9fc6 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 30 Jul 2017 00:39:35 +0200 Subject: use Yesod idents --- Handler/Common.hs | 12 +++++------- bar.cabal | 2 +- bar.nix | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Handler/Common.hs b/Handler/Common.hs index 776d6ff..87496cb 100644 --- a/Handler/Common.hs +++ b/Handler/Common.hs @@ -16,8 +16,6 @@ module Handler.Common import Import hiding ((\\)) -import Data.Unique - import qualified Data.Text as Text import qualified Data.ByteString.Char8 as CBS @@ -102,9 +100,9 @@ itemForm proto identView = do let mWhen = bool (Nothing <$) (fmap Just) - neverBoxId <- ("check" <>) . show . hashUnique <$> liftIO newUnique - unknownBoxId <- ("check" <>) . show . hashUnique <$> liftIO newUnique - groupId <- ("dateGroup" <>) . show . hashUnique <$> liftIO newUnique + neverBoxId <- newIdent + unknownBoxId <- newIdent + groupId <- newIdent dNever <- mWhen dfNever $ mopt checkBoxField ("" { fsId = Just $ Text.pack neverBoxId }) . Just . Just . fromMaybe True $ fmap isNever proto @@ -202,12 +200,12 @@ typedKindField :: (Widget -> Widget -> Widget) -- ^ `\kindWidget typeWidget -> _ -> (Maybe Text, Maybe Text) -- ^ `(kindProto, typeProto)` -> MForm Handler ((FormResult Text, FormResult Text), Widget) -- ^ `((kindRes, typeRes), typedKindWidget)` typedKindField collate (kindProto, typeProto) = do - tOptionId <- ("options" <>) . tshow . hashUnique <$> liftIO newUnique + tOptionId <- newIdent let tAttrs = [ ("list", tOptionId) , ("autocomplete", "off") ] - kOptionId <- ("options" <>) . tshow . hashUnique <$> liftIO newUnique + kOptionId <- newIdent let kAttrs = [ ("list", kOptionId) , ("autocomplete", "off") diff --git a/bar.cabal b/bar.cabal index 8840818..13e47d1 100644 --- a/bar.cabal +++ b/bar.cabal @@ -1,5 +1,5 @@ name: bar -version: 0.6.3 +version: 0.6.4 cabal-version: >= 1.8 build-type: Simple diff --git a/bar.nix b/bar.nix index f0617bd..1b690db 100644 --- a/bar.nix +++ b/bar.nix @@ -10,7 +10,7 @@ }: mkDerivation { pname = "bar"; - version = "0.6.3"; + version = "0.6.4"; src = ./.; isLibrary = true; isExecutable = true; -- cgit v1.2.3