diff options
author | Benjamin Barenblat <bbaren@mit.edu> | 2013-04-27 18:04:33 -0400 |
---|---|---|
committer | Benjamin Barenblat <bbaren@mit.edu> | 2013-04-27 18:04:33 -0400 |
commit | e2e9fc3d1885f882df487aec0e01ee543fae3bf6 (patch) | |
tree | 1728c377ef229a0b2a8955936820b505ed04c1af /forum | |
parent | 5d3a14ec537289416c77cff6b8610991ec463f60 (diff) |
Forum: More layout tweaking
Diffstat (limited to 'forum')
-rw-r--r-- | forum/forum.css | 16 | ||||
-rw-r--r-- | forum/forum.ur | 15 | ||||
-rw-r--r-- | forum/lib.urp | 4 |
3 files changed, 23 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 |