From fb5629d7f705b7e80dcf1852da58d2864c2b0d25 Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 19 Jun 2016 01:00:53 +0200 Subject: Show payment count and sum right after search --- src/server/Design/LoggedIn/Home.hs | 20 ++++++++-------- src/server/Design/LoggedIn/Home/Add.hs | 1 - src/server/Design/LoggedIn/Home/Expandables.hs | 27 ---------------------- src/server/Design/LoggedIn/Home/Monthly.hs | 23 ++++++++++++++++++ src/server/Design/LoggedIn/Home/Search.hs | 11 +++++---- src/server/Design/LoggedIn/Stat.hs | 2 ++ src/server/Model/Message/Key.hs | 2 ++ src/server/Model/Message/Translations.hs | 32 +++++++++++++++++--------- 8 files changed, 65 insertions(+), 53 deletions(-) delete mode 100644 src/server/Design/LoggedIn/Home/Expandables.hs create mode 100644 src/server/Design/LoggedIn/Home/Monthly.hs (limited to 'src/server') diff --git a/src/server/Design/LoggedIn/Home.hs b/src/server/Design/LoggedIn/Home.hs index c0a8566..47bfc84 100644 --- a/src/server/Design/LoggedIn/Home.hs +++ b/src/server/Design/LoggedIn/Home.hs @@ -6,16 +6,16 @@ module Design.LoggedIn.Home import Clay -import qualified Design.LoggedIn.Home.Add as AddDesign -import qualified Design.LoggedIn.Home.Expandables as ExpandablesDesign -import qualified Design.LoggedIn.Home.Search as SearchDesign -import qualified Design.LoggedIn.Home.Table as TableDesign -import qualified Design.LoggedIn.Home.Pages as PagesDesign +import qualified Design.LoggedIn.Home.Add as Add +import qualified Design.LoggedIn.Home.Monthly as Monthly +import qualified Design.LoggedIn.Home.Search as Search +import qualified Design.LoggedIn.Home.Table as Table +import qualified Design.LoggedIn.Home.Pages as Pages design :: Css design = do - form # ".addPayment" ? AddDesign.design - ".expandables" ? ExpandablesDesign.design - ".search" ? SearchDesign.design - ".table" ? TableDesign.design - ".pages" ? PagesDesign.design + form # ".addPayment" ? Add.design + ".monthly" ? Monthly.design + ".search" ? Search.design + ".table" ? Table.design + ".pages" ? Pages.design diff --git a/src/server/Design/LoggedIn/Home/Add.hs b/src/server/Design/LoggedIn/Home/Add.hs index 6856af9..ce64077 100644 --- a/src/server/Design/LoggedIn/Home/Add.hs +++ b/src/server/Design/LoggedIn/Home/Add.hs @@ -15,7 +15,6 @@ import Design.Constants design :: Css design = do centeredWithMargin - marginBottom blockMarginBottom display flex "justify-content" -: "center" diff --git a/src/server/Design/LoggedIn/Home/Expandables.hs b/src/server/Design/LoggedIn/Home/Expandables.hs deleted file mode 100644 index 36ba67d..0000000 --- a/src/server/Design/LoggedIn/Home/Expandables.hs +++ /dev/null @@ -1,27 +0,0 @@ -{-# LANGUAGE OverloadedStrings #-} - -module Design.LoggedIn.Home.Expandables - ( design - ) where - -import Clay - -import Design.Color as Color -import Design.Helper -import Design.Constants - -design :: Css -design = do - - ".expand" ? do - position absolute - right blockPadding - bottom (px 0) - - ".monthlyPayments" ? expandBlock Color.gothic Color.white (px inputHeight) - - ".account" ? do - expandBlock Color.mossGreen Color.white (px inputHeight) - ".userName" ? marginRight (px 10) - - ".detail" |> ".header" ? borderRadius radius radius 0 0 diff --git a/src/server/Design/LoggedIn/Home/Monthly.hs b/src/server/Design/LoggedIn/Home/Monthly.hs new file mode 100644 index 0000000..5e976ef --- /dev/null +++ b/src/server/Design/LoggedIn/Home/Monthly.hs @@ -0,0 +1,23 @@ +{-# LANGUAGE OverloadedStrings #-} + +module Design.LoggedIn.Home.Monthly + ( design + ) where + +import Clay + +import Design.Color as Color +import Design.Helper +import Design.Constants + +design :: Css +design = do + + expandBlock Color.gothic Color.white (px inputHeight) + + ".expand" ? do + position absolute + right blockPadding + bottom (px 0) + + ".detail" |> ".header" ? borderRadius radius radius 0 0 diff --git a/src/server/Design/LoggedIn/Home/Search.hs b/src/server/Design/LoggedIn/Home/Search.hs index 0292eaa..1bc91ef 100644 --- a/src/server/Design/LoggedIn/Home/Search.hs +++ b/src/server/Design/LoggedIn/Home/Search.hs @@ -6,11 +6,14 @@ module Design.LoggedIn.Home.Search import Clay -import Design.Color as Color import Design.Constants -import Design.Helper design :: Css design = do - expandBlock Color.gothic Color.white (px inputHeight) - ".label" ? marginRight (px 10) + marginBottom blockMarginBottom + marginLeft (pct blockPercentMargin) + marginRight (pct blockPercentMargin) + + ".textInput" ? do + display inlineBlock + marginRight (px 30) diff --git a/src/server/Design/LoggedIn/Stat.hs b/src/server/Design/LoggedIn/Stat.hs index ff44a9d..62028cb 100644 --- a/src/server/Design/LoggedIn/Stat.hs +++ b/src/server/Design/LoggedIn/Stat.hs @@ -10,4 +10,6 @@ design :: Css design = do h1 ? paddingBottom (px 0) + ".exceedingPayers" ? ".userName" ? marginRight (px 5) + ".mean" ? marginBottom (em 1.5) diff --git a/src/server/Model/Message/Key.hs b/src/server/Model/Message/Key.hs index 4ef8663..27a93dd 100644 --- a/src/server/Model/Message/Key.hs +++ b/src/server/Model/Message/Key.hs @@ -64,10 +64,12 @@ data Key = | Payment | Payments | SearchText + | Worth -- Statistics | Statistics + | Balance | Overall | ByMonths | By diff --git a/src/server/Model/Message/Translations.hs b/src/server/Model/Message/Translations.hs index c7a2043..55ef97b 100644 --- a/src/server/Model/Message/Translations.hs +++ b/src/server/Model/Message/Translations.hs @@ -240,15 +240,20 @@ m l Payment = English -> "payment" French -> "paiement" +m l Payments = + case l of + English -> "payments" + French -> "paiements" + m l SearchText = case l of English -> "Search" French -> "Recherche" -m l Payments = +m l Worth = case l of - English -> "payments" - French -> "paiements" + English -> "{1} worth {2}" + French -> "{1} valant {2}" -- Statistics @@ -257,6 +262,11 @@ m l Statistics = English -> "Statistics" French -> "Statistiques" +m l Balance = + case l of + English -> "Balance" + French -> "Équilibre" + m l Overall = case l of English -> "Overall" @@ -274,15 +284,15 @@ m l By = m l Mean = case l of - English -> "Mean: {0}" - French -> "En moyenne : {0}" + English -> "Mean: {1}" + French -> "En moyenne : {1}" -- Income m l CumulativeIncomesSince = case l of - English -> "Cumulative incomes since {0}" - French -> "Revenus nets cumulés depuis le {0}" + English -> "Cumulative incomes since {1}" + French -> "Revenus nets cumulés depuis le {1}" m l Income = case l of @@ -338,13 +348,13 @@ m l InvalidInt = m l SmallerIntThan = case l of - English -> "Integer bigger than {0} required" - French -> "Entier supérieur à {0} requis" + English -> "Integer bigger than {1} required" + French -> "Entier supérieur à {1} requis" m l GreaterIntThan = case l of - English -> "Integer smaller than {0} required" - French -> "Entier inférieur à {0} requis" + English -> "Integer smaller than {1} required" + French -> "Entier inférieur à {1} requis" -- Http error -- cgit v1.2.3