diff options
author | Joris | 2016-06-19 01:00:53 +0200 |
---|---|---|
committer | Joris | 2016-06-19 01:00:53 +0200 |
commit | fb5629d7f705b7e80dcf1852da58d2864c2b0d25 (patch) | |
tree | e9e0d0db119b6f7c2b240226f03ff2d6218070ed /src/client/elm/LoggedIn/Stat/Account | |
parent | 9716f77d14ef43f96a1534d97bb9d336df1882be (diff) |
Show payment count and sum right after search
Diffstat (limited to 'src/client/elm/LoggedIn/Stat/Account')
-rw-r--r-- | src/client/elm/LoggedIn/Stat/Account/View.elm | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/client/elm/LoggedIn/Stat/Account/View.elm b/src/client/elm/LoggedIn/Stat/Account/View.elm new file mode 100644 index 0000000..3eb5ef4 --- /dev/null +++ b/src/client/elm/LoggedIn/Stat/Account/View.elm @@ -0,0 +1,38 @@ +module LoggedIn.Stat.Account.View exposing + ( view + ) + +import Html exposing (..) +import Html.Attributes exposing (..) + +import Msg exposing (Msg) + +import LoggedData exposing (LoggedData) + +import LoggedIn.View.Format as Format + +import Model exposing (Model) +import Model.User exposing (getUserName) +import Model.Payer exposing (..) + +view : LoggedData -> Html Msg +view loggedData = + ul + [ class "exceedingPayers" ] + (List.map (exceedingPayer loggedData) (getOrderedExceedingPayers loggedData.currentTime loggedData.users loggedData.incomes loggedData.payments)) + +exceedingPayer : LoggedData -> ExceedingPayer -> Html Msg +exceedingPayer loggedData payer = + li + [] + [ span + [ class "userName" ] + [ payer.userId + |> getUserName loggedData.users + |> Maybe.withDefault "−" + |> text + ] + , span + [ class "amount" ] + [ text ("+ " ++ (Format.price loggedData.conf payer.amount)) ] + ] |