diff options
author | "Vincent Ambo ext:(%22) <tazjin@gmail.com> | 2013-04-28T21·07+0200 |
---|---|---|
committer | "Vincent Ambo ext:(%22) <tazjin@gmail.com> | 2013-04-28T21·07+0200 |
commit | 9af249c0b25a12c00d04bf9601fbd48c30cddba4 (patch) | |
tree | 518e661e9e30ccc3702552e4293a81bf3ec7dedd /src/Blog.hs | |
parent | 92f4aecbeee38f44b8f842df936d5633613f35a9 (diff) |
* started moving blog to bootstrap, but keeping the design. Currently far from done
Diffstat (limited to 'src/Blog.hs')
-rw-r--r-- | src/Blog.hs | 91 |
1 files changed, 61 insertions, 30 deletions
diff --git a/src/Blog.hs b/src/Blog.hs index 83a70bdfb758..2011a0fb2714 100644 --- a/src/Blog.hs +++ b/src/Blog.hs @@ -42,21 +42,13 @@ markdownCutoff = fromJust $ parseTime defaultTimeLocale "%s" "1367149834" -- blog CSS (admin is still static) -stylesheetSource = $(luciusFile "res/blogstyle.lucius") +stylesheetSource = $(luciusFile "../res/blogbs.lucius") blogStyle = renderCssUrl undefined stylesheetSource --- blog HTML -blogTemplate :: BlogLang -> Text -> Html -> Html -blogTemplate lang t_append body = [shamlet| -$doctype 5 - <head> - <title>#{blogTitle lang t_append} - <link rel="stylesheet" type="text/css" href="/static/blogv34.css" media="all"> - <link rel="alternate" type="application/rss+xml" title="RSS-Feed" href=#{rssUrl}> - <meta http-equiv="content-type" content="text/html;charset=UTF-8"> - <body> +-- <link rel="stylesheet" type="text/css" href="/static/blogv34.css" media="all"> + +{- <div class="header"> - <a class="btitle" href=#{append "/" (show' lang)}>#{blogTitle lang empty} <p style="clear: both;"> <span class="contacts" id="cosx">^{contactInfo} <span class="righttext">^{preEscapedToHtml $ rightText lang} @@ -66,6 +58,36 @@ $doctype 5 ^{showFooter lang $ pack version} <div class="centerbox"> <span style="font-size:17px;font-family:Helvetica;">ಠ_ಠ +-} + +-- blog HTML +blogTemplate :: BlogLang -> Text -> Html -> Html +blogTemplate lang t_append body = [shamlet| +$doctype 5 + <head> + <title>#{blogTitle lang t_append} + <link rel="stylesheet" type="text/css" href="/static/bootstrap.css" media="all"> + <link rel="stylesheet" type="text/css" href="/static/blogv300.css" media="all"> + <link rel="alternate" type="application/rss+xml" title="RSS-Feed" href=#{rssUrl}> + <meta http-equiv="content-type" content="text/html;charset=UTF-8"> + <body> + <div .container .header> + <div .row> + <div .span12 .blogtitle> + <a class="btitle" href=#{append "/" (show' lang)}>#{blogTitle lang empty} + <div .row> + <br> + <div .span6> + <span .contacts #cosx>^{contactInfo} + <div .span6> + <span .righttext>^{preEscapedToHtml $ rightText lang} + <div .container> + ^{body} + <div .container> + <footer> + ^{showFooter lang $ pack version} + <div class="centerbox"> + <span style="font-size:17px;font-family:Helvetica;">ಠ_ಠ |] where rssUrl = T.concat ["/", show' lang, "/rss.xml"] @@ -98,23 +120,32 @@ renderEntryMarkdown = markdown def {msXssProtect = False} . fromStrict renderEntries :: Bool -> [Entry] -> Text -> Maybe Html -> Html renderEntries showAll entries topText footerLinks = [shamlet| -<span class="innerTitle">#{topText} -<div class="innerContainer"> - <ul style="max-width:57em;"> - $forall entry <- elist - <li> - $if (isEntryMarkdown entry) - <a href=#{linkElems entry}>#{linkText $ length $ comments entry} - <b>#{title entry} - ^{renderEntryMarkdown $ append " " $ btext entry} - $else - <a href=#{linkElems entry}>#{linkText $ length $ comments entry} - ^{preEscapedToHtml $ append " " $ btext entry} - $if ((/=) (mtext entry) empty) - <p><a href=#{linkElems entry}>#{readMore $ lang entry} - $else - <br> - $maybe links <- footerLinks +<div .row> + <div .span12> + <p> + <span class="innerTitle">#{topText} +$forall entry <- elist + <div .row > + <div .span2> + <a #bar href=#{linkElems entry}> + <b>#{title entry} + <br> + <i>#{pack $ formatTime defaultTimeLocale "%Y-%M-%d" $ edate entry} + <br> + #{linkText $ length $ comments entry} + #{cHead $ lang entry} + <div .span10> + $if (isEntryMarkdown entry) + ^{renderEntryMarkdown $ append " " $ btext entry} + $else + ^{preEscapedToHtml $ append " " $ btext entry} + $if ((/=) (mtext entry) empty) + <p> + <a #foo href=#{linkElems entry}>#{readMore $ lang entry} + $else + <br> + <hr> +$maybe links <- footerLinks ^{links} |] where @@ -157,7 +188,7 @@ renderEntry e@Entry{..} = [shamlet| ^{preEscapedToHtml $ btext} <p>^{preEscapedToHtml $ mtext} <div class="innerBoxComments"> - <div class="cHead">#{cHead lang} + <div class="cHead">#{cHead lang}: <ul style="max-width:57em;">#{renderComments comments lang} ^{renderCommentBox lang entryId} |] |