aboutsummaryrefslogtreecommitdiff
path: root/src/client/View
diff options
context:
space:
mode:
authorJoris Guyonvarch2015-08-12 11:37:29 +0200
committerJoris Guyonvarch2015-08-12 11:37:29 +0200
commitf8c5ce08352950f4e74f3c51aa16ef366a9de9c7 (patch)
tree51eede1c267da4c5927c6d4ccabbef6f63d6fd7a /src/client/View
parentd985e879e574c770453590791bc35352c2632d01 (diff)
Translating payment screen except dates
Diffstat (limited to 'src/client/View')
-rw-r--r--src/client/View/Page.elm2
-rw-r--r--src/client/View/Payments.elm7
-rw-r--r--src/client/View/Payments/Add.elm10
3 files changed, 11 insertions, 8 deletions
diff --git a/src/client/View/Page.elm b/src/client/View/Page.elm
index f7292ed..7015317 100644
--- a/src/client/View/Page.elm
+++ b/src/client/View/Page.elm
@@ -28,4 +28,4 @@ renderMain model =
SignInView signInView ->
renderSignIn model signInView
PaymentView paymentsView ->
- renderPayments paymentsView
+ renderPayments model paymentsView
diff --git a/src/client/View/Payments.elm b/src/client/View/Payments.elm
index 7f0c66b..ba930b5 100644
--- a/src/client/View/Payments.elm
+++ b/src/client/View/Payments.elm
@@ -5,16 +5,17 @@ module View.Payments
import Html exposing (..)
import Html.Attributes exposing (..)
+import Model exposing (Model)
import Model.Payment exposing (Payments)
import Model.View.PaymentView exposing (PaymentView)
import View.Payments.Add exposing (addPayment)
import View.Payments.Table exposing (paymentsTable)
-renderPayments : PaymentView -> Html
-renderPayments paymentView =
+renderPayments : Model -> PaymentView -> Html
+renderPayments model paymentView =
div
[ class "payments" ]
- [ addPayment paymentView.add
+ [ addPayment model paymentView.add
, paymentsTable paymentView.payments
]
diff --git a/src/client/View/Payments/Add.elm b/src/client/View/Payments/Add.elm
index d1431b8..3aa44c8 100644
--- a/src/client/View/Payments/Add.elm
+++ b/src/client/View/Payments/Add.elm
@@ -14,7 +14,9 @@ import Update exposing (..)
import Update.Payment exposing (..)
import Update.Payment.Add exposing (..)
+import Model exposing (Model)
import Model.View.Payment.Add exposing (..)
+import Model.Translations exposing (getMessage)
import View.Events exposing (onSubmitPrevDefault)
import View.Icon exposing (renderIcon)
@@ -22,11 +24,11 @@ import View.Icon exposing (renderIcon)
import Utils.Maybe exposing (isJust)
import Utils.Either exposing (toMaybeError)
-addPayment : AddPayment -> Html
-addPayment addPayment =
+addPayment : Model -> AddPayment -> Html
+addPayment model addPayment =
H.form
[ class "add"
- , case (validateName addPayment.name, validateCost addPayment.cost) of
+ , case (validateName addPayment.name model.translations, validateCost addPayment.cost model.translations) of
(Ok name, Ok cost) ->
onSubmitPrevDefault serverCommunications.address (SC.AddPayment name cost)
(resName, resCost) ->
@@ -69,6 +71,6 @@ addPayment addPayment =
text ""
, button
[ type' "submit" ]
- [ text "Add" ]
+ [ text (getMessage "Add" model.translations)]
]
]