aboutsummaryrefslogtreecommitdiffstats
path: root/view/tpl/wiki_page_list.tpl
diff options
context:
space:
mode:
authorAndrew Manning <tamanning@zoho.com>2016-11-18 21:55:29 -0500
committerAndrew Manning <tamanning@zoho.com>2016-11-18 21:55:29 -0500
commitd24e867603fd253ea42050057896422beeba59db (patch)
treea8bae0233152a1c9985d23a98c3dd328cbe41f8f /view/tpl/wiki_page_list.tpl
parentd5c14a513d435aade7d16d792a7e7a22ff9b01ff (diff)
downloadvolse-hubzilla-d24e867603fd253ea42050057896422beeba59db.tar.gz
volse-hubzilla-d24e867603fd253ea42050057896422beeba59db.tar.bz2
volse-hubzilla-d24e867603fd253ea42050057896422beeba59db.zip
Move page list back out to the side menu, but with the new page form below the new page button like the new wiki form. Disable text editing if viewer lacks edit permission, and change the tab label to Source instead of Edit in that case.
Diffstat (limited to 'view/tpl/wiki_page_list.tpl')
-rw-r--r--view/tpl/wiki_page_list.tpl35
1 files changed, 34 insertions, 1 deletions
diff --git a/view/tpl/wiki_page_list.tpl b/view/tpl/wiki_page_list.tpl
index afb14c6a9..c0eeecff8 100644
--- a/view/tpl/wiki_page_list.tpl
+++ b/view/tpl/wiki_page_list.tpl
@@ -1,6 +1,6 @@
{{if $not_refresh}}<div id="wiki_page_list_container" {{if $hide}} style="display: none;" {{/if}}>{{/if}}
<div id="wiki_page_list" class="widget" >
- <!--<h3>{{$header}}</h3>-->
+ <h3>{{$header}}</h3>
<ul class="nav nav-pills nav-stacked">
{{if $pages}}
@@ -10,5 +10,38 @@
{{/if}}
{{if $canadd}}<li><a href="#" onclick="wiki_show_new_page_form(); return false;"><i class="fa fa-plus-circle"></i>&nbsp;{{$addnew}}</a></li>{{/if}}
</ul>
+ {{if $canadd}}
+ <div id="new-page-form-wrapper" class="sub-menu" style="display:none;">
+ <form id="new-page-form" action="wiki/{{$channel}}/create/page" method="post" >
+ <div class="clear"></div>
+ {{include file="field_input.tpl" field=$pageName}}
+ <div class="btn-group pull-right">
+ <button id="new-page-submit" class="btn btn-success" type="submit" name="submit" >Create Page</button>
+ </div>
+ </form>
+ <div class="clear"></div>
+ <hr>
+ </div>
+ {{/if}}
</div>
{{if $not_refresh}}</div>{{/if}}
+
+<script>
+
+ $('#new-page-submit').click(function (ev) {
+ if (window.wiki_resource_id === '') {
+ window.console.log('You must have a wiki open in order to create pages.');
+ ev.preventDefault();
+ return false;
+ }
+ $.post("wiki/{{$channel}}/create/page", {name: $('#id_pageName').val(), resource_id: window.wiki_resource_id},
+ function (data) {
+ if (data.success) {
+ window.location = data.url;
+ } else {
+ window.console.log('Error creating page.');
+ }
+ }, 'json');
+ ev.preventDefault();
+ });
+</script> \ No newline at end of file