* Set up links and templates for the history page, along with a nice set of toggles...
authorArt Cancro <ajc@citadel.org>
Fri, 23 Oct 2009 03:55:29 +0000 (03:55 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 23 Oct 2009 03:55:29 +0000 (03:55 +0000)
webcit/roomops.c
webcit/static/t/wiki_history.html [new file with mode: 0644]
webcit/static/t/wiki_history_inner.html [new file with mode: 0644]
webcit/wiki.c

index 456b19ce657c104fcc68a0f178bc8bdb0185a6a8..14c4c359030fa9a883ae8f4dd83ce44b8f258e00 100644 (file)
@@ -663,6 +663,31 @@ void embed_room_banner(char *got, int navbar_style) {
                                        "%s"
                                        "</span></a></li>\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(
+                                               "<li class=\"newmess\">"
+                                               "<a href=\"wiki?page=%s\">"
+                                               "<img  src=\"static/newmess3_24x.gif\" "
+                                               "alt=\"\" width=\"24\" height=\"24\">"
+                                               "<span class=\"navbar_link\">"
+                                               "%s"
+                                               "</span></a></li>\n", buf, _("Current version")
+                                               );
+                               }
+                               else {
+                                       /* display a link to the history */
+                                       wprintf(
+                                               "<li class=\"newmess\">"
+                                               "<a href=\"wiki_history?page=%s\">"
+                                               "<img  src=\"static/newmess3_24x.gif\" "
+                                               "alt=\"\" width=\"24\" height=\"24\">"
+                                               "<span class=\"navbar_link\">"
+                                               "%s"
+                                               "</span></a></li>\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 (file)
index 0000000..49d3d11
--- /dev/null
@@ -0,0 +1 @@
+<?DOBOXED("wiki_history_inner", _("History of edits for this page"))>
diff --git a/webcit/static/t/wiki_history_inner.html b/webcit/static/t/wiki_history_inner.html
new file mode 100644 (file)
index 0000000..9d6cf4b
--- /dev/null
@@ -0,0 +1 @@
+FIXME
index aaa327859a8532444a7366ef98419965bfc7843d..b854b00dd501aa72478b3b0e6567c0c683b26796 100644 (file)
@@ -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?<br>\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<br>\n");
+       do_template("wiki_history", NULL);
 
        wDumpContent(1);
 }