blob: f2493835d03c58a4fbbb0fca515ef551b3f4b2c8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
module View.Payments.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.PaymentView exposing (PaymentView)
import Model.Translations exposing (getMessage)
exceedingPayers : Model -> PaymentView -> Html
exceedingPayers model paymentView =
div
[ class "exceedingPayers" ]
(List.map (exceedingPayer model paymentView) (getOrderedExceedingPayers paymentView.payers))
exceedingPayer : Model -> PaymentView -> ExceedingPayer -> Html
exceedingPayer model paymentView payer =
div
[ class "exceedingPayer" ]
[ span
[ class "userName" ]
[ payer.userId
|> getUserName paymentView.users
|> Maybe.withDefault "−"
|> text
]
, span
[ class "amount" ]
[ text ("+ " ++ (toString payer.amount) ++ " " ++ (getMessage "MoneySymbol" model.translations)) ]
]
|