nodeclub/views/reply/reply2.html
Raven WANG 376925338c 修正无法通过 if (locals.variable) 判定 variable 是否存在的问题
由于partial早在Express 3.x已经是被抛弃的特性,几个middleware包括这里使用的ejs-locals已经无人维护,不建议继续使用
而ejs-locals对于locals对象的处理有问题,有时候不能使用 if (locals.variable) 来判定variable是否存在,只能使用 if (typeof(variable) !== 'undefined')
2014-05-07 14:33:55 +08:00

33 lines
1.5 KiB
HTML

<div class='cell reply2_item' reply_id='<%= reply2._id %>'>
<a class="anchor" id="<%- reply2._id %>"></a>
<div class='author_content'>
<a href="/user/<%= reply2.author.name %>" class="user_avatar">
<img src="<%= reply2.author.avatar_url %>" title="<%= reply2.author.name %>" />
</a>
<div class='user_info'>
<a class='dark reply_author' href="/user/<%= reply2.author.name %>"><%= reply2.author.name %></a>
<a class="reply_time" href="#<%- reply2._id %>"><%= reply2.friendly_create_at %></a>
</div>
<div class='user_action'>
<% if ( typeof(current_user) !== 'undefined' && current_user.is_admin ||
(typeof(current_user) !== 'undefined' && current_user._id.toString() == reply2.author._id.toString())
) { %>
<a href='/reply/<%- reply2._id %>/edit' class='edit_reply_btn'>
<img class='user_icon' src="<%- config.site_static_host %>/public/images/doc_edit_icon&16.png" title='编辑' />
</a>
<a href='javascript:void(0)' class='delete_reply2_btn'>
<img class='user_icon' src="<%- config.site_static_host %>/public/images/trash_icon&16.png" title='删除' />
</a>
<% } %>
<span>
<% if (typeof(current_user) !== 'undefined') { %>
<img class='dark reply2_at_btn' src="<%- config.site_static_host %>/public/images/reply_icon_16.png" title="回复">
<% } %>
</span>
</div>
</div>
<div class='reply_content'>
<%- markdown(reply2.content) %>
</div>
</div>