summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Benjamin Barenblat <bbaren@mit.edu>2013-03-02 20:44:07 -0500
committerGravatar Benjamin Barenblat <bbaren@mit.edu>2013-03-02 20:44:07 -0500
commita89dc76b6a861f2579ba57b6cbb0bdb341484c45 (patch)
tree4cfa32f60b7a16a8e1188b56c51183fa62d33117
parent8de6e1df62557daa55fd3eb2a073a7871ddf9768 (diff)
Move forum page generation to separate library
-rw-r--r--forum/forum.ur28
-rw-r--r--forum/forum.urs19
-rw-r--r--forum/lib.urp2
-rw-r--r--main.ur20
-rw-r--r--site.urp14
-rw-r--r--styles.ur25
-rw-r--r--styles.urs25
7 files changed, 111 insertions, 22 deletions
diff --git a/forum/forum.ur b/forum/forum.ur
new file mode 100644
index 0000000..f680ec4
--- /dev/null
+++ b/forum/forum.ur
@@ -0,0 +1,28 @@
+(* Forum -- forum subapp
+Copyright (C) 2013 Benjamin Barenblat <bbaren@mit.edu>
+
+This file is a part of 6.947.
+
+6.947 is is free software: you can redistribute it and/or modify it under the
+terms of the GNU Affero General Public License as published by the Free
+Software Foundation, either version 3 of the License, or (at your option) any
+later version.
+
+6.947 is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+PARTICULAR PURPOSE. See the GNU Affero General Public License for more
+details.
+
+You should have received a copy of the GNU Affero General Public License along
+with 6.947. If not, see <http://www.gnu.org/licenses/>. *)
+
+open Styles
+
+fun main () : xbody =
+ <xml>
+ <div class={content}>
+ <p>
+ Coming soon!
+ </p>
+ </div>
+ </xml>
diff --git a/forum/forum.urs b/forum/forum.urs
new file mode 100644
index 0000000..1dad9a7
--- /dev/null
+++ b/forum/forum.urs
@@ -0,0 +1,19 @@
+(* Forum -- forum subapp
+Copyright (C) 2013 Benjamin Barenblat <bbaren@mit.edu>
+
+This file is a part of 6.947.
+
+6.947 is is free software: you can redistribute it and/or modify it under the
+terms of the GNU Affero General Public License as published by the Free
+Software Foundation, either version 3 of the License, or (at your option) any
+later version.
+
+6.947 is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+PARTICULAR PURPOSE. See the GNU Affero General Public License for more
+details.
+
+You should have received a copy of the GNU Affero General Public License along
+with 6.947. If not, see <http://www.gnu.org/licenses/>. *)
+
+val main : unit -> xbody
diff --git a/forum/lib.urp b/forum/lib.urp
new file mode 100644
index 0000000..9e01f09
--- /dev/null
+++ b/forum/lib.urp
@@ -0,0 +1,2 @@
+../styles
+forum
diff --git a/main.ur b/main.ur
index 03bb2fe..b498861 100644
--- a/main.ur
+++ b/main.ur
@@ -16,16 +16,7 @@ details.
You should have received a copy of the GNU Affero General Public License along
with 6.947. If not, see <http://www.gnu.org/licenses/>. *)
-
-(********************************** Styles ***********************************)
-
-style smallCaps
-
-style siteTitle
-style navBar
-style active (* TODO: Use for active menu items *)
-style content
-style footer
+open Styles
(********************************* Template **********************************)
@@ -107,13 +98,10 @@ and main () =
</div>
</xml>)
-and forum () =
+and forum () = forumWorker Forum.main
+and forumWorker (f : unit -> xbody) =
return (generic (Some "Forum") <xml>
{header (make [#Forum] ())}
- <div class={content}>
- <p>
- Coming soon!
- </p>
- </div>
+ {f ()}
</xml>)
diff --git a/site.urp b/site.urp
index 9f68007..287c010 100644
--- a/site.urp
+++ b/site.urp
@@ -4,12 +4,14 @@ allow url //www.youtube.com/watch?v=OyRW9uFSmh0
allow url //bbaren.scripts.mit.edu/urweb/6.947/site.css
allow url //web.mit.edu/6.115/www/
allow url //gnu.org/licenses/agpl
-rewrite style Main/smallCaps smallCaps
-rewrite style Main/siteTitle siteTitle
-rewrite style Main/navBar navBar
-rewrite style Main/active active
-rewrite style Main/content content
-rewrite style Main/footer footer
+rewrite style Styles/smallCaps smallCaps
+rewrite style Styles/siteTitle siteTitle
+rewrite style Styles/navBar navBar
+rewrite style Styles/active active
+rewrite style Styles/content content
+rewrite style Styles/footer footer
library meta
+library forum
+styles
main
diff --git a/styles.ur b/styles.ur
new file mode 100644
index 0000000..7c61ac2
--- /dev/null
+++ b/styles.ur
@@ -0,0 +1,25 @@
+(* Styles -- CSS styles
+Copyright (C) 2013 Benjamin Barenblat <bbaren@mit.edu>
+
+This file is a part of 6.947.
+
+6.947 is is free software: you can redistribute it and/or modify it under the
+terms of the GNU Affero General Public License as published by the Free
+Software Foundation, either version 3 of the License, or (at your option) any
+later version.
+
+6.947 is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+PARTICULAR PURPOSE. See the GNU Affero General Public License for more
+details.
+
+You should have received a copy of the GNU Affero General Public License along
+with 6.947. If not, see <http://www.gnu.org/licenses/>. *)
+
+style smallCaps
+
+style siteTitle
+style navBar
+style active
+style content
+style footer
diff --git a/styles.urs b/styles.urs
new file mode 100644
index 0000000..7c61ac2
--- /dev/null
+++ b/styles.urs
@@ -0,0 +1,25 @@
+(* Styles -- CSS styles
+Copyright (C) 2013 Benjamin Barenblat <bbaren@mit.edu>
+
+This file is a part of 6.947.
+
+6.947 is is free software: you can redistribute it and/or modify it under the
+terms of the GNU Affero General Public License as published by the Free
+Software Foundation, either version 3 of the License, or (at your option) any
+later version.
+
+6.947 is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+PARTICULAR PURPOSE. See the GNU Affero General Public License for more
+details.
+
+You should have received a copy of the GNU Affero General Public License along
+with 6.947. If not, see <http://www.gnu.org/licenses/>. *)
+
+style smallCaps
+
+style siteTitle
+style navBar
+style active
+style content
+style footer