--- /dev/null
+/* Stylesheet for COCANWIKI.
+ * $Id: sitemap.css,v 1.1 2006/08/03 13:52:54 rich Exp $
+ */
+
+ul#sitemap {
+ list-style: none;
+ margin-left: 0px;
+ padding-left: 0px;
+}
+
+ul#sitemap p.content {
+ margin-top: 0px;
+ margin-bottom: 0px;
+ font-size: 0.7em;
+}
+
+ul#sitemap p.info {
+ margin-top: 0px;
+ margin-bottom: 0px;
+ font-size: 0.7em;
+}
+
+ul#sitemap p.info a {
+ color: green;
+ text-decoration: none;
+}
/* Stylesheet for COCANWIKI.
- * $Id: standard.css,v 1.28 2005/12/13 09:05:51 rich Exp $
+ * $Id: standard.css,v 1.29 2006/08/03 13:52:54 rich Exp $
*/
/* Based on the basic stylesheet. */
background: url(/_graphics/wlh.png) center left no-repeat;
}
-/* Sitemap page. */
-ul#sitemap {
- list-style: none;
- margin-left: 0px;
- padding-left: 0px;
-}
-
-ul#sitemap p.content {
- margin-top: 0px;
- margin-bottom: 0px;
- font-size: 0.7em;
-}
-
-ul#sitemap p.info {
- margin-top: 0px;
- margin-bottom: 0px;
- font-size: 0.7em;
-}
-
-ul#sitemap p.info a {
- color: green;
- text-decoration: none;
-}
-
/* Recent changes list. */
ul#recent_changes {
list-style: none;
(* 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/";
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: page.ml,v 1.50 2006/08/03 13:33:15 rich Exp $
+ * $Id: page.ml,v 1.51 2006/08/03 13:52:58 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
let template_404 = get_template dbh hostid "page_404.html" in
(* Host-specific fields. *)
- let rows = PGSQL(dbh)
- "select css is not null, feedback_email is not null, mailing_list, navigation
- from hosts where id = $hostid" in
- let has_host_css, has_feedback_email, mailing_list, navigation =
+ let rows =
+ PGSQL(dbh)
+ "select feedback_email is not null,
+ mailing_list, navigation
+ from hosts where id = $hostid" in
+ let has_feedback_email, mailing_list, navigation =
match rows with
- | [Some has_host_css, Some has_feedback_email,
- mailing_list, navigation] ->
- has_host_css, has_feedback_email, mailing_list, navigation
+ | [Some has_feedback_email, mailing_list, navigation] ->
+ has_feedback_email, mailing_list, navigation
| _ -> assert false in
(* User permissions. *)
t#conditional "redirected" false
);
- th#conditional "has_host_css" has_host_css;
th#conditional "has_page_css" has_page_css;
(* Are we showing an old version of the page? If so, warn. *)
if pageid <> None then (
match user with
| User (userid, _, _, _) ->
- PGSQL(dbh)
- "delete from recently_visited
- where hostid = $hostid and userid = $userid and url = $page'";
- PGSQL(dbh)
- "insert into recently_visited (hostid, userid, url)
- values ($hostid, $userid, $page')";
- PGOCaml.commit dbh;
+ (try
+ PGSQL(dbh)
+ "delete from recently_visited
+ where hostid = $hostid and userid = $userid
+ and url = $page'";
+ PGSQL(dbh)
+ "insert into recently_visited (hostid, userid, url)
+ values ($hostid, $userid, $page')";
+ PGOCaml.commit dbh;
+ with
+ exn ->
+ (* Exceptions here are non-fatal. Just print them. *)
+ prerr_endline "exception updating recently_visited:";
+ prerr_endline (Printexc.to_string exn);
+ PGOCaml.rollback dbh;
+ );
PGOCaml.begin_work dbh;
| _ -> ()
);
<meta name="author" content="http://www.merjis.com/" />
<link rel="stylesheet" href="::theme_css_html_tag::" type="text/css" title="Standard"/>
<link rel="alternate stylesheet" href="/_css/easytoread.css" type="text/css" title="High contrast, big fonts"/>
+::if(has_host_css)::<link rel="stylesheet" href="/_global.css" type="text/css" title="Standard"/>::end::
<link rel="stylesheet" href="/_css/login.css" type="text/css" title="Standard"/>
</head><body>
<meta name="author" content="http://www.merjis.com/" />
<link rel="stylesheet" href="::theme_css_html_tag::" type="text/css" title="Standard"/>
<link rel="alternate stylesheet" href="/_css/easytoread.css" type="text/css" title="High contrast, big fonts"/>
+::if(has_host_css)::<link rel="stylesheet" href="/_global.css" type="text/css" title="Standard"/>::end::
<link rel="stylesheet" href="/_css/login.css" type="text/css" title="Standard"/>
</head><body>
<a href="/_bin/forgot_password_form.cmo">Forgotten your password?</a>
</p>
-<h2>Create an account</h2>
-
::if(create_account_anon)::
+<h2>Create an account</h2>
+
<form method="post" action="/_bin/signup.cmo">
<table class="create">
<meta name="author" content="http://www.merjis.com/" />
<link rel="stylesheet" href="::theme_css_html_tag::" type="text/css" title="Standard"/>
<link rel="alternate stylesheet" href="/_css/easytoread.css" type="text/css" title="High contrast, big fonts"/>
+::if(has_host_css)::<link rel="stylesheet" href="/_global.css" type="text/css" title="Standard"/>::end::
</head><body>
<h1><span>Send an email when the page is updated</span></h1>
<link rel="stylesheet" href="::theme_css_html_tag::" type="text/css" title="Standard"/>
<link rel="stylesheet" href="/_css/search.css" type="text/css" title="Standard"/>
<link rel="alternate stylesheet" href="/_css/easytoread.css" type="text/css" title="High contrast, big fonts"/>
+::if(has_host_css)::<link rel="stylesheet" href="/_global.css" type="text/css" title="Standard"/>::end::
</head><body onload="document.f.q.focus ()">
<h1><span>Search this site</span></h1>
<meta name="author" content="http://www.merjis.com/" />
<link rel="stylesheet" href="::theme_css_html_tag::" type="text/css" title="Standard"/>
<link rel="alternate stylesheet" href="/_css/easytoread.css" type="text/css" title="High contrast, big fonts"/>
+::if(has_host_css)::<link rel="stylesheet" href="/_global.css" type="text/css" title="Standard"/>::end::
</head><body>
<h1><span>Send feedback about this page</span></h1>
<title>Sitemap</title>
<meta name="author" content="http://www.merjis.com/" />
<link rel="stylesheet" href="::theme_css_html_tag::" type="text/css" title="Standard"/>
+<link rel="stylesheet" href="/_css/sitemap.css" type="text/css" title="Standard"/>
<link rel="alternate stylesheet" href="/_css/easytoread.css" type="text/css" title="High contrast, big fonts"/>
+::if(has_host_css)::<link rel="stylesheet" href="/_global.css" type="text/css" title="Standard"/>::end::
</head><body>
<h1><span>Sitemap</span></h1>