diff options
-rw-r--r-- | forum/forum.css | 16 | ||||
-rw-r--r-- | forum/forum.ur | 15 | ||||
-rw-r--r-- | forum/lib.urp | 4 | ||||
-rw-r--r-- | site.css | 10 |
4 files changed, 33 insertions, 12 deletions
diff --git a/forum/forum.css b/forum/forum.css index 1250be2..56b0763 100644 --- a/forum/forum.css +++ b/forum/forum.css @@ -18,6 +18,7 @@ .Forum_questionList { list-style-type: none; + margin-top: 0; padding-left: 0; } @@ -25,13 +26,18 @@ margin-bottom: 1em; } -.Forum_questionList h3 { - font-size: 1.15em; - margin: 0; -} - .Forum_questionMetadata { padding-left: 2em; font-style: italic; color: hsl(0, 0%, 65%); } + +.Forum_questionEntryTitle, .Forum_questionEntryBody { + font-family: sans-serif; + font-size: 0.8em; + width: 40em; +} + +.Forum_questionEntryBody { + height: 15em; +} diff --git a/forum/forum.ur b/forum/forum.ur index d017900..6e62b83 100644 --- a/forum/forum.ur +++ b/forum/forum.ur @@ -25,6 +25,8 @@ open Asker style questionList style questionMetadata +style questionEntryTitle +style questionEntryBody table question : { Id : int, Title : string, @@ -47,19 +49,22 @@ fun prettyPrintQuestion row : xbody = </xml> fun main () : transaction page = - newestQuestions <- queryX (SELECT * FROM question) prettyPrintQuestion; + newestQuestions <- queryX (SELECT * FROM question + ORDER BY Question.Id DESC + LIMIT 5) + prettyPrintQuestion; askerOpt <- getName; return ( Template.generic (Some "Forum") <xml> <div class={content}> - <p>All questions:</p> + <h2>Latest questions</h2> <ul class={questionList}> {newestQuestions} </ul> - <p>Ask a new question:</p> + <h2>Ask a new question</h2> <form> - <textbox {#Title} size=80 /><br /> - <textarea {#Body} rows=12 cols=80 /><br /> + <textbox {#Title} placeholder="Title" class={questionEntryTitle} /><br /> + <textarea {#Body} class={questionEntryBody} /><br /> Asking as: <select {#Asker}> {case askerOpt of diff --git a/forum/lib.urp b/forum/lib.urp index 505af96..a45ef70 100644 --- a/forum/lib.urp +++ b/forum/lib.urp @@ -1,7 +1,7 @@ allow url //bbaren.scripts.mit.edu/urweb/6.947-static/forum/forum.css allow env SSL_CLIENT_S_DN_CN -rewrite style Main/Forum/questionList Forum/questionList -rewrite style Main/Forum/questionMetadata Forum/questionMetadata +rewrite style Main/Forum/* Forum/ +rewrite style Main/Forum/ Forum/ $/option ../styles @@ -92,6 +92,16 @@ ul.navBar a:link { border-bottom: none; } +h2 { + font-size: 2.5em; + margin-bottom: 0; +} + +h3 { + font-size: 1.15em; + margin: 0; +} + .content p:first-child:first-letter { color: hsl(0, 90%, 35%); font-size: 3.3em; |