aboutsummaryrefslogtreecommitdiff
path: root/src/client/View
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/View')
-rw-r--r--src/client/View/Date.elm11
-rw-r--r--src/client/View/Form.elm13
2 files changed, 16 insertions, 8 deletions
diff --git a/src/client/View/Date.elm b/src/client/View/Date.elm
index 35806ba..6df971b 100644
--- a/src/client/View/Date.elm
+++ b/src/client/View/Date.elm
@@ -1,5 +1,6 @@
module View.Date exposing
- ( shortView
+ ( shortMonthAndYear
+ , shortView
, longView
, monthView
)
@@ -10,6 +11,14 @@ import String
import Model.Translations exposing (..)
+shortMonthAndYear : Month -> Int -> Translations -> String
+shortMonthAndYear month year translations =
+ let params =
+ [ String.pad 2 '0' (toString (Date.monthToInt month))
+ , toString year
+ ]
+ in getParamMessage params translations "ShortMonthAndYear"
+
shortView : Date -> Translations -> String
shortView date translations =
let params =
diff --git a/src/client/View/Form.elm b/src/client/View/Form.elm
index 7a4965d..977ca0a 100644
--- a/src/client/View/Form.elm
+++ b/src/client/View/Form.elm
@@ -9,6 +9,7 @@ module View.Form exposing
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)
+import Maybe.Extra as Maybe
import FontAwesome
import View.Color as Color
@@ -24,8 +25,6 @@ import LoggedData exposing (LoggedData)
import Model.Translations as Translations exposing (Translations)
-import Utils.Maybe exposing (isJust)
-
textInput : Translations -> Form String a -> String -> String -> Html Form.Msg
textInput translations form formName fieldName =
let field = Form.getFieldAsString fieldName form
@@ -33,13 +32,13 @@ textInput translations form formName fieldName =
in div
[ classList
[ ("textInput", True)
- , ("error", isJust field.liveError)
+ , ("error", Maybe.isJust field.liveError)
]
]
[ Input.textInput
field
[ id fieldId
- , classList [ ("filled", isJust field.value) ]
+ , classList [ ("filled", Maybe.isJust field.value) ]
, value (Maybe.withDefault "" field.value)
]
, label
@@ -60,7 +59,7 @@ colorInput translations form formName fieldName =
in div
[ classList
[ ("colorInput", True)
- , ("error", isJust field.liveError)
+ , ("error", Maybe.isJust field.liveError)
]
]
[ label
@@ -79,7 +78,7 @@ radioInputs translations form formName radioName fieldNames =
in div
[ classList
[ ("radioGroup", True)
- , ("error", isJust field.liveError)
+ , ("error", Maybe.isJust field.liveError)
]
]
[ div
@@ -115,7 +114,7 @@ selectInput translations form formName selectName options =
in div
[ classList
[ ("selectInput", True)
- , ("error", isJust field.liveError)
+ , ("error", Maybe.isJust field.liveError)
]
]
[ label