diff options
Diffstat (limited to 'src/client/View/Payments/Paging.elm')
-rw-r--r-- | src/client/View/Payments/Paging.elm | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/src/client/View/Payments/Paging.elm b/src/client/View/Payments/Paging.elm index c3db819..b06d749 100644 --- a/src/client/View/Payments/Paging.elm +++ b/src/client/View/Payments/Paging.elm @@ -6,7 +6,7 @@ import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (..) -import Model.View.PaymentView exposing (..) +import Model.View.LoggedView exposing (..) import Model.Payment exposing (perPage) import ServerCommunication as SC exposing (serverCommunications) @@ -19,23 +19,23 @@ import View.Icon exposing (renderIcon) showedPages : Int showedPages = 5 -paymentsPaging : PaymentView -> Html -paymentsPaging paymentView = - let maxPage = ceiling (toFloat paymentView.paymentsCount / toFloat perPage) - pages = truncatePages paymentView.currentPage [1..maxPage] +paymentsPaging : LoggedView -> Html +paymentsPaging loggedView = + let maxPage = ceiling (toFloat loggedView.paymentsCount / toFloat perPage) + pages = truncatePages loggedView.currentPage [1..maxPage] in if maxPage == 1 then text "" else ul [ class "pages" ] - ( ( if paymentView.currentPage > 1 - then [ firstPage, previousPage paymentView ] + ( ( if loggedView.currentPage > 1 + then [ firstPage, previousPage loggedView ] else [] ) - ++ ( List.map (paymentsPage paymentView) pages) - ++ ( if paymentView.currentPage < maxPage - then [ nextPage paymentView, lastPage maxPage ] + ++ ( List.map (paymentsPage loggedView) pages) + ++ ( if loggedView.currentPage < maxPage + then [ nextPage loggedView, lastPage maxPage ] else [] ) ) @@ -62,19 +62,19 @@ firstPage = ] [ renderIcon "fast-backward" ] -previousPage : PaymentView -> Html -previousPage paymentView = +previousPage : LoggedView -> Html +previousPage loggedView = li [ class "page" - , onClick serverCommunications.address (SC.UpdatePage (paymentView.currentPage - 1)) + , onClick serverCommunications.address (SC.UpdatePage (loggedView.currentPage - 1)) ] [ renderIcon "backward" ] -nextPage : PaymentView -> Html -nextPage paymentView = +nextPage : LoggedView -> Html +nextPage loggedView = li [ class "page" - , onClick serverCommunications.address (SC.UpdatePage (paymentView.currentPage + 1)) + , onClick serverCommunications.address (SC.UpdatePage (loggedView.currentPage + 1)) ] [ renderIcon "forward" ] @@ -86,9 +86,9 @@ lastPage maxPage = ] [ renderIcon "fast-forward" ] -paymentsPage : PaymentView -> Int -> Html -paymentsPage paymentView page = - let onCurrentPage = page == paymentView.currentPage +paymentsPage : LoggedView -> Int -> Html +paymentsPage loggedView page = + let onCurrentPage = page == loggedView.currentPage in li [ class ("page" ++ (if onCurrentPage then " current" else "")) , onClick serverCommunications.address <| |