diff options
Diffstat (limited to 'view')
-rw-r--r-- | view/tpl/wiki.tpl | 17 | ||||
-rw-r--r-- | view/tpl/wiki_page_list.tpl | 2 |
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}} |