blob: ea848b6d56a1b66f27d29597ddbda58035b0682b (
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.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)) ]
]
|