From 8d284bab474c7e669ae9a639bdb22f7b28b95cc3 Mon Sep 17 00:00:00 2001 From: Andrew Manning Date: Mon, 30 May 2016 20:59:54 -0400 Subject: Created page history widget to dynamically fetch and display the git commit history for wiki pages. --- view/tpl/wiki.tpl | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'view/tpl/wiki.tpl') diff --git a/view/tpl/wiki.tpl b/view/tpl/wiki.tpl index 91c6e64b2..d2ce03f5a 100644 --- a/view/tpl/wiki.tpl +++ b/view/tpl/wiki.tpl @@ -59,6 +59,7 @@ -
+
@@ -79,6 +80,21 @@ {{$renderedContent}}
+
+
+ + {{foreach $pageHistory as $commit}} + + {{/foreach}} +
+ + + + +
Date{{$commit.date}}
Name{{$commit.name}}
Message{{$commit.title}}
+
+
+
@@ -110,6 +126,17 @@ ev.preventDefault(); }); + $('#wiki-get-history').click(function (ev) { + $.post("wiki/{{$channel}}/history/page", {name: window.wiki_page_name, resource_id: window.wiki_resource_id}, function (data) { + if (data.success) { + $('#page-history-list').html(data.historyHTML); + } else { + window.console.log('Error getting page history.'); + } + }, 'json'); + ev.preventDefault(); + }); + function wiki_delete_wiki(wikiName, resource_id) { if(!confirm('Are you sure you want to delete the entire wiki: ' + JSON.stringify(wikiName))) { return; -- cgit v1.2.3