summaryrefslogtreecommitdiff
path: root/demo
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
commit23d8701eaef5c792f0cd385067912c56eab90a9b (patch)
tree4bc2cfe2f1ef56ae3b8c48a0790cd486d6ec79f0 /demo
parente8bcab2b86d2fd26920eef564832db6226d109fc (diff)
Preload current assignment status
Diffstat (limited to 'demo')
-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);