diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | elm-package.json | 6 | ||||
-rw-r--r-- | package.json | 7 | ||||
-rw-r--r-- | src/client/elm/Model/Payment.elm | 8 |
4 files changed, 11 insertions, 12 deletions
@@ -5,7 +5,7 @@ clean: @rm -r elm-stuff >/dev/null 2>&1 || true install: - @elm package install + @elm package install --yes # Watch # ----- diff --git a/elm-package.json b/elm-package.json index a65a9a2..f37c33b 100644 --- a/elm-package.json +++ b/elm-package.json @@ -12,10 +12,10 @@ "elm-lang/navigation": "1.0.0 <= v < 2.0.0", "elm-lang/mouse": "1.0.0 <= v < 2.0.0", "elm-lang/window": "1.0.0 <= v < 2.0.0", + "etaque/elm-simple-form": "3.0.1 <= v < 4.0.0", "evancz/elm-http": "3.0.1 <= v < 4.0.0", "evancz/url-parser": "1.0.0 <= v < 2.0.0", - "etaque/elm-simple-form": "3.0.1 <= v < 4.0.0", - "rluiten/elm-date-extra": "6.0.1 <= v < 7.0.0", - "jystic/elm-font-awesome": "2.0.0 <= v < 3.0.0" + "jystic/elm-font-awesome": "2.0.0 <= v < 3.0.0", + "rluiten/elm-date-extra": "6.0.1 <= v < 7.0.0" } } diff --git a/package.json b/package.json deleted file mode 100644 index 6d7467e..0000000 --- a/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "dependencies": { - "nodemon": "1.9.2" - }, - "repository": "guyonvarch/sharedCost", - "license": "GPL-3.0" -} diff --git a/src/client/elm/Model/Payment.elm b/src/client/elm/Model/Payment.elm index b986148..5109b2f 100644 --- a/src/client/elm/Model/Payment.elm +++ b/src/client/elm/Model/Payment.elm @@ -20,6 +20,7 @@ import Date exposing (..) import Date.Extra.Core exposing (monthToInt, intToMonth) import Json.Decode as Json exposing ((:=)) import String +import List import Form.Validate as Validate exposing (Validation) import Model.User exposing (UserId, userIdDecoder) @@ -115,7 +116,12 @@ paymentSort frequency = Monthly -> List.sortBy (String.toLower << .name) searchSuccess : String -> Payment -> Bool -searchSuccess text { name } = (String.toLower text) `String.contains` (String.toLower name) +searchSuccess search { name, cost } = + let searchSuccessWord word = + ( String.contains (String.toLower word) (String.toLower name) + || String.contains word (toString cost) + ) + in List.all searchSuccessWord (String.words search) validateFrequency : Validation String Frequency validateFrequency = |