[% USE scalar %] [% SET comment_count = Post.scalar.comments.count %] [% BLOCK render_comment %] [%- SET format1 = '%Y-%m-%dT%H:%M' format2 = '%b %d, %Y @ %H:%M' -%] [%- USE date -%] [% DEFAULT depth = 1 %] [% SET subcomment_count = Comment.scalar.comments.count %]
- [% SET img_url = Comment.user.image_url || 'images/user-01.png' %]
  [% Comment.user.full_name %]
  [% date.format(Comment.ts,format2) %] [% IF User && User.can_comment %] /Reply [% END %]

  [% Comment.body %]

  [% IF subcomment_count > 0 %]
  [% FOREACH child IN Comment.scalar.comments.all %] [% PROCESS render_comment Comment=child depth = depth + 1 %] [% END %]
  [% END %]
[% END %]

### [% comment_count %] Comments

[% FOREACH child IN Post.scalar.direct_comments.all %] [% PROCESS render_comment Comment=child %] [% END %]

[% IF User %] [% IF User.can_comment %]

### Leave a Comment

Message *
[% END %] [% ELSE %]

### Sign in to Leave a Comment

[% END %]