aboutsummaryrefslogtreecommitdiff
path: root/client/src/View/Payment/Clone.hs
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/View/Payment/Clone.hs')
-rw-r--r--client/src/View/Payment/Clone.hs46
1 files changed, 23 insertions, 23 deletions
diff --git a/client/src/View/Payment/Clone.hs b/client/src/View/Payment/Clone.hs
index 2fa27f3..56a33d9 100644
--- a/client/src/View/Payment/Clone.hs
+++ b/client/src/View/Payment/Clone.hs
@@ -1,5 +1,5 @@
module View.Payment.Clone
- ( Input(..)
+ ( In(..)
, view
) where
@@ -21,35 +21,35 @@ import qualified Util.Ajax as Ajax
import qualified Util.Reflex as ReflexUtil
import qualified View.Payment.Form as Form
-data Input t = Input
- { _input_show :: Event t ()
- , _input_categories :: [Category]
- , _input_paymentCategories :: Dynamic t [PaymentCategory]
- , _input_payment :: Dynamic t Payment
- , _input_category :: Dynamic t CategoryId
+data In t = In
+ { _in_show :: Event t ()
+ , _in_categories :: [Category]
+ , _in_paymentCategories :: Dynamic t [PaymentCategory]
+ , _in_payment :: Dynamic t Payment
+ , _in_category :: Dynamic t CategoryId
}
-view :: forall t m. MonadWidget t m => Input t -> Modal.Content t m SavedPayment
+view :: forall t m. MonadWidget t m => In t -> Modal.Content t m SavedPayment
view input cancel = do
currentDay <- liftIO $ Time.getCurrentTime >>= TimeUtil.timeToDay
formOutput <- R.dyn $ do
- paymentCategories <- _input_paymentCategories input
- payment <- _input_payment input
- category <- _input_category input
- return . Form.view $ Form.Input
- { Form._input_cancel = cancel
- , Form._input_headerLabel = Msg.get Msg.Payment_CloneLong
- , Form._input_categories = _input_categories input
- , Form._input_paymentCategories = paymentCategories
- , Form._input_name = _payment_name payment
- , Form._input_cost = T.pack . show . _payment_cost $ payment
- , Form._input_date = currentDay
- , Form._input_category = category
- , Form._input_frequency = _payment_frequency payment
- , Form._input_mkPayload = CreatePaymentForm
- , Form._input_ajax = Ajax.post
+ paymentCategories <- _in_paymentCategories input
+ payment <- _in_payment input
+ category <- _in_category input
+ return . Form.view $ Form.In
+ { Form._in_cancel = cancel
+ , Form._in_headerLabel = Msg.get Msg.Payment_CloneLong
+ , Form._in_categories = _in_categories input
+ , Form._in_paymentCategories = paymentCategories
+ , Form._in_name = _payment_name payment
+ , Form._in_cost = T.pack . show . _payment_cost $ payment
+ , Form._in_date = currentDay
+ , Form._in_category = category
+ , Form._in_frequency = _payment_frequency payment
+ , Form._in_mkPayload = CreatePaymentForm
+ , Form._in_ajax = Ajax.post
}
hide <- ReflexUtil.flatten (Form._output_hide <$> formOutput)