(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: cocanwiki_template.ml,v 1.7 2006/03/28 18:40:50 rich Exp $
+ * $Id: cocanwiki_template.ml,v 1.8 2006/08/03 13:53:00 rich Exp $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
(* Get standard fields concerning this host from the database. *)
let rows =
PGSQL(dbh) "nullable-results"
- "select h.theme_css, p.name, p.url, h.search_box,
+ "select h.theme_css, h.css is not null,
+ p.name, p.url, h.search_box,
h.brand, h.brand_tagline, h.brand_description,
h.pagebug
from hosts h left outer join powered_by p on h.powered_by = p.id
where h.id = $hostid" in
- let theme_css, powered_by_name, powered_by_url, search_box,
+ let theme_css, has_host_css, powered_by_name, powered_by_url, search_box,
brand, brand_tagline, brand_description, pagebug =
match rows with
| [ row ] -> row
| None -> "/_css/standard.css"
| Some file -> file in
+ let has_host_css =
+ match has_host_css with
+ | Some true -> true
+ | _ -> false in
+
let powered_by_name, powered_by_url =
match powered_by_name, powered_by_url with
| None, None ->
let search_box = match search_box with Some b -> b | _ -> assert false in
template#set "theme_css" theme_css;
+ template#conditional "has_host_css" has_host_css;
template#set "powered_by_name" powered_by_name;
template#set "powered_by_url" powered_by_url;
template#conditional "search_box" search_box;
)
else (* if we have no hostid *) (
template#set "theme_css" "/_css/standard.css";
+ template#conditional "has_host_css" false;
template#set "powered_by_name" (Cocanwiki_version.package ^ " " ^
Cocanwiki_version.version);
template#set "powered_by_url" "http://sandbox.merjis.com/";