Skip to content

Commit

Permalink
The "Comments" header is now only displayed if there are actually com…
Browse files Browse the repository at this point in the history
…ments.
  • Loading branch information
s-ludwig committed May 1, 2012
1 parent 3b287f1 commit 9e1a910
Showing 1 changed file with 23 additions and 26 deletions.
49 changes: 23 additions & 26 deletions views/vibelog.post.dt
Expand Up @@ -18,28 +18,26 @@ block body
!= post.renderContentAsHtml()

footer
| Posted at #{toRFC822TimeString(post.date)} by #{post.author in users ? users[post.author].name : post.author}
a(href="##comments") #{post.comments.length} comments
- if( post.trackbacks.length > 0 )
a(href="##trackbacks") #{post.trackbacks.length} trackbacks
p Posted at #{toRFC822TimeString(post.date)} by #{post.author in users ? users[post.author].name : post.author}

section.comments
h2#comments Comments

- import vibe.textfilter.html;
- foreach( c; post.comments )
.comment
.commentHeader
- if( c.authorName.length > 0 && c.authorHomepage.length > 0 )
a(href="#{c.authorHomepage}")= c.authorName
- else if( c.authorName.length > 0 )
| #{c.authorName}
- else
| anonymous
- if( c.authorMail.length > 0 )
|!= "<" ~ filterHtmlAllEscape(c.authorMail) ~ ">"
| on #{toRFC822DateString(c.date)}, #{toRFC822TimeString(c.date)}:
.commentContent= c.content
- if( post.comments.length )
h2#comments Comments

- import vibe.textfilter.html;
- foreach( c; post.comments )
.comment
.commentHeader
- if( c.authorName.length > 0 && c.authorHomepage.length > 0 )
a(href="#{c.authorHomepage}")= c.authorName
- else if( c.authorName.length > 0 )
| #{c.authorName}
- else
| anonymous
- if( c.authorMail.length > 0 )
|!= "<" ~ filterHtmlAllEscape(c.authorMail) ~ ">"
| on #{toRFC822DateString(c.date)}, #{toRFC822TimeString(c.date)}:
.commentContent= c.content

- if( post.commentsAllowed )
h2 Post a comment
Expand All @@ -48,21 +46,20 @@ block body
tr
td Name:
td
input(type="text", name="name", size="30")
input(type="text", name="name", size="40")
tr
td eMail:
td
input(type="text", name="email", size="30")
input(type="text", name="email", size="40")
tr
td Homepage:
td
input(type="text", name="homepage", size="30", value="http://")
input(type="text", name="homepage", size="40", value="http://")
tr
td(colspan="2")
textarea(name="message", cols="38", rows="6")
textarea(name="message", cols="47", rows="6")
tr
td
td(colspan="2")
input(type="submit", value="Post")
td
- else
p.error Commenting is currently disabled for this article.

0 comments on commit 9e1a910

Please sign in to comment.