Don't show stats on uninhabited locations
authoradamch <adamch>
Thu, 13 Oct 2005 14:54:02 +0000 (14:54 +0000)
committeradamch <adamch>
Thu, 13 Oct 2005 14:54:02 +0000 (14:54 +0000)
static/gen.sml
support.sml

index 5795af3..326212f 100644 (file)
@@ -238,16 +238,17 @@ fun generate () =
                                val id = C.intFromSql id
                                val name = C.stringFromSql name
                            in
-                               TextIO.output (outf, "<li> ");
-                               TextIO.output (outf, Web.html name);
                                case NM.find (res, id) of
                                    NONE => ()
-                                 | SOME n => (TextIO.output (outf, " (");
-                                              TextIO.output (outf, Int.toString n);
-                                              TextIO.output (outf, ")"));
-                               TextIO.output (outf, "</li>\n<ul>\n");
-                               locationTree (SOME id);
-                               TextIO.output (outf, "</ul>\n")
+                                 | SOME n =>
+                                   (TextIO.output (outf, "<li> ");
+                                    TextIO.output (outf, Web.html name);
+                                    TextIO.output (outf, " (");
+                                    TextIO.output (outf, Int.toString n);
+                                    TextIO.output (outf, ")");
+                                    TextIO.output (outf, "</li>\n<ul>\n");
+                                    locationTree (SOME id);
+                                    TextIO.output (outf, "</ul>\n"))
                            end
                          | doOne _ = raise Fail "Bad locationTree row"
                    in
index 48a818d..9c30d24 100644 (file)
@@ -1,4 +1,4 @@
-structure Support :> SUPPORT =
+\structure Support :> SUPPORT =
 struct
 
 open Util Sql Init
@@ -232,7 +232,7 @@ fun unsubscribe {usr, cat} =
     ignore (C.dml (getDb ()) ($`DELETE FROM SupSubscription
                                WHERE usr = ^(C.intToSql usr) AND cat = ^(C.intToSql cat)`))
 
-val okChars = [#" ", #"-", #".", #"!", #"?", #":", #";", #"'", #"\""]
+val okChars = [#" ", #"-", #".", #"!", #"?", #":", #";", #"'", #"\"", #"/"]
 
 fun validTitle s = CharVector.exists (fn ch => not (Char.isSpace ch)) s
                   andalso CharVector.all (fn ch => Char.isAlphaNum ch orelse List.exists (fn ch' => ch = ch') okChars) s