Using common modules and templates.
[blog.pm.git] / templates / src / default / include / comments-list
blob916295d93dec39dfc149936571665fe374e07296
1 [% comments = c.helper('Comment').list(post) %]
3 [% FOREACH comment IN comments %]
4 [%- IF loop.first %]
5 <h2><a name="comments">[%
6     c.loc('[quant,_1,comment]',loop.size) %]</a></h2>
8 <ol class="comments">[% END -%]
10 [% IF comment.isauthor %]
11     [% name = BLOCK %][% c.config.author %] ([% c.loc('Author') %])[% END %]
12     [% name_html = name %]
13 [% ELSE %]
14     [% IF comment.openid %]
15         [% name_html = BLOCK %][% openid = c.parse_openid(comment.openid) %]
16 <img src="/static/[% style %]/images/[% openid.type || "openid" %].png" alt="openid"
17     style="vertical-align:middle" /> <a href="[% comment.openid
18     %]">[% openid.name %]</a>
19         [% name = openid.name %]
20         [% END %]
21     [% ELSE %]
22         [% name = (comment.name || c.loc('Anonymous')) %]
23         [% name_html = name %]
24     [% END %]
25 [% END %]
27 <li class="comment[% IF comment.isauthor; "-author"; ELSIF loop.count % 2 != 0;
28 "-even"; END %]" id="comment-[% comment.id %]">
30 <img src="[%
31     c.helper('Gravatar').url(comment.isauthor
32         ? c.config.email
33         : comment.email) %]" alt="[% name | html %]" title="[% name | html %]" class="gravatar" />
35 [% name_html %][%- IF user_is_admin && comment.email %] (<a href="mailto:[% comment.email
36     %]">[% comment.email %]</a>)[% END -%]:
38 [% comment.content | ccode %]
40 <div class="addtime">[% c.helper('Util').datefmt(comment.addtime) %]</div>
42 [% IF user_is_admin -%]
43 <div class="action">
44 <a href="[% uri_comment_delete(comment) %]">[% c.loc('Delete') %]</a>
45 </div>
46 [% END %]
47 </li>
49 [%- IF loop.last %]</ol>[% END -%]
50 [% END %]
52 <h2>[% c.loc('Leave a comment') %]</h2>
54 [% PROCESS 'comment/form.tt2' %]