diff options
Diffstat (limited to 'src/client/View/Payments/Table.elm')
-rw-r--r-- | src/client/View/Payments/Table.elm | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/client/View/Payments/Table.elm b/src/client/View/Payments/Table.elm index 5374c44..4a1ed50 100644 --- a/src/client/View/Payments/Table.elm +++ b/src/client/View/Payments/Table.elm @@ -43,16 +43,15 @@ paymentsTable model loggedView = paymentLines : Model -> LoggedView -> List Html paymentLines model loggedView = loggedView.payments - |> Dict.toList - |> List.sortBy (\(_, payment) -> Date.toTime payment.creation) + |> List.sortBy (Date.toTime << .creation) |> List.reverse |> List.map (paymentLine model loggedView) -paymentLine : Model -> LoggedView -> PaymentWithId -> Html -paymentLine model loggedView (id, payment) = +paymentLine : Model -> LoggedView -> Payment -> Html +paymentLine model loggedView payment = a - [ class ("row " ++ (if loggedView.edition == Just id then "edition" else "")) - , onClick actions.address (UpdatePayment (ToggleEdit id)) + [ class ("row " ++ (if loggedView.edition == Just payment.id then "edition" else "")) + , onClick actions.address (UpdatePayment (ToggleEdit payment.id)) ] [ div [ class "cell category" ] [ text payment.name ] , div [ class "cell cost" ] [ text ((toString payment.cost) ++ " " ++ (getMessage "MoneySymbol" model.translations)) ] @@ -76,7 +75,7 @@ paymentLine model loggedView (id, payment) = then div [ class "cell remove" - , onClick serverCommunications.address (SC.DeletePayment id payment.userId payment.cost loggedView.currentPage) + , onClick serverCommunications.address (SC.DeletePayment payment.id payment.userId payment.cost loggedView.currentPage) ] [ renderIcon "times" ] else |