/* Stylesheet for COCANWIKI.
- * $Id: standard.css,v 1.10 2004/10/09 08:19:42 rich Exp $
+ * $Id: standard.css,v 1.11 2004/10/09 08:33:02 rich Exp $
*/
body {
display: inline;
margin-right: 2em;
}
+
+table.cal_day {
+ border-collapse: collapse;
+ border: 1px solid #eee;
+ width: 90%;
+ margin-left: 5%;
+ margin-right: 5%;
+}
+
+table.cal_day ul {
+ list-style: none;
+ padding: 0px;
+ margin: 0px;
+}
+
+table.cal_day li {
+ display: inline;
+ margin-right: 2em;
+}
+
+table.cal_day a.cal_day_left {
+ margin-right: 2em;
+}
+
+table.cal_day a.cal_day_right {
+ margin-left: 2em;
+}
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: cocanwiki_ext_calendar.ml,v 1.2 2004/10/07 18:56:53 rich Exp $
+ * $Id: cocanwiki_ext_calendar.ml,v 1.3 2004/10/09 08:33:02 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
template#to_string
- | Some (yyyy, mm, dd) -> (* Single day view. *)
+ | Some ((yyyy, mm, dd) as date) -> (* Single day view. *)
let template = day_template in
- failwith "not impl";
-
-
-
-
-
-
+ (* XXX This will change once we start doing date and time events.
+ * For now it is very simple indeed.
+ *)
+ template#set "yyyy" (string_of_int yyyy);
+ template#set "mm" (sprintf "%02d" mm);
+ template#set "dd" (sprintf "%02d" dd);
+ template#set "month_name" (long_month mm);
+ let dow = GregorianDate.day_of_week date in
+ template#set "short_weekday" (short_weekday dow);
+ let prev_yyyy, prev_mm, prev_dd =
+ GregorianDate.add_delta_days date (-1) in
+ let next_yyyy, next_mm, next_dd =
+ GregorianDate.add_delta_days date 1 in
+ template#set "prev_yyyy" (string_of_int prev_yyyy);
+ template#set "prev_mm" (sprintf "%02d" prev_mm);
+ template#set "prev_dd" (sprintf "%02d" prev_dd);
+ template#set "next_yyyy" (string_of_int next_yyyy);
+ template#set "next_mm" (sprintf "%02d" next_mm);
+ template#set "next_dd" (sprintf "%02d" next_dd);
+ let table = List.map (fun (_, (title, page)) ->
+ [ "title", Template.VarString title;
+ "page", Template.VarString page ]) pages in
+ template#table "events" table;
template#to_string
+<table class="cal_day">
+<tr>
+<th>
+<a href="/::prev_yyyy::/::prev_mm::/::prev_dd::" class="cal_day_left" title="Previous day"><<</a>
+::short_weekday::
+::dd::
+<a href="/::yyyy::/::mm::">::month_name_html::</a>
+<a href="/::yyyy::">::yyyy::</a>
+<a href="/::next_yyyy::/::next_mm::/::next_dd::" class="cal_day_right" title="Next day">>></a>
+</th>
+</tr>
+<tr>
+<td>
+<ul>
+::table(events)::<li><a href="/::page::">::title_html::</a></li>::end::
+</ul>
+</td>
+</tr>
+</table>
\ No newline at end of file