aboutsummaryrefslogtreecommitdiff
path: root/src/client/View/Payments/Table.elm
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/View/Payments/Table.elm')
-rw-r--r--src/client/View/Payments/Table.elm13
1 files changed, 10 insertions, 3 deletions
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