From ae6fddcbf400ca5ed0f0c5671f9422f910f4a401 Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 6 Sep 2015 16:50:44 +0200 Subject: Sorting monthly payments by name --- src/client/View/LoggedIn/Monthly.elm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/client/View') diff --git a/src/client/View/LoggedIn/Monthly.elm b/src/client/View/LoggedIn/Monthly.elm index 14c3de7..715288b 100644 --- a/src/client/View/LoggedIn/Monthly.elm +++ b/src/client/View/LoggedIn/Monthly.elm @@ -2,6 +2,8 @@ module View.LoggedIn.Monthly ( monthlyPayments ) where +import String + import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (..) @@ -54,7 +56,10 @@ paymentsTable : Model -> LoggedInView -> Monthly -> Html paymentsTable model loggedInView monthly = div [ class "table" ] - ( List.map (paymentLine model loggedInView) monthly.payments ) + ( monthly.payments + |> List.sortBy (String.toLower << .name) + |> List.map (paymentLine model loggedInView) + ) paymentLine : Model -> LoggedInView -> Payment -> Html paymentLine model loggedInView payment = -- cgit v1.2.3