$def with(work, edition, reader_observations, work_title, key)

$_('Reader Observations')

$work_title
$if reader_observations['total_respondents']:

$:ungettext('Based on observations from %(count)s patron', 'Based on observations from %(count)s patrons', reader_observations['total_respondents'], count=reader_observations['total_respondents']).

$for o in reader_observations['observations']: $ total = o['total_respondents_for_type']

$o['description']

$:ungettext('One person responded:', '%(count)d people responded:', total, count=total)

$for v in o['values']: $ percentage = (v['count'] / total) * 100 $v['value'].capitalize(): $v['count'] ($int(percentage)%)

$else:
$_('No community observations have been submitted for this work.')
$_('Click the link below to share your observations.')

$if ctx.user: $:macros.ObservationsModal(work, _('Add your observations'), 'stats', 'stats-link') $else: $_('Log in to add your observations')