aboutsummaryrefslogtreecommitdiff
path: root/src/client/View/Payments/Table.elm
diff options
context:
space:
mode:
authorJoris2015-09-05 14:14:25 +0200
committerJoris2015-09-05 14:14:25 +0200
commitcc6a51b5ca03ee1a3b5de7c32dd1324e1053f42a (patch)
treefe60948b87993908f73659c9dbd7ffd96498b7f8 /src/client/View/Payments/Table.elm
parent3b738e0d4cc65f314da7389d4542ec826ba0f454 (diff)
downloadbudget-cc6a51b5ca03ee1a3b5de7c32dd1324e1053f42a.tar.gz
budget-cc6a51b5ca03ee1a3b5de7c32dd1324e1053f42a.tar.bz2
budget-cc6a51b5ca03ee1a3b5de7c32dd1324e1053f42a.zip
Renaming PaymentView to LoggedView
Diffstat (limited to 'src/client/View/Payments/Table.elm')
-rw-r--r--src/client/View/Payments/Table.elm28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/client/View/Payments/Table.elm b/src/client/View/Payments/Table.elm
index 743a8a9..5374c44 100644
--- a/src/client/View/Payments/Table.elm
+++ b/src/client/View/Payments/Table.elm
@@ -15,7 +15,7 @@ import String exposing (append)
import Model exposing (Model)
import Model.User exposing (getUserName)
import Model.Payment exposing (..)
-import Model.View.PaymentView exposing (PaymentView)
+import Model.View.LoggedView exposing (LoggedView)
import Model.Translations exposing (getMessage)
import ServerCommunication as SC exposing (serverCommunications)
@@ -26,8 +26,8 @@ import Update.Payment exposing (..)
import View.Icon exposing (renderIcon)
import View.Date exposing (..)
-paymentsTable : Model -> PaymentView -> Html
-paymentsTable model paymentView =
+paymentsTable : Model -> LoggedView -> Html
+paymentsTable model loggedView =
div
[ class "table" ]
([ div
@@ -38,20 +38,20 @@ paymentsTable model paymentView =
, div [ class "cell date" ] [ renderIcon "calendar" ]
, div [ class "cell" ] []
]
- ] ++ (paymentLines model paymentView))
+ ] ++ (paymentLines model loggedView))
-paymentLines : Model -> PaymentView -> List Html
-paymentLines model paymentView =
- paymentView.payments
+paymentLines : Model -> LoggedView -> List Html
+paymentLines model loggedView =
+ loggedView.payments
|> Dict.toList
|> List.sortBy (\(_, payment) -> Date.toTime payment.creation)
|> List.reverse
- |> List.map (paymentLine model paymentView)
+ |> List.map (paymentLine model loggedView)
-paymentLine : Model -> PaymentView -> PaymentWithId -> Html
-paymentLine model paymentView (id, payment) =
+paymentLine : Model -> LoggedView -> PaymentWithId -> Html
+paymentLine model loggedView (id, payment) =
a
- [ class ("row " ++ (if paymentView.edition == Just id then "edition" else ""))
+ [ class ("row " ++ (if loggedView.edition == Just id then "edition" else ""))
, onClick actions.address (UpdatePayment (ToggleEdit id))
]
[ div [ class "cell category" ] [ text payment.name ]
@@ -59,7 +59,7 @@ paymentLine model paymentView (id, payment) =
, div
[ class "cell user" ]
[ payment.userId
- |> getUserName paymentView.users
+ |> getUserName loggedView.users
|> Maybe.withDefault "−"
|> text
]
@@ -72,11 +72,11 @@ paymentLine model paymentView (id, payment) =
[ class "longDate" ]
[ text (renderLongDate payment.creation model.translations) ]
]
- , if paymentView.me == payment.userId
+ , if loggedView.me == payment.userId
then
div
[ class "cell remove"
- , onClick serverCommunications.address (SC.DeletePayment id payment.userId payment.cost paymentView.currentPage)
+ , onClick serverCommunications.address (SC.DeletePayment id payment.userId payment.cost loggedView.currentPage)
]
[ renderIcon "times" ]
else