Add back old homepage

This commit is contained in:
Michael Snoyman 2014-12-14 08:10:15 +02:00
parent 046d3b6094
commit 66bd8eb752
2 changed files with 17 additions and 7 deletions

View File

@ -13,8 +13,8 @@ import Yesod.GitRepo (grContent)
-- 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.
getHomeR :: Handler Html
getHomeR = contentHelper "Stackage Server" wcHomepage
getHomeR' :: Handler Html
getHomeR' = contentHelper "Stackage Server" wcHomepage
getAuthorsR :: Handler Html
getAuthorsR = contentHelper "Library Authors" wcAuthors
@ -24,8 +24,6 @@ getInstallR = contentHelper "Haskell Installation Instructions" wcInstall
contentHelper :: Html -> (WebsiteContent -> Html) -> Handler Html
contentHelper title accessor = do
windowsLatest <- linkFor "unstable-ghc78hp-inclusive"
restLatest <- linkFor "unstable-ghc78-inclusive"
homepage <- getYesod >>= fmap accessor . liftIO . grContent . websiteContent
defaultLayout $ do
setTitle title
@ -34,7 +32,19 @@ contentHelper title accessor = do
, css_bootstrap_responsive_modified_css
])
toWidget homepage
-- $(widgetFile "homepage")
-- FIXME remove this and switch to above getHomeR' when new homepage is ready
getHomeR :: Handler Html
getHomeR = do
windowsLatest <- linkFor "unstable-ghc78hp-inclusive"
restLatest <- linkFor "unstable-ghc78-inclusive"
defaultLayout $ do
setTitle "Stackage Server"
$(combineStylesheets 'StaticR
[ css_bootstrap_modified_css
, css_bootstrap_responsive_modified_css
])
$(widgetFile "homepage")
where
linkFor name =
do slug <- mkSlug name

View File

@ -17,11 +17,11 @@
<ul .operating-systems>
$maybe win <- windowsLatest
<li>
<a href=@{StackageHomeR win}>
<a href=@{SnapshotR win StackageHomeR}>
Windows & OS X (Haskell Platform-based snapshot)
$maybe rest <- restLatest
<li>
<a href=@{StackageHomeR rest}>
<a href=@{SnapshotR rest StackageHomeR}>
Linux & non-Haskell Platform users
<h2 .how-stackage-works>How Stackage Works