diff options
author | Joris | 2015-08-27 20:36:18 +0200 |
---|---|---|
committer | Joris | 2015-08-27 20:36:18 +0200 |
commit | fd86f021e88a00348ac0e03f03d81cb15bf3042b (patch) | |
tree | baf7cbb5cc01fccebc235e0e400cad94eb90de6b /src/client/View | |
parent | a2527c34e6b0e719a948cfd36bfee5ffad095a30 (diff) |
Server payament delete
Diffstat (limited to 'src/client/View')
-rw-r--r-- | src/client/View/Payments/Table.elm | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/client/View/Payments/Table.elm b/src/client/View/Payments/Table.elm index 9033db8..50dd151 100644 --- a/src/client/View/Payments/Table.elm +++ b/src/client/View/Payments/Table.elm @@ -16,6 +16,8 @@ import Model exposing (Model) import Model.Payment exposing (..) import Model.View.PaymentView exposing (PaymentView) +import ServerCommunication as SC exposing (serverCommunications) + import Update exposing (..) import Update.Payment exposing (..) @@ -54,9 +56,13 @@ paymentLine model paymentView (id, payment) = , div [ class "cell" ] [ text ((toString payment.cost) ++ " €") ] , div [ class "cell" ] [ text payment.userName ] , div [ class "cell" ] [ text (renderDate payment.creation model.translations) ] - , div - [ class "cell remove" - , onClick actions.address (UpdatePayment (Remove id)) - ] - [ renderIcon "times" ] + , if paymentView.userName == payment.userName + then + div + [ class "cell remove" + , onClick serverCommunications.address (SC.DeletePayment id) + ] + [ renderIcon "times" ] + else + div [ class "cell" ] [] ] |