summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-11-02 14:14:32 -0500
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-11-02 14:14:32 -0500
commite2d49ed541c49a01cb340908f8b868aa9f21ecae (patch)
tree4bc2cfe2f1ef56ae3b8c48a0790cd486d6ec79f0
parent8f8fb8c27b65401c21289299b9b529b1ec3283c9 (diff)
Preload current assignment status
-rw-r--r--demo/more/bid.ur15
1 files changed, 9 insertions, 6 deletions
diff --git a/demo/more/bid.ur b/demo/more/bid.ur
index 98a48fc4..171dbedb 100644
--- a/demo/more/bid.ur
+++ b/demo/more/bid.ur
@@ -17,20 +17,23 @@ functor Make(M : Conference.INPUT) = struct
val linksForChair =
let
fun assignPapers () =
- tup <- query (SELECT paper.Id, paper.{{M.paper}}, user.Id, user.Nam, bid.Interest
+ tup <- query (SELECT paper.Id, paper.{{M.paper}}, user.Id, user.Nam, bid.Interest, assignment.User
FROM paper JOIN bid ON bid.Paper = paper.Id
JOIN user ON bid.User = user.Id
+ LEFT JOIN assignment ON assignment.Paper = paper.Id AND assignment.User = user.Id
ORDER BY paper.Id, bid.Interest, user.Nam)
(fn r (paper, int, acc, ints, papers) =>
if (case paper of None => False | Some r' => r'.Id = r.Paper.Id) then
if int = r.Bid.Interest then
- return (paper, int, (r.User.Id, r.User.Nam) :: acc, ints, papers)
+ return (paper, int, (r.User.Id, r.User.Nam, Option.isSome r.Assignment.User) :: acc,
+ ints, papers)
else
- return (paper, r.Bid.Interest, (r.User.Id, r.User.Nam) :: [],
+ return (paper, r.Bid.Interest, (r.User.Id, r.User.Nam,
+ Option.isSome r.Assignment.User) :: [],
(int, acc) :: ints, papers)
else
return (Some r.Paper, r.Bid.Interest,
- (r.User.Id, r.User.Nam) :: [], [],
+ (r.User.Id, r.User.Nam, Option.isSome r.Assignment.User) :: [], [],
case paper of
None => papers
| Some r => (r.Id, r -- #Id, (int, acc) :: ints) :: papers))
@@ -44,8 +47,8 @@ functor Make(M : Conference.INPUT) = struct
ints <- List.mapM (fn (int, users) =>
cg <- CheckGroup.create
(List.mp
- (fn (id, nam) => (id, txt nam,
- False))
+ (fn (id, nam, sel) =>
+ (id, txt nam, sel))
users);
ex <- Expandable.create
(CheckGroup.render cg);