From 885dfd7708e338a3220c85b7f22a3ac267aad3f7 Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 26 Jun 2016 17:30:03 +0200 Subject: Add the clone functionality on payments --- src/client/elm/LoggedIn/Home/View/Table.elm | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/client/elm/LoggedIn/Home/View') diff --git a/src/client/elm/LoggedIn/Home/View/Table.elm b/src/client/elm/LoggedIn/Home/View/Table.elm index 282f00a..d2087bb 100644 --- a/src/client/elm/LoggedIn/Home/View/Table.elm +++ b/src/client/elm/LoggedIn/Home/View/Table.elm @@ -29,6 +29,8 @@ import Model.Payment as Payment exposing (..) import Model.Translations exposing (getMessage) import Dialog +import Dialog.Model as DialogModel +import Dialog.AddPaymentButton.View as AddPaymentButton view : LoggedData -> HomeModel.Model -> Payments -> Frequency -> Html Msg view loggedData homeModel payments frequency = @@ -61,6 +63,7 @@ headerLine loggedData frequency = Punctual -> div [ class "cell date" ] [ text <| getMessage "Date" loggedData.translations ] Monthly -> text "" , div [ class "cell" ] [] + , div [ class "cell" ] [] ] paymentLine : LoggedData -> HomeModel.Model -> Frequency -> Payment -> Html Msg @@ -96,7 +99,15 @@ paymentLine loggedData homeModel frequency payment = Monthly -> text "" , div - [ class "cell delete" ] + [ class "cell button" ] + [ let currentDate = Date.fromTime loggedData.currentTime + in AddPaymentButton.view + loggedData + (DialogModel.clonePaymentInitial loggedData.translations currentDate payment) + (FontAwesome.clone Color.chestnutRose 18) + ] + , div + [ class "cell button" ] [ if loggedData.me /= payment.userId then text "" -- cgit v1.2.3