aboutsummaryrefslogtreecommitdiffstats
path: root/view/tpl
diff options
context:
space:
mode:
authorAndrew Manning <tamanning@zoho.com>2016-05-28 07:17:42 -0400
committerAndrew Manning <tamanning@zoho.com>2016-05-28 07:17:42 -0400
commitf884fa66782544cd6fc44a81b978a905d4755cea (patch)
tree8330844f0e1c2f6b2ab6b80836fc3437bc38dc12 /view/tpl
parent4691c3ec01eda972e7b4cae4ec940c8c24d51b5a (diff)
downloadvolse-hubzilla-f884fa66782544cd6fc44a81b978a905d4755cea.tar.gz
volse-hubzilla-f884fa66782544cd6fc44a81b978a905d4755cea.tar.bz2
volse-hubzilla-f884fa66782544cd6fc44a81b978a905d4755cea.zip
Wiki page list is fetched and the page widget is updated
Diffstat (limited to 'view/tpl')
-rw-r--r--view/tpl/wiki.tpl17
-rw-r--r--view/tpl/wiki_page_list.tpl2
2 files changed, 18 insertions, 1 deletions
diff --git a/view/tpl/wiki.tpl b/view/tpl/wiki.tpl
index b0824650c..27887cc1c 100644
--- a/view/tpl/wiki.tpl
+++ b/view/tpl/wiki.tpl
@@ -78,6 +78,7 @@
<script>
window.wiki_resource_id = '{{$resource_id}}';
$(document).ready(function () {
+ wiki_refresh_page_list();
// Show Edit tab first. Otherwise the Ace editor does not load.
$("#wiki-nav-tabs li:eq(0) a").tab('show');
});
@@ -131,4 +132,20 @@ function wiki_delete_wiki(wikiName, resource_id) {
}, 'json');
ev.preventDefault();
});
+
+ function wiki_refresh_page_list() {
+ if (window.wiki_resource_id === '') {
+ return false;
+ }
+ $.post("wiki/{{$channel}}/get/page/list/", {resource_id: window.wiki_resource_id}, function (data) {
+ if (data.success) {
+ $('#wiki_page_list').html(data.pages);
+ $('#wiki_page_list').show();
+ } else {
+ alert('Error fetching page list!');
+ window.console.log('Error fetching page list!');
+ }
+ }, 'json');
+ return false;
+ }
</script>
diff --git a/view/tpl/wiki_page_list.tpl b/view/tpl/wiki_page_list.tpl
index 015ffb930..0ced893c3 100644
--- a/view/tpl/wiki_page_list.tpl
+++ b/view/tpl/wiki_page_list.tpl
@@ -1,4 +1,4 @@
-<div id="wiki_page_list" class="widget">
+<div id="wiki_page_list" class="widget" {{if $hide}} style="display: none;" {{/if}}>
<h3>{{$header}}</h3>
<ul class="nav nav-pills nav-stacked">
{{foreach $pages as $page}}