42 lines
1.2 KiB
Haskell
42 lines
1.2 KiB
Haskell
module Views where
|
|
|
|
import Core
|
|
|
|
import Data.Text
|
|
import Data.String (fromString)
|
|
import Effectful
|
|
import Lucid
|
|
|
|
baseDoc :: Html () -> Html ()
|
|
baseDoc a = doctypehtml_ $ do
|
|
head_ $ do
|
|
meta_ [ name_ "viewport", content_ "width=device-width, initial-scale=1.0" ]
|
|
title_ "HELPS Template!"
|
|
link_ [rel_ "stylesheet", type_ "text/css", href_ "/style.css"]
|
|
body_ $ do
|
|
main_ [ class_ "container" ] a
|
|
|
|
root :: Html ()
|
|
root = baseDoc $ do
|
|
h1_ "Welcome to HELPS!"
|
|
p_ "Haskell, Effectful, Lucid, PostgreSQL, Servant"
|
|
p_ "You can get started by reviewing the README.md for directions on using \
|
|
\ this template for your own projects."
|
|
|
|
userHtml :: User -> Html ()
|
|
userHtml user = div_ [] $ do
|
|
ul_ $ do
|
|
li_ $ do
|
|
"Username: " >> toHtml (show $ userName user)
|
|
ul_ $ li_ $ "User ID: " >> toHtml (show $ userId user)
|
|
|
|
warning :: String -> Html ()
|
|
warning s = p_ [class_ "warning"] (toHtml s)
|
|
|
|
internalServerError :: Html ()
|
|
internalServerError = baseDoc $ do
|
|
div_ [ style_ "text-align: center; margin: 3% 0 0 0;" ] $ do
|
|
h1_ "500 INTERNAL SERVER ERROR"
|
|
p_ "This issue is probably our fault. \
|
|
\ Please try again shortly or contact us for help."
|