mirror of
https://github.com/cnodejs/nodeclub.git
synced 2025-12-08 19:55:55 +00:00
由于partial早在Express 3.x已经是被抛弃的特性,几个middleware包括这里使用的ejs-locals已经无人维护,不建议继续使用 而ejs-locals对于locals对象的处理有问题,有时候不能使用 if (locals.variable) 来判定variable是否存在,只能使用 if (typeof(variable) !== 'undefined')
25 lines
522 B
HTML
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>
|