From 3b738e0d4cc65f314da7389d4542ec826ba0f454 Mon Sep 17 00:00:00 2001 From: Joris Date: Sat, 5 Sep 2015 13:53:36 +0200 Subject: Using UserId instead of UserName to indentify users --- src/client/View/Payments/ExceedingPayer.elm | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'src/client/View/Payments/ExceedingPayer.elm') 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)) ] ] -- cgit v1.2.3