From a89dc76b6a861f2579ba57b6cbb0bdb341484c45 Mon Sep 17 00:00:00 2001 From: Benjamin Barenblat Date: Sat, 2 Mar 2013 20:44:07 -0500 Subject: Move forum page generation to separate library --- forum/forum.ur | 28 ++++++++++++++++++++++++++++ forum/forum.urs | 19 +++++++++++++++++++ forum/lib.urp | 2 ++ main.ur | 20 ++++---------------- site.urp | 14 ++++++++------ styles.ur | 25 +++++++++++++++++++++++++ styles.urs | 25 +++++++++++++++++++++++++ 7 files changed, 111 insertions(+), 22 deletions(-) create mode 100644 forum/forum.ur create mode 100644 forum/forum.urs create mode 100644 forum/lib.urp create mode 100644 styles.ur create mode 100644 styles.urs 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 + +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 . *) + +open Styles + +fun main () : xbody = + +
+

+ Coming soon! +

+
+
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 + +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 . *) + +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 . *) - -(********************************** 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 () = ) -and forum () = +and forum () = forumWorker Forum.main +and forumWorker (f : unit -> xbody) = return (generic (Some "Forum") {header (make [#Forum] ())} -
-

- Coming soon! -

-
+ {f ()}
) 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 + +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 . *) + +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 + +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 . *) + +style smallCaps + +style siteTitle +style navBar +style active +style content +style footer -- cgit v1.2.3