$def with (goals) $# Renders a collection of reading goals progress components. $# $# goals : list[YearlyGoal] : Chronological list of yearly goal dictionaries $# YearlyGoal.year : int : The year this goal was set $# YearlyGoal.goal : int : The amount of books desired to be read $# YearlyGoal.books_read : int : The amount of books finished this year $# YearlyGoal.progress : int : Percent of goal achieved
$for goal in goals:
$_("%(year)d Reading Goal:", year=goal.year)
$ completed = 100 if goal.progress > 100 else goal.progress
$ reading_goal_form = render_template('check_ins/reading_goal_form', goal=goal.goal, year=goal.year, update=True) $ id = 'yearly-goal-modal-%d' % loop.index $ title = _('Edit %(year)d Reading Goal', year=goal.year) $:render_template('native_dialog', id, reading_goal_form, title=title)