(* Present comments and ratings for a specific wine *) val wid = FormVar.wrapFail FormVar.getNatErr ("wid","internal number") val query = `select comments, fullname, email, rating from rating where wid = ^(Int.toString wid)` val lines = Db.fold (fn (g,r) => let val rating = case Int.fromString (g "rating") of SOME i => i | NONE => raise Fail "Rating not integer" in ` ^(RatingUtil.bottleImgs rating) ^(g "comments") ^(RatingUtil.mailto (g "email") (g "fullname"))` end ^^ r) `` query val body = `
RatingCommentRater` ^^ lines ^^ `

Back to Best Wines` val name = Db.oneField `select name from wine where wid = ^(Int.toString wid)` val _ = RatingUtil.returnPageWithTitle ("Ratings - " ^ name) body