Mercurial > urweb
comparison demo/more/conference.ur @ 1008:1911e84df461
Move stuff from bulkEdit to meta
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Thu, 22 Oct 2009 11:51:31 -0400 |
parents | d3af9e54c828 |
children | 59097824f19b |
comparison
equal
deleted
inserted
replaced
1007:d3af9e54c828 | 1008:1911e84df461 |
---|---|
1 open Meta | 1 open Meta |
2 | 2 |
3 functor Make(M : sig | 3 functor Make(M : sig |
4 con paper :: {(Type * Type)} | 4 con paper :: {(Type * Type)} |
5 constraint [Id] ~ paper | 5 constraint [Id, Document] ~ paper |
6 val paper : $(map meta paper) | 6 val paper : $(map meta paper) |
7 val paperFolder : folder paper | 7 val paperFolder : folder paper |
8 | 8 |
9 con review :: {(Type * Type)} | 9 con review :: {(Type * Type)} |
10 constraint [Paper, User] ~ review | 10 constraint [Paper, User] ~ review |
16 table user : {Id : int, Nam : string, Password : string, Chair : bool, OnPc : bool} | 16 table user : {Id : int, Nam : string, Password : string, Chair : bool, OnPc : bool} |
17 PRIMARY KEY Id, | 17 PRIMARY KEY Id, |
18 CONSTRAINT Nam UNIQUE Nam | 18 CONSTRAINT Nam UNIQUE Nam |
19 sequence userId | 19 sequence userId |
20 | 20 |
21 con paper = [Id = int] ++ map fst M.paper | 21 con paper = [Id = int, Document = blob] ++ map fst M.paper |
22 table paper : paper | 22 table paper : paper |
23 PRIMARY KEY Id | 23 PRIMARY KEY Id |
24 sequence paperId | 24 sequence paperId |
25 | 25 |
26 con review = [Paper = int, User = int] ++ map fst M.review | 26 con review = [Paper = int, User = int] ++ map fst M.review |
131 | 131 |
132 and main () = | 132 and main () = |
133 m <- main' (); | 133 m <- main' (); |
134 return <xml><body>{m}</body></xml> | 134 return <xml><body>{m}</body></xml> |
135 | 135 |
136 and submit () = return <xml><body> | 136 and submit () = |
137 <h1>Submit a Paper</h1> | 137 let |
138 | 138 fun doSubmit r = return <xml><body> |
139 <form> | 139 MIME type: {[fileMimeType r.Document]}<br/> |
140 {allWidgets M.paper M.paperFolder} | 140 Length: {[blobSize (fileData r.Document)]} |
141 </form> | 141 </body></xml> |
142 </body></xml> | 142 in |
143 return <xml><body> | |
144 <h1>Submit a Paper</h1> | |
145 | |
146 <form> | |
147 {allWidgets M.paper M.paperFolder} | |
148 <b>Paper:</b> <upload{#Document}/><br/> | |
149 <submit value="Submit" action={doSubmit}/> | |
150 </form> | |
151 </body></xml> | |
152 end | |
143 | 153 |
144 end | 154 end |