From c81fa12305caebfb762ac8dbb82c45b37f67f58e Mon Sep 17 00:00:00 2001 From: Artyom Date: Sun, 20 Mar 2016 03:15:20 +0300 Subject: [PATCH] Add a link to the main page on category pages --- src/View.hs | 30 +++++++++++++++++++----------- static/css.css | 1 + 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/src/View.hs b/src/View.hs index d595445..4f26430 100644 --- a/src/View.hs +++ b/src/View.hs @@ -95,6 +95,15 @@ instead of simple renderRoot :: GlobalState -> Maybe Text -> HtmlT IO () renderRoot globalState mbSearchQuery = wrapPage "Aelve Guide" $ do + -- TODO: [very-easy] this header looks bad when the page is narrow, it + -- should be fixed in css.css by adding line-height to it + h1_ "The Haskeller's guide" + noscript_ $ div_ [id_ "noscript-message"] $ + toHtml $ renderMarkdownBlock [text| + You have Javascript disabled! This site works fine without + Javascript, but since all editing needs Javascript to work, + you won't be able to edit anything. + |] renderHelp onPageLoad $ JS.showOrHideHelp (JS.selectId "help", helpVersion) form_ $ do @@ -180,18 +189,7 @@ wrapPage pageTitle page = doctypehtml_ $ do |] body_ $ do - -- TODO: [very-easy] this header looks bad when the page is narrow, it - -- should be fixed in css.css by adding line-height to it - h1_ "The Haskeller's guide" - noscript_ $ div_ [id_ "noscript-message"] $ - toHtml $ renderMarkdownBlock [text| - You have Javascript disabled! This site works fine without - Javascript, but since all editing needs Javascript to work, - you won't be able to edit anything. - |] - page - div_ [id_ "footer"] $ do "made by " >> a_ [href_ "https://artyom.me"] "Artyom" emptySpan "2em" @@ -205,6 +203,16 @@ wrapPage pageTitle page = doctypehtml_ $ do renderCategoryPage :: Category -> HtmlT IO () renderCategoryPage category = wrapPage (category^.title <> " – Aelve Guide") $ do + -- TODO: [very-easy] this header looks bad when the page is narrow, it + -- should be fixed in css.css by adding line-height to it + -- TODO: another absolute link [absolute-links] + h1_ (a_ [href_ "/haskell"] "The Haskeller's guide") + noscript_ $ div_ [id_ "noscript-message"] $ + toHtml $ renderMarkdownBlock [text| + You have Javascript disabled! This site works fine without + Javascript, but since all editing needs Javascript to work, + you won't be able to edit anything. + |] renderCategory category -- TODO: allow archiving items if they are in every way worse than the rest, diff --git a/static/css.css b/static/css.css index fccaa37..c0cc3b9 100644 --- a/static/css.css +++ b/static/css.css @@ -71,6 +71,7 @@ a:visited {color: #B40EB4; text-decoration: none;} a:hover {text-decoration: underline;} a:active {text-decoration: underline;} .text-button > a:visited {color: #008ACE;} +h1 > a:visited {color: #008ACE;} /* for header in category pages */ a.anchor { margin-right: 0.5em;