Unified homepage between main and tiny scaffolding
This commit is contained in:
parent
8c094f154f
commit
31dd38d103
@ -139,7 +139,7 @@ scaffold = do
|
||||
writeFile' "LICENSE" $(codegen "LICENSE")
|
||||
writeFile' ("Foundation.hs") $ ifTiny $(codegen "tiny/Foundation.hs") $(codegen "Foundation.hs")
|
||||
writeFile' "Application.hs" $ ifTiny $(codegen "tiny/Application.hs") $(codegen "Application.hs")
|
||||
writeFile' "Handler/Root.hs" $ ifTiny $(codegen "tiny/Handler/Root.hs") $(codegen "Handler/Root.hs")
|
||||
writeFile' "Handler/Root.hs" $(codegen "Handler/Root.hs")
|
||||
unless isTiny $ writeFile' "Model.hs" $(codegen "Model.hs")
|
||||
writeFile' "Settings.hs" $ ifTiny $(codegen "tiny/Settings.hs") $(codegen "Settings.hs")
|
||||
writeFile' "Settings/StaticFiles.hs" $(codegen "Settings/StaticFiles.hs")
|
||||
@ -151,7 +151,7 @@ scaffold = do
|
||||
$(codegen "hamlet/boilerplate-layout.hamlet")
|
||||
writeFile' "lucius/normalize.lucius"
|
||||
$(codegen "lucius/normalize.lucius")
|
||||
writeFile' "hamlet/homepage.hamlet" $ ifTiny $(codegen "tiny/hamlet/homepage.hamlet") $(codegen "hamlet/homepage.hamlet")
|
||||
writeFile' "hamlet/homepage.hamlet" $(codegen "hamlet/homepage.hamlet")
|
||||
writeFile' "config/routes" $ ifTiny $(codegen "tiny/config/routes") $(codegen "config/routes")
|
||||
writeFile' "cassius/homepage.cassius" $(codegen "cassius/homepage.cassius")
|
||||
writeFile' "julius/homepage.julius" $(codegen "julius/homepage.julius")
|
||||
|
||||
@ -12,7 +12,6 @@ import Foundation
|
||||
-- inclined, or create a single monolithic file.
|
||||
getRootR :: Handler RepHtml
|
||||
getRootR = do
|
||||
mu <- maybeAuth
|
||||
defaultLayout $ do
|
||||
h2id <- lift newIdent
|
||||
setTitle "~project~ homepage"
|
||||
|
||||
@ -1,13 +1,2 @@
|
||||
<h1>Hello
|
||||
<h2 ##{h2id}>You do not have Javascript enabled.
|
||||
$maybe u <- mu
|
||||
<p
|
||||
You are logged in as #{userIdent $ snd u}. #
|
||||
<a href=@{AuthR LogoutR}>Logout
|
||||
.
|
||||
$nothing
|
||||
<p
|
||||
You are not logged in. #
|
||||
<a href=@{AuthR LoginR}>Login now
|
||||
.
|
||||
|
||||
|
||||
@ -1,18 +0,0 @@
|
||||
{-# LANGUAGE TemplateHaskell, QuasiQuotes, OverloadedStrings #-}
|
||||
module Handler.Root where
|
||||
|
||||
import Foundation
|
||||
|
||||
-- This is a handler function for the GET request method on the RootR
|
||||
-- resource pattern. All of your resource patterns are defined in
|
||||
-- config/routes
|
||||
--
|
||||
-- The majority of the code you will write in Yesod lives in these handler
|
||||
-- functions. You can spread them across multiple files if you are so
|
||||
-- inclined, or create a single monolithic file.
|
||||
getRootR :: Handler RepHtml
|
||||
getRootR = do
|
||||
defaultLayout $ do
|
||||
h2id <- lift newIdent
|
||||
setTitle "~project~ homepage"
|
||||
addWidget $(widgetFile "homepage")
|
||||
@ -1,2 +0,0 @@
|
||||
<h1>Hello
|
||||
<h2 ##{h2id}>You do not have Javascript enabled.
|
||||
@ -26,8 +26,6 @@ extra-source-files:
|
||||
scaffold/tiny/Foundation.hs.cg
|
||||
scaffold/tiny/project.cabal.cg
|
||||
scaffold/tiny/Application.hs.cg
|
||||
scaffold/tiny/hamlet/homepage.hamlet.cg
|
||||
scaffold/tiny/Handler/Root.hs.cg
|
||||
scaffold/tiny/config/routes.cg
|
||||
scaffold/tiny/Settings.hs.cg
|
||||
scaffold/lucius/normalize.lucius.cg
|
||||
|
||||
Loading…
Reference in New Issue
Block a user