Placeholders for wiki and report
This commit is contained in:
parent
2ca0ffdce4
commit
c81b86202a
11 changed files with 116 additions and 9 deletions
|
@ -6,3 +6,5 @@
|
|||
/community CommunityR GET
|
||||
/documentation DocumentationR GET
|
||||
/news NewsR GET
|
||||
/report/#Int ReportR GET
|
||||
/wiki/#Text WikiR GET
|
||||
|
|
|
@ -65,3 +65,9 @@ li = with E.li
|
|||
|
||||
p :: [E.Attribute] -> Html -> Html
|
||||
p = with E.p
|
||||
|
||||
pre :: [E.Attribute] -> Html -> Html
|
||||
pre = with E.pre
|
||||
|
||||
code :: [E.Attribute] -> Html -> Html
|
||||
code = with E.code
|
||||
|
|
10
src/HL/Controller/Report.hs
Normal file
10
src/HL/Controller/Report.hs
Normal file
|
@ -0,0 +1,10 @@
|
|||
-- | Report page controller.
|
||||
|
||||
module HL.Controller.Report where
|
||||
|
||||
import HL.Foundation
|
||||
import HL.View.Report
|
||||
|
||||
-- | Report controller.
|
||||
getReportR :: Int -> Handler Html
|
||||
getReportR year = blaze reportV
|
12
src/HL/Controller/Wiki.hs
Normal file
12
src/HL/Controller/Wiki.hs
Normal file
|
@ -0,0 +1,12 @@
|
|||
-- | Wiki page controller.
|
||||
|
||||
module HL.Controller.Wiki where
|
||||
|
||||
import HL.Foundation
|
||||
import HL.View.Wiki
|
||||
|
||||
import Data.Text (Text)
|
||||
|
||||
-- | Wiki controller.
|
||||
getWikiR :: Text -> Handler Html
|
||||
getWikiR name = blaze wikiV
|
|
@ -5,13 +5,15 @@
|
|||
|
||||
module HL.Dispatch () where
|
||||
|
||||
import HL.Controller.Home
|
||||
import HL.Controller.Reload
|
||||
import HL.Controller.Theme
|
||||
import HL.Controller.Downloads
|
||||
import HL.Controller.Community
|
||||
import HL.Controller.Documentation
|
||||
import HL.Controller.Downloads
|
||||
import HL.Controller.Home
|
||||
import HL.Controller.News
|
||||
import HL.Controller.Reload
|
||||
import HL.Controller.Report
|
||||
import HL.Controller.Theme
|
||||
import HL.Controller.Wiki
|
||||
import HL.Foundation
|
||||
|
||||
mkYesodDispatch "App" resourcesApp
|
||||
|
|
|
@ -18,6 +18,7 @@ module HL.Foundation
|
|||
import HL.Static
|
||||
|
||||
import Control.Concurrent.Chan
|
||||
import Data.Text (Text)
|
||||
import Network.Wai.Logger
|
||||
import System.Log.FastLogger
|
||||
import Yesod
|
||||
|
|
|
@ -16,10 +16,35 @@ documentationV :: Blaze App
|
|||
documentationV =
|
||||
template
|
||||
[(DocumentationR,"Documentation")]
|
||||
(\_ ->
|
||||
(\url ->
|
||||
container
|
||||
(row
|
||||
(span12
|
||||
(do h1 [] "Documentation"
|
||||
h2 [] "Online Resources"
|
||||
p [] "Some stuff here."))))
|
||||
online url
|
||||
report url))))
|
||||
|
||||
online url =
|
||||
do h2 [] "Online Resources"
|
||||
p [] "There are various online resources for learning Haskell; books, \
|
||||
\articles, videos, etc. below are some of the highlights:"
|
||||
|
||||
|
||||
report url =
|
||||
do h2 [] "Language Report"
|
||||
p []
|
||||
(do "The Haskell 2010 language report is available online "
|
||||
a [href (url (ReportR 2010))]
|
||||
"here"
|
||||
".")
|
||||
p []
|
||||
(do "A PDF version is available "
|
||||
a [href "http://haskell.org/definition/haskell2010.pdf"]
|
||||
"here"
|
||||
".")
|
||||
p []
|
||||
"It can also be downloaded as a darcs repository: "
|
||||
p []
|
||||
(pre []
|
||||
(code []
|
||||
"$ darcs get http://darcs.haskell.org/haskell2010-report"))
|
||||
|
|
23
src/HL/View/Report.hs
Normal file
23
src/HL/View/Report.hs
Normal file
|
@ -0,0 +1,23 @@
|
|||
{-# LANGUAGE OverloadedStrings #-}
|
||||
{-# LANGUAGE NoImplicitPrelude #-}
|
||||
|
||||
-- | Report page view.
|
||||
|
||||
module HL.View.Report where
|
||||
|
||||
import HL.Foundation
|
||||
import HL.View.Template
|
||||
|
||||
import Blaze.Prelude
|
||||
import Blaze.Bootstrap
|
||||
|
||||
-- | Report view.
|
||||
reportV :: Blaze App
|
||||
reportV =
|
||||
template
|
||||
[(ReportR 2010,"Report")]
|
||||
(\url ->
|
||||
container
|
||||
(row
|
||||
(span12
|
||||
(do p [] "Insert report here."))))
|
|
@ -69,7 +69,8 @@ navigation cur url =
|
|||
[(DownloadsR,"Downloads")
|
||||
,(CommunityR,"Community")
|
||||
,(DocumentationR,"Documentation")
|
||||
,(NewsR,"News")]))
|
||||
,(NewsR,"News")
|
||||
,(WikiR "","Wiki")]))
|
||||
where item route title = li theclass (a [href (url route)] title)
|
||||
where theclass
|
||||
| Just route == cur = [class_ "active"]
|
||||
|
|
|
@ -30,7 +30,7 @@ main =
|
|||
rule ".wrap"
|
||||
(do background "#ffffff"
|
||||
paddingBottom "2em")
|
||||
rule "p"
|
||||
rule "p,ul,li"
|
||||
(do fontSize "15px")
|
||||
rule "h1"
|
||||
(do marginTop "0.1em"
|
||||
|
|
25
src/HL/View/Wiki.hs
Normal file
25
src/HL/View/Wiki.hs
Normal file
|
@ -0,0 +1,25 @@
|
|||
{-# LANGUAGE OverloadedStrings #-}
|
||||
{-# LANGUAGE NoImplicitPrelude #-}
|
||||
|
||||
-- | Wiki page view.
|
||||
|
||||
module HL.View.Wiki where
|
||||
|
||||
import HL.Foundation
|
||||
import HL.View.Template
|
||||
|
||||
import Blaze.Prelude
|
||||
import Blaze.Bootstrap
|
||||
|
||||
-- | Wiki view.
|
||||
wikiV :: Blaze App
|
||||
wikiV =
|
||||
template
|
||||
[(WikiR "","Wiki")]
|
||||
(\_ ->
|
||||
container
|
||||
(row
|
||||
(span12
|
||||
(do h1 [] "Wiki"
|
||||
p []
|
||||
"Insert wiki here."))))
|
Loading…
Reference in a new issue