aboutsummaryrefslogtreecommitdiff
path: root/src/client/elm/View/LoggedIn/Monthly.elm
diff options
context:
space:
mode:
authorJoris2016-03-27 20:20:10 +0200
committerJoris2016-03-27 20:20:10 +0200
commit702d60cbcdf85216a1b18416f4480afb77384e8a (patch)
tree400c004181373255ff0ad40ed32c69674e62ae59 /src/client/elm/View/LoggedIn/Monthly.elm
parent5f6c66e4c3cf02e5b1c0a1fac6036b86be06a992 (diff)
downloadbudget-702d60cbcdf85216a1b18416f4480afb77384e8a.tar.gz
budget-702d60cbcdf85216a1b18416f4480afb77384e8a.tar.bz2
budget-702d60cbcdf85216a1b18416f4480afb77384e8a.zip
Regroup loggedIn modules
Diffstat (limited to 'src/client/elm/View/LoggedIn/Monthly.elm')
-rw-r--r--src/client/elm/View/LoggedIn/Monthly.elm29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/client/elm/View/LoggedIn/Monthly.elm b/src/client/elm/View/LoggedIn/Monthly.elm
index 2e9ff1e..ae7e6bc 100644
--- a/src/client/elm/View/LoggedIn/Monthly.elm
+++ b/src/client/elm/View/LoggedIn/Monthly.elm
@@ -9,22 +9,23 @@ import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)
+import LoggedIn.Action as LoggedInAction
+import LoggedIn.Model as LoggedInModel
+
import Model exposing (Model)
import Model.Payment as Payment exposing (Payments, Payment)
import Model.Translations exposing (getMessage, getParamMessage)
import Model.Action exposing (..)
-import Model.Action.LoggedInAction as LoggedInAction exposing (..)
import Model.Action.MonthlyAction exposing (..)
import Model.View.LoggedIn.Monthly exposing (Monthly)
-import Model.View.LoggedInView exposing (LoggedInView)
import View.Icon exposing (renderIcon)
import View.Expand exposing (..)
import View.Price exposing (price)
-monthlyPayments : Address Action -> Model -> LoggedInView -> Html
-monthlyPayments address model loggedInView =
- let monthly = loggedInView.monthly
+monthlyPayments : Address Action -> Model -> LoggedInModel.Model -> Html
+monthlyPayments address model loggedInModel =
+ let monthly = loggedInModel.monthly
in if List.length monthly.payments == 0
then
text ""
@@ -36,7 +37,7 @@ monthlyPayments address model loggedInView =
]
]
[ monthlyCount address model monthly
- , if monthly.visibleDetail then paymentsTable address model loggedInView monthly else text ""
+ , if monthly.visibleDetail then paymentsTable address model loggedInModel monthly else text ""
]
monthlyCount : Address Action -> Model -> Monthly -> Html
@@ -46,29 +47,29 @@ monthlyCount address model monthly =
key = if count > 1 then "PluralMonthlyCount" else "SingularMonthlyCount"
in button
[ class "header"
- , onClick address (UpdateLoggedIn << UpdateMonthly <| ToggleDetail)
+ , onClick address (UpdateLoggedIn << LoggedInAction.UpdateMonthly <| ToggleDetail)
]
[ text (getParamMessage [toString count, price model total] key model.translations)
, expand ExpandDown monthly.visibleDetail
]
-paymentsTable : Address Action -> Model -> LoggedInView -> Monthly -> Html
-paymentsTable address model loggedInView monthly =
+paymentsTable : Address Action -> Model -> LoggedInModel.Model -> Monthly -> Html
+paymentsTable address model loggedInModel monthly =
div
[ class "table" ]
( monthly.payments
|> List.sortBy (String.toLower << .name)
- |> List.map (paymentLine address model loggedInView)
+ |> List.map (paymentLine address model loggedInModel)
)
-paymentLine : Address Action -> Model -> LoggedInView -> Payment -> Html
-paymentLine address model loggedInView payment =
+paymentLine : Address Action -> Model -> LoggedInModel.Model -> Payment -> Html
+paymentLine address model loggedInModel payment =
a
[ classList
[ ("row", True)
- , ("edition", loggedInView.paymentEdition == Just payment.id)
+ , ("edition", loggedInModel.paymentEdition == Just payment.id)
]
- , onClick address (UpdateLoggedIn (ToggleEdit payment.id))
+ , onClick address (UpdateLoggedIn (LoggedInAction.ToggleEdit payment.id))
]
[ div [ class "cell category" ] [ text (payment.name) ]
, div