Updated README with project goals, started prototyping frontend and added route for primary css dist, added reasonable functionality for requesting a password directly via link as well as patching index DOM when requesting HTML stub from /pw
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
module Core.Configuration ( main ) where
|
||||
|
||||
import Core.Types
|
||||
import Core.Types
|
||||
|
||||
import Dhall
|
||||
|
||||
|
@ -2,11 +2,12 @@ module Core.HTTP ( app ) where
|
||||
|
||||
import Core.Types
|
||||
|
||||
import Core.Templates (renderIndex)
|
||||
import Core.Templates (renderIndex, renderStyle)
|
||||
import Feature.Sharing.HTTP as Sharing
|
||||
|
||||
import Data.Maybe (Maybe (Nothing))
|
||||
import Network.Wai.Middleware.RequestLogger (logStdoutDev)
|
||||
import Web.Scotty.Trans
|
||||
import Web.Scotty.Trans
|
||||
|
||||
app :: PurrApp ()
|
||||
app = do
|
||||
@ -15,7 +16,11 @@ app = do
|
||||
|
||||
-- Core Routes
|
||||
get "/" $ do
|
||||
html $ renderIndex
|
||||
html $ renderIndex "/" Nothing
|
||||
|
||||
get "/style.css" $ do
|
||||
setHeader "Content-Type" "text/css"
|
||||
text renderStyle
|
||||
|
||||
-- Feature Routes
|
||||
Sharing.routes
|
||||
|
@ -1,16 +1,19 @@
|
||||
{-# LANGUAGE QuasiQuotes #-}
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
|
||||
module Core.Templates ( renderIndex ) where
|
||||
|
||||
import qualified Data.Text.Lazy as LT
|
||||
module Core.Templates ( renderIndex, renderStyle ) where
|
||||
|
||||
import Data.Text.Lazy (Text)
|
||||
import Database.MongoDB (Document)
|
||||
import Text.Blaze.Html.Renderer.Text (renderHtml)
|
||||
import Text.Blaze.Html
|
||||
import Text.Cassius (cassiusFile, renderCss)
|
||||
import Text.Hamlet (shamletFile)
|
||||
|
||||
import Prelude
|
||||
|
||||
renderIndex :: LT.Text
|
||||
renderIndex = renderHtml ( $(shamletFile "./views/index.hamlet") )
|
||||
renderIndex :: String -> Maybe String -> Text
|
||||
renderIndex link password = renderHtml ( $(shamletFile "./views/index.hamlet") )
|
||||
|
||||
renderStyle :: Text
|
||||
renderStyle = renderCss ( $(cassiusFile "./views/cassius/style.cassius") "/style.css" )
|
||||
|
Reference in New Issue
Block a user