$def with (work, edition=None, redir_url=None, id='', show_modal_link=True) $ username = ctx.user and ctx.user.key.split('/')[-1] $ rating = work and username and work.get_users_rating(username) $ edition_key = edition.key if edition else "" $ form_id = "ratingsForm%s" % id
$if redir_url: $ page = query_param('page', '0') $if safeint(page) > 1:
$ NUM_STARS = 5 $for star in range(1, NUM_STARS + 1)
$if show_modal_link:
$if rating: