From 514d2b277715392549affb8d0d9cc699242b0172 Mon Sep 17 00:00:00 2001 From: "\"Vincent Ambo ext:(%22)" Date: Sun, 5 May 2013 19:57:46 +0200 Subject: [PATCH] * further work on Bootstrapping --- src/Blog.hs | 99 ++++++++++++++++++++++++++++---------------------- src/Locales.hs | 2 +- 2 files changed, 56 insertions(+), 45 deletions(-) diff --git a/src/Blog.hs b/src/Blog.hs index 2011a0fb2..5919fb8bf 100644 --- a/src/Blog.hs +++ b/src/Blog.hs @@ -123,9 +123,10 @@ renderEntries showAll entries topText footerLinks = [shamlet|

- #{topText} + + #{topText} $forall entry <- elist -

+
#{title entry} @@ -141,10 +142,9 @@ $forall entry <- elist ^{preEscapedToHtml $ append " " $ btext entry} $if ((/=) (mtext entry) empty)

- #{readMore $ lang entry} + #{readMore $ lang entry} $else
  -


$maybe links <- footerLinks ^{links} |] @@ -174,39 +174,68 @@ showLinks Nothing lang = [shamlet| renderEntry :: Entry -> Html renderEntry e@Entry{..} = [shamlet| -#{title} - - #{woText} -
-
-
    -
  • - $if (isEntryMarkdown e) - ^{renderEntryMarkdown btext} -

    ^{renderEntryMarkdown $ mtext} - $else - ^{preEscapedToHtml $ btext} -

    ^{preEscapedToHtml $ mtext} -

    -
    #{cHead lang}: -
      #{renderComments comments lang} - ^{renderCommentBox lang entryId} +
      +
      + #{title} +
      + #{woText} +
      +
      +
      + $if (isEntryMarkdown e) + ^{renderEntryMarkdown btext} +

      ^{renderEntryMarkdown $ mtext} + $else + ^{preEscapedToHtml $ btext} +

      ^{preEscapedToHtml $ mtext} +

      +
      +
      #{cHead lang}: +#{renderComments comments lang} +
      +
      +
      #{cwHead lang} +^{renderCommentBox lang entryId} |] where woText = flip T.append author $ T.pack $ formatTime defaultTimeLocale (eTimeFormat lang) edate renderComments :: [Comment] -> BlogLang -> Html -renderComments [] lang = [shamlet|
    • #{noComments lang}|] +renderComments [] lang = [shamlet| +
      +
      #{noComments lang} +|] renderComments comments lang = [shamlet| $forall comment <- comments -
    • - #{append (cauthor comment) ": "} - ^{preEscapedToHtml $ ctext comment} -

      #{timeString $ cdate comment} +

      +
      + #{append (cauthor comment) ": "} +
      + ^{preEscapedToHtml $ ctext comment} +

      #{timeString $ cdate comment} |] where timeString = formatTime defaultTimeLocale (cTimeFormat lang) +renderCommentBox :: BlogLang -> EntryId -> Html +renderCommentBox cLang cId = [shamlet| +^{captchaOptions cLang} +

      +
      +
      +
      +