Fix comments not hidden in Book details panel when they are turned off via Preferences->Look & Feel->Book Details

This commit is contained in:
Kovid Goyal 2011-12-14 16:03:51 +05:30
parent 2676903fbf
commit dc594ba4c8

View File

@ -56,8 +56,11 @@ def render_html(mi, css, vertical, widget, all_fields=False): # {{{
</body>
<html>
'''%(f, c, css)
fm = getattr(mi, 'field_metadata', field_metadata)
fl = dict(get_field_list(fm))
show_comments = (all_fields or fl.get('comments', True))
comments = u''
if mi.comments:
if mi.comments and show_comments:
comments = comments_to_html(force_unicode(mi.comments))
right_pane = u'<div id="comments" class="comments">%s</div>'%comments