* further work on Bootstrapping

This commit is contained in:
"Vincent Ambo ext:(%22) 2013-05-05 19:57:46 +02:00
parent 287f7fda8c
commit 514d2b2777
2 changed files with 56 additions and 45 deletions

View file

@ -123,9 +123,10 @@ renderEntries showAll entries topText footerLinks = [shamlet|
<div .row> <div .row>
<div .span12> <div .span12>
<p> <p>
<span class="innerTitle">#{topText} <span class="innerTitle">
<b>#{topText}
$forall entry <- elist $forall entry <- elist
<div .row > <div .row>
<div .span2> <div .span2>
<a #bar href=#{linkElems entry}> <a #bar href=#{linkElems entry}>
<b>#{title entry} <b>#{title entry}
@ -141,10 +142,9 @@ $forall entry <- elist
^{preEscapedToHtml $ append " " $ btext entry} ^{preEscapedToHtml $ append " " $ btext entry}
$if ((/=) (mtext entry) empty) $if ((/=) (mtext entry) empty)
<p> <p>
<a #foo href=#{linkElems entry}>#{readMore $ lang entry} <a .readmore #foo href=#{linkElems entry}>#{readMore $ lang entry}
$else $else
<br>&nbsp; <br>&nbsp;
<hr>
$maybe links <- footerLinks $maybe links <- footerLinks
^{links} ^{links}
|] |]
@ -174,39 +174,68 @@ showLinks Nothing lang = [shamlet|
renderEntry :: Entry -> Html renderEntry :: Entry -> Html
renderEntry e@Entry{..} = [shamlet| renderEntry e@Entry{..} = [shamlet|
<span class="innerTitle">#{title} <div .row .pusher>
<span class="righttext"> <div .span9>
<i>#{woText} <span .boldify>#{title}
<div class="innerContainer"> <div .span3>
<article> <span .righttext><i>#{woText}</i>
<ul style="max-width:57em;"> <div .row .innerContainer>
<li> <div .span10>
$if (isEntryMarkdown e) <article>
^{renderEntryMarkdown btext} $if (isEntryMarkdown e)
<p>^{renderEntryMarkdown $ mtext} ^{renderEntryMarkdown btext}
$else <p>^{renderEntryMarkdown $ mtext}
^{preEscapedToHtml $ btext} $else
<p>^{preEscapedToHtml $ mtext} ^{preEscapedToHtml $ btext}
<div class="innerBoxComments"> <p>^{preEscapedToHtml $ mtext}
<div class="cHead">#{cHead lang}: <div .row .innerBoxComments>
<ul style="max-width:57em;">#{renderComments comments lang} <div .span10>
^{renderCommentBox lang entryId} <div .boldify>#{cHead lang}:
#{renderComments comments lang}
<div .row .innerBoxComments>
<div .span10>
<div .boldify>#{cwHead lang}
^{renderCommentBox lang entryId}
|] |]
where where
woText = flip T.append author $ T.pack $ formatTime defaultTimeLocale (eTimeFormat lang) edate woText = flip T.append author $ T.pack $ formatTime defaultTimeLocale (eTimeFormat lang) edate
renderComments :: [Comment] -> BlogLang -> Html renderComments :: [Comment] -> BlogLang -> Html
renderComments [] lang = [shamlet|<li>#{noComments lang}|] renderComments [] lang = [shamlet|
<div .row>
<div .span10>#{noComments lang}
|]
renderComments comments lang = [shamlet| renderComments comments lang = [shamlet|
$forall comment <- comments $forall comment <- comments
<li> <div .row>
<i>#{append (cauthor comment) ": "} <div .span1 .commentname>
^{preEscapedToHtml $ ctext comment} <i>#{append (cauthor comment) ": "}
<p class="tt">#{timeString $ cdate comment} <div .span9>
^{preEscapedToHtml $ ctext comment}
<p .tt>#{timeString $ cdate comment}
|] |]
where where
timeString = formatTime defaultTimeLocale (cTimeFormat lang) timeString = formatTime defaultTimeLocale (cTimeFormat lang)
renderCommentBox :: BlogLang -> EntryId -> Html
renderCommentBox cLang cId = [shamlet|
^{captchaOptions cLang}
<div .row>
<div .span10>
<form method="POST" action=#{aLink}>
<fieldset>
<label>
<input .span8 name="cname" placeholder="Name" type="text">
<label>
<textarea .span8 name="ctext" cols="50" rows="13" placeholder=#{cTextPlaceholder cLang}>
^{captcha}
<label>
<input .btn type="submit" value=#{cSend cLang}>
|]
where
aLink = T.concat ["/", show' cLang, "/postcomment/", show' cId]
captcha :: Html captcha :: Html
captcha = [shamlet| captcha = [shamlet|
<div class="cCaptcha"> <div class="cCaptcha">
@ -223,24 +252,6 @@ captchaOptions lang = [shamlet|<script type="text/javascript">^{preEscapedToHtml
where where
options = T.concat ["var RecaptchaOptions = { theme: 'clean', lang: '", showLangText lang, "'};"] options = T.concat ["var RecaptchaOptions = { theme: 'clean', lang: '", showLangText lang, "'};"]
renderCommentBox :: BlogLang -> EntryId -> Html
renderCommentBox cLang cId = [shamlet|
<div class="cHead">#{cwHead cLang}
^{captchaOptions cLang}
<form method="POST" action=#{aLink}>
<p><input name="cname" placeholder="Name" class="cInput">
<p>
<label>
<textarea name="ctext" cols="50" rows="13" class="cInput" placeholder=#{cTextPlaceholder cLang}>
<p>
<label>
^{captcha}
<p><input class="cInput" style="width:120px;" type="submit" value=#{cSend cLang}>
|]
where
aLink = T.concat ["/", show' cLang, "/postcomment/", show' cId]
showSiteNotice :: Html showSiteNotice :: Html
showSiteNotice = [shamlet| showSiteNotice = [shamlet|
$doctype 5 $doctype 5

View file

@ -160,5 +160,5 @@ rightText EN = "Deutsche Version <a href=\"/de\" class=\"link\">hier verf&uuml;g
-- static information -- static information
repoURL :: Text = "https://bitbucket.org/tazjin/tazblog-haskell" repoURL :: Text = "https://bitbucket.org/tazjin/tazblog-haskell"
mailTo :: Text = "mailto:tazjin@gmail.com" mailTo :: Text = "mailto:tazjin+blog@gmail.com"
twitter :: Text = "http://twitter.com/#!/tazjin" twitter :: Text = "http://twitter.com/#!/tazjin"