$def with(work, reader_observations, key)
$if reader_observations['total_respondents']:
$ total_reviews = reader_observations['total_respondents']
$else:
$ total_reviews = 0
$_('Community Reviews') ($total_reviews)
$if total_reviews > 0:
$for o in reader_observations['observations']:
$ total = o['total_respondents_for_type']
$o['label'] ($total)
$for v in o['values']:
$ percentage = (v['count'] / total) * 100
$v['value']
$int(percentage)%
$else:
$_('No community reviews have been submitted for this work.')
$if ctx.user:
$:macros.ObservationsModal(work, _('+ Add your community review'), 'stats', 'stats-link')
$else:
$_('Log in to add your review')