comparison demo/more/decision.ur @ 1030:6bcc1020d5cd

Start of Decision
author Adam Chlipala <adamc@hcoop.net>
date Mon, 02 Nov 2009 15:48:06 -0500
parents
children 5dccff15fa62
comparison
equal deleted inserted replaced
1029:53a22f46f377 1030:6bcc1020d5cd
1 val decision = {Nam = "Decision",
2 Initialize = None,
3 Show = fn bo => cdata (case bo of
4 None => "?"
5 | Some True => "Accept"
6 | Some False => "Reject"),
7 Inject = _}
8
9 functor Make(M : sig
10 con paperOther :: {Type}
11 constraint [Id, Decision] ~ paperOther
12 include Conference.INPUT
13 where con paper = [Decision = option bool] ++ paperOther
14 end) = struct
15 open M
16
17 val linksForChair =
18 let
19 fun makeDecisions () =
20 ps <- queryX (SELECT paper.Id, paper.Decision, paper.{{M.paperOther}}
21 FROM paper
22 ORDER BY paper.Id)
23 (fn r => <xml><tr>
24 <td>{useMore (summarizePaper (r.Paper -- #Id))}</td>
25 <td><entry>
26 <hidden{#Paper} value={show r.Paper.Id}/>
27 <select{#Decision}>
28 <option selected={r.Paper.Decision = None}>?</option>
29 <option selected={r.Paper.Decision = Some True}>Accept</option>
30 <option selected={r.Paper.Decision = Some False}>Reject</option>
31 </select></entry></td>
32 </tr></xml>);
33 return <xml><body>
34 <h1>Make acceptance decisions</h1>
35
36 <form><subforms{#Papers}>
37 <table>
38 <tr> <th>Paper</th> <th>Decision</th> </tr>
39 {ps}
40 </table>
41 </subforms></form>
42 </body></xml>
43 in
44 <xml>
45 <li><a link={makeDecisions ()}>Make acceptance decisions</a></li>
46 </xml>
47 end
48
49 val linksForPc = <xml/>
50
51 con yourPaperTables = []
52 constraint [Paper] ~ yourPaperTables
53 fun joinYourPaper [tabs] [paper] [[Paper] ~ tabs] [[Paper] ~ _] [tabs ~ yourPaperTables] [[Id] ~ paper]
54 uid (fi : sql_from_items ([Paper = [Id = paperId] ++ paper] ++ tabs)) = fi
55 end