aboutsummaryrefslogtreecommitdiff
path: root/src/client/View/Payments/Table.elm
diff options
context:
space:
mode:
authorJoris2015-09-06 12:39:03 +0200
committerJoris2015-09-06 12:39:03 +0200
commite10531ba4e60c8709088798763ae3bae6608f9c9 (patch)
treef1550fab8833f0b31831ebb2e943a51eeaa41ee2 /src/client/View/Payments/Table.elm
parent24633871359ec9fbd63fdfebf79a6351b2792f77 (diff)
downloadbudget-e10531ba4e60c8709088798763ae3bae6608f9c9.tar.gz
budget-e10531ba4e60c8709088798763ae3bae6608f9c9.tar.bz2
budget-e10531ba4e60c8709088798763ae3bae6608f9c9.zip
Show montly payments with an expandable mechanism
Diffstat (limited to 'src/client/View/Payments/Table.elm')
-rw-r--r--src/client/View/Payments/Table.elm27
1 files changed, 15 insertions, 12 deletions
diff --git a/src/client/View/Payments/Table.elm b/src/client/View/Payments/Table.elm
index 4a1ed50..4642f65 100644
--- a/src/client/View/Payments/Table.elm
+++ b/src/client/View/Payments/Table.elm
@@ -21,7 +21,7 @@ import Model.Translations exposing (getMessage)
import ServerCommunication as SC exposing (serverCommunications)
import Update exposing (..)
-import Update.Payment exposing (..)
+import Update.LoggedView exposing (..)
import View.Icon exposing (renderIcon)
import View.Date exposing (..)
@@ -30,15 +30,18 @@ paymentsTable : Model -> LoggedView -> Html
paymentsTable model loggedView =
div
[ class "table" ]
- ([ div
- [ class "header" ]
- [ div [ class "cell category" ] [ renderIcon "shopping-cart" ]
- , div [ class "cell cost" ] [ text (getMessage "MoneySymbol" model.translations) ]
- , div [ class "cell user" ] [ renderIcon "user" ]
- , div [ class "cell date" ] [ renderIcon "calendar" ]
- , div [ class "cell" ] []
- ]
- ] ++ (paymentLines model loggedView))
+ ( headerLine model :: paymentLines model loggedView)
+
+headerLine : Model -> Html
+headerLine model =
+ div
+ [ class "header" ]
+ [ div [ class "cell category" ] [ renderIcon "shopping-cart" ]
+ , div [ class "cell cost" ] [ text (getMessage "MoneySymbol" model.translations) ]
+ , div [ class "cell user" ] [ renderIcon "user" ]
+ , div [ class "cell date" ] [ renderIcon "calendar" ]
+ , div [ class "cell" ] []
+ ]
paymentLines : Model -> LoggedView -> List Html
paymentLines model loggedView =
@@ -50,8 +53,8 @@ paymentLines model loggedView =
paymentLine : Model -> LoggedView -> Payment -> Html
paymentLine model loggedView payment =
a
- [ class ("row " ++ (if loggedView.edition == Just payment.id then "edition" else ""))
- , onClick actions.address (UpdatePayment (ToggleEdit payment.id))
+ [ class ("row " ++ (if loggedView.paymentEdition == Just payment.id then "edition" else ""))
+ , onClick actions.address (UpdateLoggedView (ToggleEdit payment.id))
]
[ div [ class "cell category" ] [ text payment.name ]
, div [ class "cell cost" ] [ text ((toString payment.cost) ++ " " ++ (getMessage "MoneySymbol" model.translations)) ]