From 70754f81d7f5ef402982e27fba6958a30c8d2761 Mon Sep 17 00:00:00 2001 From: "Yann Esposito (Yogsototh)" Date: Sun, 27 Jan 2019 19:30:18 +0100 Subject: [PATCH] register html --- dev.dhall | 8 +++++++- src/Aggreact/Css.hs | 13 +++++++++++++ src/Aggreact/Html.hs | 16 +++++++++++++++- 3 files changed, 35 insertions(+), 2 deletions(-) diff --git a/dev.dhall b/dev.dhall index 46cf01f..91d2300 100644 --- a/dev.dhall +++ b/dev.dhall @@ -11,4 +11,10 @@ let PostgresConfig let DBConf : Type = < SQLite : SQLiteConfig | Postgre : PostgresConfig > -in { port = 3000, db = DBConf.SQLite { filepath = "aggreact.db" } } \ No newline at end of file +in { port = + 3000 + , jwtKeyFilePath = + "jwt.key" + , db = + DBConf.SQLite { filepath = "aggreact.db" } + } \ No newline at end of file diff --git a/src/Aggreact/Css.hs b/src/Aggreact/Css.hs index 4655466..d37d1de 100644 --- a/src/Aggreact/Css.hs +++ b/src/Aggreact/Css.hs @@ -134,6 +134,19 @@ genCss = do display inlineBlock content (stringContent "[-]") cursor pointer + input # ("type" |= "submit") ? do + fontWeight bold + borderBottom solid (px 0) solblue + borderTop solid (px 0) solblue + borderLeft solid (px 0) solblue + borderRight solid (px 0) solblue + backgroundColor base2 + hover & do + backgroundColor base3 + cursor pointer + color base01 + button ? + border solid (px 1) black input # ("type" |= "checkbox") ? display none input # ("type" |= "checkbox") # checked |+ div |> label |> span ? diff --git a/src/Aggreact/Html.hs b/src/Aggreact/Html.hs index 988c489..c44deae 100644 --- a/src/Aggreact/Html.hs +++ b/src/Aggreact/Html.hs @@ -50,7 +50,8 @@ container :: H.Html -> H.Html container = H.div ! A.class_ "container" loginPage :: H.Html -loginPage = +loginPage = do + H.h2 "Login" H.form ! A.action "/login" ! A.method "post" $ do H.label (H.text "username") H.input ! A.name "username" @@ -59,6 +60,19 @@ loginPage = H.input ! A.type_ "password" ! A.name "password" H.br H.input ! A.type_ "submit" ! A.value "Login" + H.hr + H.h2 "Create Account" + H.form ! A.action "/users" ! A.method "post" $ do + H.label (H.text "username") + H.input ! A.name "username" + H.br + H.label (H.text "password") + H.input ! A.type_ "password" ! A.name "password" + H.br + H.label (H.text "email?") + H.input ! A.type_ "email" ! A.name "email" + H.br + H.input ! A.type_ "submit" ! A.value "Create Account" data LoginPage = LoginPage instance H.ToMarkup LoginPage where