summaryrefslogtreecommitdiff
path: root/main.ur
diff options
context:
space:
mode:
authorGravatar Benjamin Barenblat <bbaren@mit.edu>2013-03-16 16:25:45 -0400
committerGravatar Benjamin Barenblat <bbaren@mit.edu>2013-03-16 16:25:45 -0400
commit5b8b76078ca1eb04ad787b1884b1c1e79b2273c8 (patch)
tree88f1e5a960781b16d93ecc63f351c721bf55503f /main.ur
parent963ab32b176228017635e4ef1bb60555c4022142 (diff)
Decouple a bunch of stuff into Config and Template
Diffstat (limited to 'main.ur')
-rw-r--r--main.ur43
1 files changed, 3 insertions, 40 deletions
diff --git a/main.ur b/main.ur
index 1d3483b..7fe5845 100644
--- a/main.ur
+++ b/main.ur
@@ -18,45 +18,8 @@ with 6.947. If not, see <http://www.gnu.org/licenses/>. *)
open Styles
-
-(********************************* Template **********************************)
-
-fun generic (pageName : option string) (content : xbody) : xhtml [] [] =
- let val titleString : string =
- case pageName of
- | None => "6.947 – Functional Programming Project Laboratory"
- | Some s => "6.947 – " ^ s
- in
- <xml>
- <head>
- <title>{[titleString]}</title>
- <link rel="stylesheet" type="text/css" href="//bbaren.scripts.mit.edu/urweb/6.947-static/site.css"/>
- </head>
- <body>
- {content}
- <div class={footer}>
- <p>
- 6.947 is free software: you can redistribute it and/or modify it under the terms of the <a href="//gnu.org/licenses/agpl"><span class={smallCaps}>gnu</span> Affero General Public License</a> as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
- </p>
-
- <p>
- 6.947 is distributed in the hope that it will be useful, but <span class={smallCaps}>without any warranty</span>; without even the implied warranty of <span class={smallCaps}>merchantability</span> or <span class={smallCaps}>fitness for a particular purpose</span>.
- See the <span class={smallCaps}>gnu</span> Affero General Public License for more details.
- </p>
-
- <p>
- You can get the 6.947 source code <a href="file:///afs/athena.mit.edu/user/b/b/bbaren/web_scripts/urweb/6.947/">via AFS</a>.
- </p>
- </div>
- </body>
- </xml>
- end
-
-
-(*********************************** Pages ***********************************)
-
-and main () =
- return (generic None <xml>
+fun main () =
+ return (Template.generic None <xml>
{Menu.header (make [#Main] ())}
<div class={content}>
<p>
@@ -69,7 +32,7 @@ and main () =
and forum () = forumWorker Forum.main
and forumWorker (f : unit -> xbody) =
- return (generic (Some "Forum") <xml>
+ return (Template.generic (Some "Forum") <xml>
{Menu.header (make [#Forum] ())}
{f ()}
</xml>)