from saurik import * def stars(label, name, value, options): print '
' print '' % cgi.escape(label, False) print '' print '
' def main(): form = cgi.FieldStorage() path = os.environ["PATH_INFO"] package_id = form.getfirst("package") uri = path + urllib.quote_plus('?package=' + package_id) + '*' package = Package.get_by_primary_key(package_id) user, account, device = auth() review = Review.get_by_primary_key(package_id, account) if package else None if review: title = review.title concept = review.concept reality = review.reality comment = review.comment else: title = "" concept = -1 reality = -1 comment = "" head('Add Review', ['menes/menes', 'menes/iphone', 'appspot/review'], ['menes/style']) print '' print '
' print '' % cgi.escape(package_id, True) print '' print '' print '
' # XXX: this has complicated (and incorrect, fuck you Google), escaping print '' % users.create_logout_url(uri) print '' print '
%s
' % account.key().id(), cgi.escape(user.nickname(), False) print '
' print '
' print '' print '' % cgi.escape(title, True) print '
' stars('Concept', 'concept', concept, ['Lame', None, None, None, None, 'Ingenious']) stars('Reality', 'reality', reality, ['Failure', None, None, None, None, 'Flawless']) print '' % cgi.escape(comment, False) print '
' print '
' print '
' foot() saurik(main)