block main
h2.content-heading My profile
.block
.block-content.block-content-full
a.block.block-link-hover2(href="#" data-toggle="modal" data-target="#modal-fadein" type="button")
.block-header
//- h3.block-title.text-center Author of the Month
div(class="block-content block-content-full text-center bg-image" style=(account.backgroundImage))
div
img.img-avatar.img-avatar96.img-avatar-thumb(src=(account.avatar), alt='')
.h5.text-white.push-15-t.push-5 #{account.displayname}
.block-content
.row.items-push.text-center
.col-xs-6.col-xs-offset-3
.push-5
if account.premium
i.fa.fa-bolt.fa-2x(style="color: #FF9800;")
.h5.font-w300.text-muted Premium member
else
i.fa.fa-thumbs-up.fa-2x(style="color: #3c3c3c;")
.h5.font-w300.text-muted Free user
错误:
Unexpected else without if
我通过res.render传递account.premium
为假。除了if / else块之外,帐户对象下的其他所有内容都正常工作。
答案 0 :(得分:2)
缩进很重要。
工作代码:
if account.premium
i.fa.fa-bolt.fa-2x(style="color: #FF9800;")
.h5.font-w300.text-muted Premium member
else
i.fa.fa-thumbs-up.fa-2x(style="color: #3c3c3c;")
.h5.font-w300.text-muted Free user