From 3b0f83df92714f2657da0b738884adbd7d4bdc63 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Fri, 23 Oct 2009 03:55:29 +0000 Subject: [PATCH] * Set up links and templates for the history page, along with a nice set of toggles in the nav bar --- webcit/roomops.c | 25 +++++++++++++++++++++++++ webcit/static/t/wiki_history.html | 1 + webcit/static/t/wiki_history_inner.html | 1 + webcit/wiki.c | 3 +-- 4 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 webcit/static/t/wiki_history.html create mode 100644 webcit/static/t/wiki_history_inner.html diff --git a/webcit/roomops.c b/webcit/roomops.c index 456b19ce6..14c4c3590 100644 --- a/webcit/roomops.c +++ b/webcit/roomops.c @@ -663,6 +663,31 @@ void embed_room_banner(char *got, int navbar_style) { "%s" "\n", buf, _("Edit this page") ); + + if (bmstrcasestr((char *)ChrPtr(WCC->Hdr->HR.ReqLine), "wiki_history")) { + /* already viewing history; display a link to the current page */ + wprintf( + "
  • " + "" + "" + "" + "%s" + "
  • \n", buf, _("Current version") + ); + } + else { + /* display a link to the history */ + wprintf( + "
  • " + "" + "" + "" + "%s" + "
  • \n", buf, _("History") + ); + } break; case VIEW_MAILBOX: wprintf( diff --git a/webcit/static/t/wiki_history.html b/webcit/static/t/wiki_history.html new file mode 100644 index 000000000..49d3d1138 --- /dev/null +++ b/webcit/static/t/wiki_history.html @@ -0,0 +1 @@ + diff --git a/webcit/static/t/wiki_history_inner.html b/webcit/static/t/wiki_history_inner.html new file mode 100644 index 000000000..9d6cf4b7f --- /dev/null +++ b/webcit/static/t/wiki_history_inner.html @@ -0,0 +1 @@ +FIXME diff --git a/webcit/wiki.c b/webcit/wiki.c index aaa327859..b854b00dd 100644 --- a/webcit/wiki.c +++ b/webcit/wiki.c @@ -66,7 +66,6 @@ void display_wiki_page_backend(const StrBuf *roomname, char *pagename) /* Found it! Now read it. */ msgnum = locate_message_by_uid(pagename); if (msgnum >= 0L) { - wprintf("FIXME can we put wiki nav links in or something?
    \n"); read_message(WC->WBuf, HKEY("view_message"), msgnum, NULL, &Mime); return; } @@ -114,7 +113,7 @@ void display_wiki_history(void) roomname = sbstr("room"); safestrncpy(pagename, bstr("page"), sizeof pagename); - wprintf("FIXME put something here
    \n"); + do_template("wiki_history", NULL); wDumpContent(1); } -- 2.30.2