commence implementing cash checks

This commit is contained in:
nek0 2019-12-11 04:12:19 +01:00
parent 35b4b2eb52
commit 096f287ce1
5 changed files with 17 additions and 0 deletions

View File

@ -65,6 +65,8 @@ type UserAPI =
:> Post '[HTML] CashBuyConfirmPage
:<|> "journal" :> QueryParam "page" Word
:> Get '[HTML] JournalPage
:<|> "journal" :> "check"
:> Get '[HTML] JournalCheckPage
:<|> "auth"
:> QueryParam "destination" T.Text
:> Get '[HTML]
@ -95,6 +97,7 @@ type UserAPI =
cashBuyLink :<|>
cashBuyPostLink :<|>
journalLink :<|>
journalCheckLink :<|>
authLink :<|>
authPostLink :<|>
authLogoutLink

View File

@ -66,3 +66,8 @@ journalControl mcookie mpage = do
throwError $
addMessage (fromString $ show othererr) $
redirect303 userSelectLink
journalCheckControl
:: Maybe T.Text
-> UserHandler JournalCheckPage
ournalCheckControl

View File

@ -83,6 +83,7 @@ userApp initState = serveWithContext userApi EmptyContext $
:<|> cashBuyOverviewControl mcookie
:<|> cashBuyPurchaseControl mcookie
:<|> journalControl mcookie
:<|> journalCheckControl mcookie
:<|> authControl mcookie
:<|> authPostControl mcookie
:<|> authLogoutControl mcookie

View File

@ -20,6 +20,8 @@ type BuyConfirmPage = H.Html
type JournalPage = H.Html
type JournalCheckPage = H.Html
type CashBuyOverviewPage = H.Html
type CashBuyConfirmPage = H.Html

View File

@ -77,5 +77,11 @@ journalPage l10n loc mcookie mpage entries =
(show $ linkURI (journalLink (Just $ page + 1)))
)
$ H.toHtml $ translate "Next Page"
H.button
H.! HA.type_ "submit"
H.! HA.formmethod "get"
H.! HA.formaction
("/" <> fromString (show $ linkURI $ journalCheckLink)
$ H.toHtml $ translate "Perform cash check"
where
translate = localize l10n loc . gettext