nodeclub/views/index.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

25 lines
522 B
HTML

<%- partial('sidebar') %>
<div id="content">
<div class="panel">
<div class="header">
当前话题
</div>
<% if (typeof(topics) !== 'undefined' && topics.length > 0) { %>
<div class="inner no-padding">
<%- partial('topic/list', {
topics: topics,
pages: pages,
current_page: current_page,
base: '/'
}) %>
</div>
<% } else { %>
<div class="inner">
<p>无话题</p>
</div>
<% } %>
</div>
</div>
</div>