From b34609461c778731ffab8806f0b10f283e0d45ee Mon Sep 17 00:00:00 2001 From: rich Date: Mon, 27 Sep 2004 14:41:41 +0000 Subject: [PATCH 01/16] Fixed manifest. --- MANIFEST | 2 -- 1 file changed, 2 deletions(-) diff --git a/MANIFEST b/MANIFEST index 82433a5..e7ec2b4 100644 --- a/MANIFEST +++ b/MANIFEST @@ -48,11 +48,9 @@ scripts/admin/edit_host_css_form.ml scripts/admin/edit_hostnames.ml scripts/admin/edit_hostnames_form.ml scripts/admin/host.ml -scripts/cgi_expires.ml scripts/change_password.ml scripts/change_password_form.ml scripts/cocanwiki.ml -scripts/cocanwiki_cgi_args.ml scripts/cocanwiki_date.ml scripts/cocanwiki_diff.ml scripts/cocanwiki_emailnotify.ml -- 1.8.3.1 From df32ab1d0dd164b73cfa9607797eaf85e0a0154d Mon Sep 17 00:00:00 2001 From: rich Date: Mon, 27 Sep 2004 16:21:09 +0000 Subject: [PATCH 02/16] Added a search box on every page, controlled by a global setting hosts.search_box. Version 1.1.2. Bumped release number. --- Makefile.config | 4 ++-- cocanwiki.sql | 3 ++- debian/changelog | 2 +- html/_css/standard.css | 13 +++++++++++-- scripts/edit_host_settings.ml | 8 +++++--- scripts/edit_host_settings_form.ml | 11 ++++++----- scripts/host_menu.ml | 12 +++++++----- scripts/page.ml | 12 +++++++----- templates/edit_host_settings_form.html | 6 ++++++ templates/host_menu.html | 4 ++++ templates/page.html | 8 ++++++++ 11 files changed, 59 insertions(+), 24 deletions(-) diff --git a/Makefile.config b/Makefile.config index 5adfcf9..07e9b15 100644 --- a/Makefile.config +++ b/Makefile.config @@ -1,7 +1,7 @@ -# $Id: Makefile.config,v 1.4 2004/09/22 12:04:28 rich Exp $ +# $Id: Makefile.config,v 1.5 2004/09/27 16:21:09 rich Exp $ PACKAGE := cocanwiki -VERSION := 1.1.1 +VERSION := 1.1.2 # Normally ignored. However, if you are installing centrally (using # 'make pkg-install'), then the components are installed in the diff --git a/cocanwiki.sql b/cocanwiki.sql index c1101b2..ddd95df 100644 --- a/cocanwiki.sql +++ b/cocanwiki.sql @@ -103,7 +103,8 @@ CREATE TABLE hosts ( theme_css text, feedback_email text, mailing_list boolean DEFAULT false NOT NULL, - is_template boolean DEFAULT false NOT NULL + is_template boolean DEFAULT false NOT NULL, + search_box boolean DEFAULT true NOT NULL ); diff --git a/debian/changelog b/debian/changelog index 826d150..4f91859 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -cocanwiki (1.1.1-5) unstable; urgency=low +cocanwiki (1.1.2-1) unstable; urgency=low * Initial Release. diff --git a/html/_css/standard.css b/html/_css/standard.css index 2327c0b..95b4d13 100644 --- a/html/_css/standard.css +++ b/html/_css/standard.css @@ -1,5 +1,5 @@ /* Stylesheet for COCANWIKI. - * $Id: standard.css,v 1.5 2004/09/24 10:44:55 rich Exp $ + * $Id: standard.css,v 1.6 2004/09/27 16:21:09 rich Exp $ */ body { @@ -241,4 +241,13 @@ table.left_table td.number { span.search_term { background-color: #ff0; border: 1px solid #eeb; -} \ No newline at end of file +} + +/* Search box. */ +div#search_div { + position: absolute; + left: 50%; + width: 49%; + top: 0.95em; + text-align: right; +} diff --git a/scripts/edit_host_settings.ml b/scripts/edit_host_settings.ml index 61a039e..fd85e17 100644 --- a/scripts/edit_host_settings.ml +++ b/scripts/edit_host_settings.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * Copyright (C) 2004 Merjis Ltd. - * $Id: edit_host_settings.ml,v 1.3 2004/09/24 16:30:07 rich Exp $ + * $Id: edit_host_settings.ml,v 1.4 2004/09/27 16:21:09 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 @@ -41,6 +41,7 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid { hostname = hostname } _ = let theme_css = q#param "theme_css" in let feedback_email = q#param "feedback_email" in let mailing_list = q#param_true "mailing_list" in + let search_box = q#param_true "search_box" in let theme_css = if theme_css = "" then `Null else `String theme_css in let feedback_email = @@ -49,10 +50,11 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid { hostname = hostname } _ = (* Update the database. *) let sth = dbh#prepare_cached "update hosts set edit_anon = ?, create_account_anon = ?, theme_css = ?, - feedback_email = ?, mailing_list = ? + feedback_email = ?, mailing_list = ?, + search_box = ? where id = ?" in sth#execute [`Bool edit_anon; `Bool create_account_anon; - theme_css; feedback_email; `Bool mailing_list; + theme_css; feedback_email; `Bool mailing_list; `Bool search_box; `Int hostid]; dbh#commit (); diff --git a/scripts/edit_host_settings_form.ml b/scripts/edit_host_settings_form.ml index ed27bb0..ce92f53 100644 --- a/scripts/edit_host_settings_form.ml +++ b/scripts/edit_host_settings_form.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * Copyright (C) 2004 Merjis Ltd. - * $Id: edit_host_settings_form.ml,v 1.2 2004/09/24 16:30:07 rich Exp $ + * $Id: edit_host_settings_form.ml,v 1.3 2004/09/27 16:21:09 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 @@ -44,24 +44,24 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid _ _ = let sth = dbh#prepare_cached "select canonical_hostname, edit_anon, create_account_anon, theme_css, - feedback_email, mailing_list + feedback_email, mailing_list, search_box from hosts where id = ?" in sth#execute [`Int hostid]; let canonical_hostname, edit_anon, create_account_anon, theme_css, - feedback_email, mailing_list = + feedback_email, mailing_list, search_box = match sth#fetch1 () with [ `String canonical_hostname; `Bool edit_anon; `Bool create_account_anon; (`String _ | `Null) as theme_css; (`String _ | `Null) as feedback_email; - `Bool mailing_list ] -> + `Bool mailing_list; `Bool search_box ] -> let theme_css = match theme_css with `String s -> s | `Null -> "" in let feedback_email = match feedback_email with `String s -> s | `Null -> "" in canonical_hostname, edit_anon, create_account_anon, theme_css, - feedback_email, mailing_list + feedback_email, mailing_list, search_box | _ -> assert false in template#set "canonical_hostname" canonical_hostname; @@ -69,6 +69,7 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid _ _ = template#conditional "create_account_anon" create_account_anon; template#set "feedback_email" feedback_email; template#conditional "mailing_list" mailing_list; + template#conditional "search_box" search_box; (* Themes table. *) let table = diff --git a/scripts/host_menu.ml b/scripts/host_menu.ml index 39f3143..ee67282 100644 --- a/scripts/host_menu.ml +++ b/scripts/host_menu.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * Copyright (C) 2004 Merjis Ltd. - * $Id: host_menu.ml,v 1.2 2004/09/24 16:30:07 rich Exp $ + * $Id: host_menu.ml,v 1.3 2004/09/27 16:21:09 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 @@ -35,21 +35,22 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid _ _ = dbh#prepare_cached "select h.canonical_hostname, h.css is not null, h.edit_anon, h.create_account_anon, h.theme_css is not null, - t.name, t.description, h.feedback_email, h.mailing_list + t.name, t.description, h.feedback_email, h.mailing_list, + h.search_box from hosts h left outer join themes t on h.theme_css = t.theme_css where h.id = ?" in sth#execute [`Int hostid]; let canonical_hostname, has_global_css, edit_anon, create_account_anon, has_theme_css, theme_name, theme_description, has_feedback_email, - feedback_email, mailing_list = + feedback_email, mailing_list, search_box = match sth#fetch1 () with [ `String canonical_hostname; `Bool has_global_css; `Bool edit_anon; `Bool create_account_anon; `Bool has_theme_css; (`String _ | `Null) as theme_name; (`String _ | `Null) as theme_description; (`String _ | `Null) as feedback_email; - `Bool mailing_list ] -> + `Bool mailing_list; `Bool search_box ] -> let theme_name = match theme_name with `String s -> s | `Null -> "" in let theme_description = @@ -60,7 +61,7 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid _ _ = | `Null -> "", false in canonical_hostname, has_global_css, edit_anon, create_account_anon, has_theme_css, theme_name, theme_description, has_feedback_email, - feedback_email, mailing_list + feedback_email, mailing_list, search_box | _ -> assert false in template#set "canonical_hostname" canonical_hostname; @@ -73,6 +74,7 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid _ _ = template#conditional "has_feedback_email" has_feedback_email; template#set "feedback_email" feedback_email; template#conditional "mailing_list" mailing_list; + template#conditional "search_box" search_box; q#template template diff --git a/scripts/page.ml b/scripts/page.ml index c756ae3..f9bb380 100644 --- a/scripts/page.ml +++ b/scripts/page.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * Copyright (C) 2004 Merjis Ltd. - * $Id: page.ml,v 1.22 2004/09/27 12:37:54 rich Exp $ + * $Id: page.ml,v 1.23 2004/09/27 16:21:09 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 @@ -61,13 +61,14 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid {edit_anon=edit_anon} user = (* Host-specific fields. *) let sth = dbh#prepare_cached "select css is not null, feedback_email is not null, - mailing_list + mailing_list, search_box from hosts where id = ?" in sth#execute [`Int hostid]; - let has_host_css, has_feedback_email, mailing_list = + let has_host_css, has_feedback_email, mailing_list, search_box = match sth#fetch1 () with - | [ `Bool has_host_css; `Bool has_feedback_email; `Bool mailing_list ] -> - has_host_css, has_feedback_email, mailing_list + | [ `Bool has_host_css; `Bool has_feedback_email; `Bool mailing_list; + `Bool search_box ] -> + has_host_css, has_feedback_email, mailing_list, search_box | _ -> assert false in (* Can the user edit? Manage users? etc. *) @@ -168,6 +169,7 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid {edit_anon=edit_anon} user = t#conditional "has_feedback_email" has_feedback_email; t#conditional "mailing_list" mailing_list; + t#conditional "search_box" search_box; t#conditional "can_edit" can_edit; t#conditional "can_manage_users" can_manage_users; diff --git a/templates/edit_host_settings_form.html b/templates/edit_host_settings_form.html index 8818a97..9414831 100644 --- a/templates/edit_host_settings_form.html +++ b/templates/edit_host_settings_form.html @@ -29,6 +29,12 @@ + Search box: + + + + + Theme: + + +::end:: +