summaryrefslogtreecommitdiff
path: root/demo/more/conference.ur
diff options
context:
space:
mode:
Diffstat (limited to 'demo/more/conference.ur')
-rw-r--r--demo/more/conference.ur26
1 files changed, 21 insertions, 5 deletions
diff --git a/demo/more/conference.ur b/demo/more/conference.ur
index a80f1ab1..e810043b 100644
--- a/demo/more/conference.ur
+++ b/demo/more/conference.ur
@@ -1,5 +1,5 @@
signature INPUT = sig
- con paper :: {(Type * Type)}
+ con paper :: {Type}
constraint [Id, Document] ~ paper
type userId
@@ -10,14 +10,19 @@ signature INPUT = sig
type paperId
val paperId_inj : sql_injectable_prim paperId
- table paper : ([Id = paperId, Document = blob] ++ map fst paper)
+ val paperId_show : show paperId
+ val paperId_read : read paperId
+ table paper : ([Id = paperId, Document = blob] ++ paper)
PRIMARY KEY Id
val checkLogin : transaction (option {Id : userId, Nam : string, Chair : bool, OnPc : bool})
val getLogin : transaction {Id : userId, Nam : string, Chair : bool, OnPc : bool}
+ val getPcLogin : transaction {Id : userId, Nam : string, Chair : bool}
+ val summarizePaper : ctx ::: {Unit} -> [[Body] ~ ctx] => $paper -> xml ([Body] ++ ctx) [] []
end
signature OUTPUT = sig
+ con paper :: {Type}
type userId
type paperId
@@ -45,10 +50,11 @@ functor Make(M : sig
val reviewFolder : folder review
val submissionDeadline : time
- val summarizePaper : $(map fst paper) -> xbody
+ val summarizePaper : ctx ::: {Unit} -> [[Body] ~ ctx] => $(map fst paper) -> xml ([Body] ++ ctx) [] []
- functor Make (M : INPUT where con paper = paper)
- : OUTPUT where con userId = M.userId
+ functor Make (M : INPUT where con paper = map fst paper)
+ : OUTPUT where con paper = map fst paper
+ where con userId = M.userId
where con paperId = M.paperId
end) = struct
@@ -92,11 +98,20 @@ functor Make(M : sig
None => error <xml>You must be logged in to do that.</xml>
| Some r => return r
+ val getPcLogin =
+ r <- getLogin;
+ if r.OnPc then
+ return (r -- #OnPc)
+ else
+ error <xml>You are not on the PC.</xml>
+
structure O = M.Make(struct
val user = user
val paper = paper
val checkLogin = checkLogin
val getLogin = getLogin
+ val getPcLogin = getPcLogin
+ val summarizePaper = @@M.summarizePaper
end)
val checkOnPc =
@@ -195,6 +210,7 @@ functor Make(M : sig
{if me.OnPc then
<xml>
<li><a link={all ()}>All papers</a></li>
+ <li><a link={your ()}>Your papers</a></li>
{O.linksForPc}
</xml>
else