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