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/Table.elm | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/client/View/Payments/Table.elm') diff --git a/src/client/View/Payments/Table.elm b/src/client/View/Payments/Table.elm index 06bec17..743a8a9 100644 --- a/src/client/View/Payments/Table.elm +++ b/src/client/View/Payments/Table.elm @@ -13,6 +13,7 @@ import Date exposing (Date) import String exposing (append) import Model exposing (Model) +import Model.User exposing (getUserName) import Model.Payment exposing (..) import Model.View.PaymentView exposing (PaymentView) import Model.Translations exposing (getMessage) @@ -55,7 +56,13 @@ paymentLine model paymentView (id, payment) = ] [ div [ class "cell category" ] [ text payment.name ] , div [ class "cell cost" ] [ text ((toString payment.cost) ++ " " ++ (getMessage "MoneySymbol" model.translations)) ] - , div [ class "cell user" ] [ text payment.userName ] + , div + [ class "cell user" ] + [ payment.userId + |> getUserName paymentView.users + |> Maybe.withDefault "−" + |> text + ] , div [ class "cell date" ] [ span @@ -65,11 +72,11 @@ paymentLine model paymentView (id, payment) = [ class "longDate" ] [ text (renderLongDate payment.creation model.translations) ] ] - , if paymentView.userName == payment.userName + , if paymentView.me == payment.userId then div [ class "cell remove" - , onClick serverCommunications.address (SC.DeletePayment id payment.userName payment.cost paymentView.currentPage) + , onClick serverCommunications.address (SC.DeletePayment id payment.userId payment.cost paymentView.currentPage) ] [ renderIcon "times" ] else -- cgit v1.2.3