diff options
Diffstat (limited to 'src/client/View/LoggedIn/ExceedingPayer.elm')
-rw-r--r-- | src/client/View/LoggedIn/ExceedingPayer.elm | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/client/View/LoggedIn/ExceedingPayer.elm b/src/client/View/LoggedIn/ExceedingPayer.elm new file mode 100644 index 0000000..ea848b6 --- /dev/null +++ b/src/client/View/LoggedIn/ExceedingPayer.elm @@ -0,0 +1,35 @@ +module View.LoggedIn.ExceedingPayer + ( exceedingPayers + ) where + +import Html exposing (..) +import Html.Attributes exposing (..) +import List + +import Model exposing (Model) +import Model.User exposing (getUserName) +import Model.Payers exposing (..) +import Model.View.LoggedInView exposing (LoggedInView) +import Model.Translations exposing (getMessage) + +exceedingPayers : Model -> LoggedInView -> Html +exceedingPayers model loggedInView = + div + [ class "exceedingPayers" ] + (List.map (exceedingPayer model loggedInView) (getOrderedExceedingPayers loggedInView.payers)) + +exceedingPayer : Model -> LoggedInView -> ExceedingPayer -> Html +exceedingPayer model loggedInView payer = + div + [ class "exceedingPayer" ] + [ span + [ class "userName" ] + [ payer.userId + |> getUserName loggedInView.users + |> Maybe.withDefault "−" + |> text + ] + , span + [ class "amount" ] + [ text ("+ " ++ (toString payer.amount) ++ " " ++ (getMessage "MoneySymbol" model.translations)) ] + ] |