changeset 1029:53a22f46f377

Seeing others' reviews
author Adam Chlipala <adamc@hcoop.net>
date Mon, 02 Nov 2009 14:22:29 -0500 (2009-11-02)
parents 8b7971e74335
children 6bcc1020d5cd
files demo/more/conference.ur demo/more/conference1.ur demo/more/conferenceFields.ur demo/more/conferenceFields.urs
diffstat 4 files changed, 19 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/demo/more/conference.ur	Mon Nov 02 14:14:32 2009 -0500
+++ b/demo/more/conference.ur	Mon Nov 02 14:22:29 2009 -0500
@@ -348,6 +348,16 @@
                                       FROM review
                                       WHERE review.User = {[me.Id]}
                                         AND review.Paper = {[id]});
+            otherReviews <- queryX (SELECT user.Nam, review.{{map fst M.review}}
+                                    FROM review JOIN user ON review.User = user.Id
+                                    WHERE review.Paper = {[id]}
+                                      AND review.User <> {[me.Id]})
+                            (fn r => <xml>
+                              <hr/>
+                              <b>User:</b> {[r.User.Nam]}<br/>
+                              {allContent M.review r.Review M.reviewFolder}
+                            </xml>);
+
             case ro of
                 None => error <xml>Paper not found!</xml>
               | Some r => return <xml><body>
@@ -384,6 +394,11 @@
                        <submit value="Save" action={saveReview}/>
                      </form>
                    </xml>}
+
+                <hr/>
+                <h2>Other reviews</h2>
+
+                {otherReviews}
               </body></xml>
         end
 
--- a/demo/more/conference1.ur	Mon Nov 02 14:14:32 2009 -0500
+++ b/demo/more/conference1.ur	Mon Nov 02 14:22:29 2009 -0500
@@ -3,7 +3,8 @@
 open Conference.Make(struct
                          val paper = {Title = title,
                                       Abstract = abstract}
-                         val review = {Rating = dropdown "Rating" (#"A" :: #"B" :: #"C" :: #"D" :: [])}
+                         val review = {Rating = dropdown "Rating" (#"A" :: #"B" :: #"C" :: #"D" :: []),
+                                       CommentsForAuthors = commentsForAuthors}
 
                          val submissionDeadline = readError "2009-11-22 23:59:59"
 
--- a/demo/more/conferenceFields.ur	Mon Nov 02 14:14:32 2009 -0500
+++ b/demo/more/conferenceFields.ur	Mon Nov 02 14:22:29 2009 -0500
@@ -2,6 +2,7 @@
 
 val title = string "Title"
 val abstract = textarea "Abstract"
+val commentsForAuthors = textarea "Comments for Authors"
 
 fun charIn s =
     if String.length s = 0 then
--- a/demo/more/conferenceFields.urs	Mon Nov 02 14:14:32 2009 -0500
+++ b/demo/more/conferenceFields.urs	Mon Nov 02 14:22:29 2009 -0500
@@ -1,5 +1,6 @@
 val title : Meta.meta (string, string)
 val abstract : Meta.meta (string, string)
+val commentsForAuthors : Meta.meta (string, string)
 
 con dropdown :: (Type * Type)
 val dropdown : string -> list char -> Meta.meta dropdown