$def with (work, edition=None, redir_url=None, id='') $ 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) $# Empty span is necessary. It displays the filled stars.
$ class_list = "star-messaging" $if not rating: $ class_list = "%s hidden" % (class_list)