From 5d3a14ec537289416c77cff6b8610991ec463f60 Mon Sep 17 00:00:00 2001 From: Benjamin Barenblat Date: Sat, 27 Apr 2013 17:49:45 -0400 Subject: Forum: More nicely format the list of questions --- forum/forum.css | 37 +++++++++++++++++++++++++++++++++++++ forum/forum.ur | 13 +++++++++++-- forum/lib.urp | 3 +++ site.css | 3 ++- template.ur | 1 + 5 files changed, 54 insertions(+), 3 deletions(-) create mode 100644 forum/forum.css diff --git a/forum/forum.css b/forum/forum.css new file mode 100644 index 0000000..1250be2 --- /dev/null +++ b/forum/forum.css @@ -0,0 +1,37 @@ + /* forum.css -- 6.947 forum CSS rules + * 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 . */ + +.Forum_questionList { + list-style-type: none; + padding-left: 0; +} + +.Forum_questionList li { + 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%); +} diff --git a/forum/forum.ur b/forum/forum.ur index e742ef9..d017900 100644 --- a/forum/forum.ur +++ b/forum/forum.ur @@ -23,6 +23,9 @@ end) = struct open Styles open Asker +style questionList +style questionMetadata + table question : { Id : int, Title : string, Body : string, @@ -36,7 +39,11 @@ val getName : transaction (option string) = fun prettyPrintQuestion row : xbody = -

{[row.Question.Title]}: {[row.Question.Body]} (asked by {[row.Question.Asker]})

+
  • +

    {[row.Question.Title]}

    + {[row.Question.Body]} + Asked by {[row.Question.Asker]} +
  • fun main () : transaction page = @@ -46,7 +53,9 @@ fun main () : transaction page = Template.generic (Some "Forum")

    All questions:

    - {newestQuestions} +
      + {newestQuestions} +

    Ask a new question:


    diff --git a/forum/lib.urp b/forum/lib.urp index dd3456d..505af96 100644 --- a/forum/lib.urp +++ b/forum/lib.urp @@ -1,4 +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 $/option ../styles diff --git a/site.css b/site.css index b032187..6e1ef28 100644 --- a/site.css +++ b/site.css @@ -21,7 +21,8 @@ /* Base color: black * Background color: white * Highlight color: hsl(10, 90%, 35%); - * Hiding color: hsl(0, 0, 85%) */ + * Mute color: hsl(0, 0%, 65%); + * Hiding color: hsl(0, 0%, 85%) */ html { font-family: "TeX Gyre Pagella", TeXGyrePagella, Palatino, "Palatino Linotype", serif; diff --git a/template.ur b/template.ur index da2cdb3..f731d10 100644 --- a/template.ur +++ b/template.ur @@ -34,6 +34,7 @@ fun generic (pageName : option string) (content : xbody) : xhtml [] [] = {pageTitleTag pageName} + {content} -- cgit v1.2.3