summaryrefslogtreecommitdiff
path: root/demo/more/conference.ur
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-10-22 11:51:31 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-10-22 11:51:31 -0400
commit34d3f5b515acbe3e83c0f2201253a08c4dea38b6 (patch)
treec5717cddb5c35dac338b88916ed982d2263d9cbc /demo/more/conference.ur
parentd2ddd6abe74aa089e261c051b3ddf6c182dce011 (diff)
Move stuff from bulkEdit to meta
Diffstat (limited to 'demo/more/conference.ur')
-rw-r--r--demo/more/conference.ur28
1 files changed, 19 insertions, 9 deletions
diff --git a/demo/more/conference.ur b/demo/more/conference.ur
index 0a540fa0..b9ade8da 100644
--- a/demo/more/conference.ur
+++ b/demo/more/conference.ur
@@ -2,7 +2,7 @@ open Meta
functor Make(M : sig
con paper :: {(Type * Type)}
- constraint [Id] ~ paper
+ constraint [Id, Document] ~ paper
val paper : $(map meta paper)
val paperFolder : folder paper
@@ -18,7 +18,7 @@ functor Make(M : sig
CONSTRAINT Nam UNIQUE Nam
sequence userId
- con paper = [Id = int] ++ map fst M.paper
+ con paper = [Id = int, Document = blob] ++ map fst M.paper
table paper : paper
PRIMARY KEY Id
sequence paperId
@@ -133,12 +133,22 @@ functor Make(M : sig
m <- main' ();
return <xml><body>{m}</body></xml>
- and submit () = return <xml><body>
- <h1>Submit a Paper</h1>
-
- <form>
- {allWidgets M.paper M.paperFolder}
- </form>
- </body></xml>
+ and submit () =
+ let
+ fun doSubmit r = return <xml><body>
+ MIME type: {[fileMimeType r.Document]}<br/>
+ Length: {[blobSize (fileData r.Document)]}
+ </body></xml>
+ in
+ return <xml><body>
+ <h1>Submit a Paper</h1>
+
+ <form>
+ {allWidgets M.paper M.paperFolder}
+ <b>Paper:</b> <upload{#Document}/><br/>
+ <submit value="Submit" action={doSubmit}/>
+ </form>
+ </body></xml>
+ end
end