diff options
author | Joris | 2015-09-05 13:53:36 +0200 |
---|---|---|
committer | Joris | 2015-09-05 13:53:36 +0200 |
commit | 3b738e0d4cc65f314da7389d4542ec826ba0f454 (patch) | |
tree | ee99236117ad698974c5a6e40ab170f617cb06f3 /src/client/View/Payments/ExceedingPayer.elm | |
parent | 139d4a103a6a48880e5f12a796033956f223563c (diff) |
Using UserId instead of UserName to indentify users
Diffstat (limited to 'src/client/View/Payments/ExceedingPayer.elm')
-rw-r--r-- | src/client/View/Payments/ExceedingPayer.elm | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/client/View/Payments/ExceedingPayer.elm b/src/client/View/Payments/ExceedingPayer.elm index 903ad5b..f249383 100644 --- a/src/client/View/Payments/ExceedingPayer.elm +++ b/src/client/View/Payments/ExceedingPayer.elm @@ -7,6 +7,7 @@ import Html.Attributes exposing (..) import List import Model exposing (Model) +import Model.User exposing (getUserName) import Model.Payers exposing (..) import Model.View.PaymentView exposing (PaymentView) import Model.Translations exposing (getMessage) @@ -15,12 +16,20 @@ exceedingPayers : Model -> PaymentView -> Html exceedingPayers model paymentView = div [ class "exceedingPayers" ] - (List.map (exceedingPayer model) (getOrderedExceedingPayers paymentView.payers)) + (List.map (exceedingPayer model paymentView) (getOrderedExceedingPayers paymentView.payers)) -exceedingPayer : Model -> ExceedingPayer -> Html -exceedingPayer model payer = +exceedingPayer : Model -> PaymentView -> ExceedingPayer -> Html +exceedingPayer model paymentView payer = div [ class "exceedingPayer" ] - [ span [ class "userName" ] [ text payer.userName ] - , span [ class "amount" ] [ text ("+ " ++ (toString payer.amount) ++ " " ++ (getMessage "MoneySymbol" model.translations)) ] + [ span + [ class "userName" ] + [ payer.userId + |> getUserName paymentView.users + |> Maybe.withDefault "−" + |> text + ] + , span + [ class "amount" ] + [ text ("+ " ++ (toString payer.amount) ++ " " ++ (getMessage "MoneySymbol" model.translations)) ] ] |