diff options
| author | Gregor Kleen <gkleen@yggdrasil.li> | 2017-07-30 00:39:35 +0200 |
|---|---|---|
| committer | Gregor Kleen <gkleen@yggdrasil.li> | 2017-07-30 00:39:35 +0200 |
| commit | a1c4553928369068e019f350a6736c62effb9fc6 (patch) | |
| tree | c7a6bed287f1d9e06ed317fedee6f21ba5198f91 | |
| parent | 65fd24dcca71c6ea6332df618fdf43b60705778b (diff) | |
| download | bar-a1c4553928369068e019f350a6736c62effb9fc6.tar bar-a1c4553928369068e019f350a6736c62effb9fc6.tar.gz bar-a1c4553928369068e019f350a6736c62effb9fc6.tar.bz2 bar-a1c4553928369068e019f350a6736c62effb9fc6.tar.xz bar-a1c4553928369068e019f350a6736c62effb9fc6.zip | |
use Yesod idents
| -rw-r--r-- | Handler/Common.hs | 12 | ||||
| -rw-r--r-- | bar.cabal | 2 | ||||
| -rw-r--r-- | 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 | |||
| 16 | 16 | ||
| 17 | import Import hiding ((\\)) | 17 | import Import hiding ((\\)) |
| 18 | 18 | ||
| 19 | import Data.Unique | ||
| 20 | |||
| 21 | import qualified Data.Text as Text | 19 | import qualified Data.Text as Text |
| 22 | import qualified Data.ByteString.Char8 as CBS | 20 | import qualified Data.ByteString.Char8 as CBS |
| 23 | 21 | ||
| @@ -102,9 +100,9 @@ itemForm proto identView = do | |||
| 102 | 100 | ||
| 103 | let mWhen = bool (Nothing <$) (fmap Just) | 101 | let mWhen = bool (Nothing <$) (fmap Just) |
| 104 | 102 | ||
| 105 | neverBoxId <- ("check" <>) . show . hashUnique <$> liftIO newUnique | 103 | neverBoxId <- newIdent |
| 106 | unknownBoxId <- ("check" <>) . show . hashUnique <$> liftIO newUnique | 104 | unknownBoxId <- newIdent |
| 107 | groupId <- ("dateGroup" <>) . show . hashUnique <$> liftIO newUnique | 105 | groupId <- newIdent |
| 108 | 106 | ||
| 109 | dNever <- mWhen dfNever $ | 107 | dNever <- mWhen dfNever $ |
| 110 | mopt checkBoxField ("" { fsId = Just $ Text.pack neverBoxId }) . Just . Just . fromMaybe True $ fmap isNever proto | 108 | mopt checkBoxField ("" { fsId = Just $ Text.pack neverBoxId }) . Just . Just . fromMaybe True $ fmap isNever proto |
| @@ -202,12 +200,12 @@ typedKindField :: (Widget -> Widget -> Widget) -- ^ `\kindWidget typeWidget -> _ | |||
| 202 | -> (Maybe Text, Maybe Text) -- ^ `(kindProto, typeProto)` | 200 | -> (Maybe Text, Maybe Text) -- ^ `(kindProto, typeProto)` |
| 203 | -> MForm Handler ((FormResult Text, FormResult Text), Widget) -- ^ `((kindRes, typeRes), typedKindWidget)` | 201 | -> MForm Handler ((FormResult Text, FormResult Text), Widget) -- ^ `((kindRes, typeRes), typedKindWidget)` |
| 204 | typedKindField collate (kindProto, typeProto) = do | 202 | typedKindField collate (kindProto, typeProto) = do |
| 205 | tOptionId <- ("options" <>) . tshow . hashUnique <$> liftIO newUnique | 203 | tOptionId <- newIdent |
| 206 | let | 204 | let |
| 207 | tAttrs = [ ("list", tOptionId) | 205 | tAttrs = [ ("list", tOptionId) |
| 208 | , ("autocomplete", "off") | 206 | , ("autocomplete", "off") |
| 209 | ] | 207 | ] |
| 210 | kOptionId <- ("options" <>) . tshow . hashUnique <$> liftIO newUnique | 208 | kOptionId <- newIdent |
| 211 | let | 209 | let |
| 212 | kAttrs = [ ("list", kOptionId) | 210 | kAttrs = [ ("list", kOptionId) |
| 213 | , ("autocomplete", "off") | 211 | , ("autocomplete", "off") |
| @@ -1,5 +1,5 @@ | |||
| 1 | name: bar | 1 | name: bar |
| 2 | version: 0.6.3 | 2 | version: 0.6.4 |
| 3 | cabal-version: >= 1.8 | 3 | cabal-version: >= 1.8 |
| 4 | build-type: Simple | 4 | build-type: Simple |
| 5 | 5 | ||
| @@ -10,7 +10,7 @@ | |||
| 10 | }: | 10 | }: |
| 11 | mkDerivation { | 11 | mkDerivation { |
| 12 | pname = "bar"; | 12 | pname = "bar"; |
| 13 | version = "0.6.3"; | 13 | version = "0.6.4"; |
| 14 | src = ./.; | 14 | src = ./.; |
| 15 | isLibrary = true; | 15 | isLibrary = true; |
| 16 | isExecutable = true; | 16 | isExecutable = true; |
