From 1bb9dd1b7a217aae3c47cc03da897427c9a8b91b Mon Sep 17 00:00:00 2001 From: rich Date: Wed, 8 Sep 2004 14:01:17 +0000 Subject: [PATCH] Pipe menus using CSS, modelled after this ALA article: http://www.alistapart.com/articles/taminglists/ --- html/_css/standard.css | 9 ++++++++- scripts/page.ml | 33 +++++++++++++++++++++++++++++-- templates/admin/admin.html | 8 ++++---- templates/admin/create_host_form.html | 8 ++++---- templates/admin/edit_emails_form.html | 8 ++++---- templates/admin/edit_host_css_form.html | 8 ++++---- templates/admin/edit_hostnames_form.html | 8 ++++---- templates/admin/host.html | 8 ++++---- templates/delete_file_form.html | 8 ++++---- templates/delete_image_form.html | 8 ++++---- templates/diff.html | 8 ++++---- templates/edit_page_css_form.html | 8 ++++---- templates/edit_user_form.html | 12 +++++------ templates/files.html | 20 +++++++++---------- templates/forgot_password_form.html | 8 ++++---- templates/history.html | 8 ++++---- templates/images.html | 20 +++++++++---------- templates/login_form.html | 8 ++++---- templates/page.html | 34 +++++++++++++++++--------------- templates/page_404.html | 13 ++++++++++-- templates/recent.html | 8 ++++---- templates/restore_form.html | 8 ++++---- templates/sitemap.html | 8 ++++---- templates/undelete_file_form.html | 8 ++++---- templates/undelete_image_form.html | 8 ++++---- templates/upload_file_form.html | 8 ++++---- templates/upload_image_form.html | 8 ++++---- templates/users.html | 10 +++++----- 28 files changed, 179 insertions(+), 132 deletions(-) diff --git a/html/_css/standard.css b/html/_css/standard.css index b729af7..83ba185 100644 --- a/html/_css/standard.css +++ b/html/_css/standard.css @@ -1,5 +1,5 @@ /* Stylesheet for COCANWIKI, derived from EWM. - * $Id: standard.css,v 1.1 2004/09/07 10:14:08 rich Exp $ + * $Id: standard.css,v 1.2 2004/09/08 14:01:17 rich Exp $ */ body { @@ -115,6 +115,13 @@ ul.menu { ul.menu li { display: inline; + border-left: 1px solid #666; + padding-left: 5px; +} + +ul.menu li.first { + border-left: none; + padding-left: 0px; } ul#topmenu { diff --git a/scripts/page.ml b/scripts/page.ml index c34af77..c405ffe 100644 --- a/scripts/page.ml +++ b/scripts/page.ml @@ -1,7 +1,7 @@ (* COCANWIKI scripts. * Written by Richard W.M. Jones . * Copyright (C) 2004 Merjis Ltd. - * $Id: page.ml,v 1.6 2004/09/08 10:42:20 rich Exp $ + * $Id: page.ml,v 1.7 2004/09/08 14:01:17 rich Exp $ *) open Apache @@ -112,6 +112,18 @@ let run r (q : cgi) (dbh : Dbi.connection) (hostid, _, edit_anon) user = t#conditional "user_logged_in" true; t#set "username" username); + (* Site menu. *) + let sth = dbh#prepare_cached "select url, label, ordering from sitemenu + where hostid = ? order by ordering" in + sth#execute [`Int hostid]; + + let table = sth#map (function [`String url; `String label; _] -> + [ "url", Template.VarString url; + "label", Template.VarString label ] + | _ -> assert false) in + + t#table "sitemenu" table; + q#template t in @@ -128,7 +140,24 @@ let run r (q : cgi) (dbh : Dbi.connection) (hostid, _, edit_anon) user = ('a'..'z' | 'A'..'Z' | '0'..'9') as c -> c | _ -> ' ') page in - template_404#set "search_terms" search_terms; + t#set "search_terms" search_terms; + + t#conditional "has_host_css" has_host_css; + + t#conditional "can_edit" can_edit; + t#conditional "can_manage_users" can_manage_users; + + (* Site menu. *) + let sth = dbh#prepare_cached "select url, label, ordering from sitemenu + where hostid = ? order by ordering" in + sth#execute [`Int hostid]; + + let table = sth#map (function [`String url; `String label; _] -> + [ "url", Template.VarString url; + "label", Template.VarString label ] + | _ -> assert false) in + + t#table "sitemenu" table; q#template t in diff --git a/templates/admin/admin.html b/templates/admin/admin.html index 0067a00..99adfa2 100644 --- a/templates/admin/admin.html +++ b/templates/admin/admin.html @@ -32,14 +32,14 @@

diff --git a/templates/admin/create_host_form.html b/templates/admin/create_host_form.html index 6946007..f2d8699 100644 --- a/templates/admin/create_host_form.html +++ b/templates/admin/create_host_form.html @@ -35,14 +35,14 @@ diff --git a/templates/admin/edit_emails_form.html b/templates/admin/edit_emails_form.html index 4f58aae..6c5107f 100644 --- a/templates/admin/edit_emails_form.html +++ b/templates/admin/edit_emails_form.html @@ -27,14 +27,14 @@ diff --git a/templates/admin/edit_host_css_form.html b/templates/admin/edit_host_css_form.html index b719d5d..65effa1 100644 --- a/templates/admin/edit_host_css_form.html +++ b/templates/admin/edit_host_css_form.html @@ -24,14 +24,14 @@ Editing the global stylesheet for this wiki: diff --git a/templates/admin/edit_hostnames_form.html b/templates/admin/edit_hostnames_form.html index e5d20c4..71c7c69 100644 --- a/templates/admin/edit_hostnames_form.html +++ b/templates/admin/edit_hostnames_form.html @@ -31,14 +31,14 @@ diff --git a/templates/admin/host.html b/templates/admin/host.html index 534c779..83a353b 100644 --- a/templates/admin/host.html +++ b/templates/admin/host.html @@ -66,14 +66,14 @@ diff --git a/templates/delete_file_form.html b/templates/delete_file_form.html index 09c22d9..e51e726 100644 --- a/templates/delete_file_form.html +++ b/templates/delete_file_form.html @@ -23,14 +23,14 @@ Name: ::name_html::

diff --git a/templates/delete_image_form.html b/templates/delete_image_form.html index b3e7916..e4cd9dd 100644 --- a/templates/delete_image_form.html +++ b/templates/delete_image_form.html @@ -21,14 +21,14 @@ Are you sure you want to delete this image? width="::width::" height="::height::" alt="::alt_html_tag::"/> diff --git a/templates/diff.html b/templates/diff.html index 42776c1..81a26e3 100644 --- a/templates/diff.html +++ b/templates/diff.html @@ -19,14 +19,14 @@ Differences between diff --git a/templates/edit_page_css_form.html b/templates/edit_page_css_form.html index 820592e..1583488 100644 --- a/templates/edit_page_css_form.html +++ b/templates/edit_page_css_form.html @@ -24,14 +24,14 @@ Editing the stylesheet for ::page_html::: diff --git a/templates/edit_user_form.html b/templates/edit_user_form.html index 43dbe87..3475925 100644 --- a/templates/edit_user_form.html +++ b/templates/edit_user_form.html @@ -10,8 +10,8 @@

User: ::name_html::

@@ -46,14 +46,14 @@ diff --git a/templates/files.html b/templates/files.html index 14c0ec3..5a68ae0 100644 --- a/templates/files.html +++ b/templates/files.html @@ -10,12 +10,12 @@

Files

@@ -39,10 +39,10 @@ Name: ::name_html:: (size: ::ksize_html:: K)
@@ -52,14 +52,14 @@ Name: ::name_html:: (size: ::ksize_html:: K)
diff --git a/templates/forgot_password_form.html b/templates/forgot_password_form.html index c077f1e..81d0633 100644 --- a/templates/forgot_password_form.html +++ b/templates/forgot_password_form.html @@ -32,14 +32,14 @@ username or email address on record, we will email you your password. diff --git a/templates/history.html b/templates/history.html index dde437c..72c4331 100644 --- a/templates/history.html +++ b/templates/history.html @@ -21,14 +21,14 @@ diff --git a/templates/images.html b/templates/images.html index 48e0fec..68fcef6 100644 --- a/templates/images.html +++ b/templates/images.html @@ -10,12 +10,12 @@

Images

@@ -41,10 +41,10 @@ ALT text: ::alt_html::
@@ -54,14 +54,14 @@ ALT text: ::alt_html::
diff --git a/templates/login_form.html b/templates/login_form.html index 02c9843..c66eeb0 100644 --- a/templates/login_form.html +++ b/templates/login_form.html @@ -90,14 +90,14 @@ account for you. ::end:: diff --git a/templates/page.html b/templates/page.html index 8632ce2..df3fe71 100644 --- a/templates/page.html +++ b/templates/page.html @@ -37,42 +37,44 @@
diff --git a/templates/page_404.html b/templates/page_404.html index 57b3348..6ffc2e2 100644 --- a/templates/page_404.html +++ b/templates/page_404.html @@ -22,9 +22,18 @@ Search our site for this page: + +
diff --git a/templates/recent.html b/templates/recent.html index 83c30f1..8ad061c 100644 --- a/templates/recent.html +++ b/templates/recent.html @@ -22,14 +22,14 @@ diff --git a/templates/restore_form.html b/templates/restore_form.html index 7312c2b..a7287fd 100644 --- a/templates/restore_form.html +++ b/templates/restore_form.html @@ -25,14 +25,14 @@ be deleting. diff --git a/templates/sitemap.html b/templates/sitemap.html index 523a4bf..71f91f9 100644 --- a/templates/sitemap.html +++ b/templates/sitemap.html @@ -15,14 +15,14 @@ ::end:: diff --git a/templates/undelete_file_form.html b/templates/undelete_file_form.html index 981f895..9ca369e 100644 --- a/templates/undelete_file_form.html +++ b/templates/undelete_file_form.html @@ -23,14 +23,14 @@ Name: ::name_html::

diff --git a/templates/undelete_image_form.html b/templates/undelete_image_form.html index b2e475a..d295bda 100644 --- a/templates/undelete_image_form.html +++ b/templates/undelete_image_form.html @@ -21,14 +21,14 @@ Are you sure you want to restore this image? width="::width::" height="::height::" alt="::alt_html_tag::"/> diff --git a/templates/upload_file_form.html b/templates/upload_file_form.html index b4dc980..9132686 100644 --- a/templates/upload_file_form.html +++ b/templates/upload_file_form.html @@ -53,14 +53,14 @@ The title appears when users hover over a file link with their mouse. It is not diff --git a/templates/upload_image_form.html b/templates/upload_image_form.html index 0d131f5..9776d8b 100644 --- a/templates/upload_image_form.html +++ b/templates/upload_image_form.html @@ -86,14 +86,14 @@ Class is used with stylesheets. If in doubt, leave it blank. diff --git a/templates/users.html b/templates/users.html index f4cd067..624fcde 100644 --- a/templates/users.html +++ b/templates/users.html @@ -10,7 +10,7 @@

Users

@@ -82,14 +82,14 @@ If set, user may: -- 1.8.3.1