aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoris2020-01-30 12:44:40 +0100
committerJoris2020-01-30 12:44:40 +0100
commitf09bcb7119ec0944a7d20927212b71641cf1b5f6 (patch)
treec9855a963bc119a7153628c71c55c631ea1f62fe
parent960fa7cb7ae4c57d01306f78cd349f3a8337d0ab (diff)
Show back refund payments in green
-rw-r--r--client/src/View/Payment/Table.hs4
-rw-r--r--server/src/Design/View/Payment.hs2
2 files changed, 5 insertions, 1 deletions
diff --git a/client/src/View/Payment/Table.hs b/client/src/View/Payment/Table.hs
index bfa0fb9..66065af 100644
--- a/client/src/View/Payment/Table.hs
+++ b/client/src/View/Payment/Table.hs
@@ -115,7 +115,9 @@ cell users categories frequency currency header payment =
R.text $ _payment_name payment
CostHeader ->
- R.text . Format.price currency . _payment_cost $ payment
+ R.divClass (if amount < 0 then "g-Payment__Refund" else "") $
+ R.text $ Format.price currency amount
+ where amount = _payment_cost payment
UserHeader ->
R.text . Maybe.fromMaybe "" . fmap _user_name $ CM.findUser (_payment_user payment) users
diff --git a/server/src/Design/View/Payment.hs b/server/src/Design/View/Payment.hs
index d563f5d..94e4f85 100644
--- a/server/src/Design/View/Payment.hs
+++ b/server/src/Design/View/Payment.hs
@@ -4,6 +4,7 @@ module Design.View.Payment
import Clay
+import qualified Design.Color as Color
import qualified Design.View.Payment.HeaderForm as HeaderForm
import qualified Design.View.Payment.HeaderInfos as HeaderInfos
@@ -11,3 +12,4 @@ design :: Css
design = do
HeaderForm.design
HeaderInfos.design
+ ".g-Payment__Refund" ? color Color.mossGreen