From 8816cf758119a6a2073e561c8df297a833630986 Mon Sep 17 00:00:00 2001 From: Joris Date: Mon, 8 Aug 2016 20:58:17 +0200 Subject: Show incomes in a table and update like payments are updated --- src/client/elm/LoggedIn/Home/Header/View.elm | 8 ++++---- src/client/elm/LoggedIn/Home/View/Expand.elm | 29 ---------------------------- src/client/elm/LoggedIn/Home/View/Table.elm | 23 +++++++++++----------- 3 files changed, 15 insertions(+), 45 deletions(-) delete mode 100644 src/client/elm/LoggedIn/Home/View/Expand.elm (limited to 'src/client/elm/LoggedIn/Home') diff --git a/src/client/elm/LoggedIn/Home/Header/View.elm b/src/client/elm/LoggedIn/Home/Header/View.elm index 95cef3c..e6b2444 100644 --- a/src/client/elm/LoggedIn/Home/Header/View.elm +++ b/src/client/elm/LoggedIn/Home/Header/View.elm @@ -25,8 +25,8 @@ import Model.Conf exposing (Conf) import Model.Payment as Payment exposing (Payments, Frequency(..)) import Model.Translations exposing (getMessage) -import Dialog.Model as DialogModel -import Dialog.AddPaymentButton.View as AddPaymentButton +import Dialog.AddPayment.Model as AddPayment +import Dialog.AddPayment.View as AddPayment import LoggedIn.Home.View.ExceedingPayers as ExceedingPayers import LoggedIn.View.Format as Format @@ -42,9 +42,9 @@ view loggedData { search } payments frequency = [ div [ class "payerAndAdd" ] [ ExceedingPayers.view loggedData - , AddPaymentButton.view + , AddPayment.button loggedData - (DialogModel.addPaymentInitial loggedData.translations currentDate frequency) + (AddPayment.initialAdd loggedData.translations currentDate frequency) "AddPayment" (text (getMessage "AddPayment" loggedData.translations)) Nothing diff --git a/src/client/elm/LoggedIn/Home/View/Expand.elm b/src/client/elm/LoggedIn/Home/View/Expand.elm deleted file mode 100644 index 2bcfec1..0000000 --- a/src/client/elm/LoggedIn/Home/View/Expand.elm +++ /dev/null @@ -1,29 +0,0 @@ -module LoggedIn.Home.View.Expand exposing - ( expand - , ExpandType(..) - ) - -import View.Color as Color - -import FontAwesome - -import Html exposing (..) -import Html.Attributes exposing (..) - -import Msg exposing (Msg) - -type ExpandType = ExpandUp | ExpandDown - -expand : ExpandType -> Bool -> Html Msg -expand expandType isExpanded = - div - [ class "expand" ] - [ (chevronIcon expandType isExpanded) Color.white 15 ] - -chevronIcon : ExpandType -> Bool -> (Color -> Int -> Html msg) -chevronIcon expandType isExpanded = - case (expandType, isExpanded) of - (ExpandUp, True) -> FontAwesome.chevron_down - (ExpandUp, False) -> FontAwesome.chevron_up - (ExpandDown, True) -> FontAwesome.chevron_up - (ExpandDown, False) -> FontAwesome.chevron_down diff --git a/src/client/elm/LoggedIn/Home/View/Table.elm b/src/client/elm/LoggedIn/Home/View/Table.elm index 429632c..6c12f31 100644 --- a/src/client/elm/LoggedIn/Home/View/Table.elm +++ b/src/client/elm/LoggedIn/Home/View/Table.elm @@ -14,8 +14,8 @@ import Html.Attributes exposing (..) import Html.Events exposing (..) import Dialog -import Dialog.Model as DialogModel -import Dialog.AddPaymentButton.View as AddPaymentButton +import Dialog.AddPayment.Model as AddPayment +import Dialog.AddPayment.View as AddPayment import Tooltip @@ -25,8 +25,7 @@ import LoggedData exposing (LoggedData) import LoggedIn.Msg as LoggedInMsg -import LoggedIn.Home.Msg as HomeMsg -import LoggedIn.Home.Model as HomeModel +import LoggedIn.Home.Model as Home import View.Date as Date import LoggedIn.View.Format as Format @@ -34,7 +33,7 @@ import Model.User exposing (getUserName) import Model.Payment as Payment exposing (..) import Model.Translations exposing (getMessage) -view : LoggedData -> HomeModel.Model -> Payments -> Frequency -> Html Msg +view : LoggedData -> Home.Model -> Payments -> Frequency -> Html Msg view loggedData homeModel payments frequency = let visiblePayments = payments @@ -48,7 +47,7 @@ view loggedData homeModel payments frequency = , if List.isEmpty visiblePayments then div - [ class "noPayment" ] + [ class "emptyTableMsg" ] [ text <| getMessage "NoPayment" loggedData.translations ] else text "" @@ -69,7 +68,7 @@ headerLine loggedData frequency = , div [ class "cell" ] [] ] -paymentLine : LoggedData -> HomeModel.Model -> Frequency -> Payment -> Html Msg +paymentLine : LoggedData -> Home.Model -> Frequency -> Payment -> Html Msg paymentLine loggedData homeModel frequency payment = div [ class "row" ] @@ -104,9 +103,9 @@ paymentLine loggedData homeModel frequency payment = , div [ class "cell button" ] [ let currentDate = Date.fromTime loggedData.currentTime - in AddPaymentButton.view + in AddPayment.button loggedData - (DialogModel.clonePaymentInitial loggedData.translations currentDate payment) + (AddPayment.initialClone loggedData.translations currentDate payment) "ClonePayment" (FontAwesome.clone Color.chestnutRose 18) (Just (getMessage "Clone" loggedData.translations)) @@ -117,11 +116,11 @@ paymentLine loggedData homeModel frequency payment = then text "" else - AddPaymentButton.view + AddPayment.button loggedData - (DialogModel.editPaymentInitial loggedData.translations payment) + (AddPayment.initialEdit loggedData.translations payment) "EditPayment" - (FontAwesome.edit Color.chestnutRose 18) + (FontAwesome.pencil Color.chestnutRose 18) (Just (getMessage "Edit" loggedData.translations)) ] , div -- cgit v1.2.3