diff options
Diffstat (limited to 'view/tpl/wiki_page_list.tpl')
-rw-r--r-- | view/tpl/wiki_page_list.tpl | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/view/tpl/wiki_page_list.tpl b/view/tpl/wiki_page_list.tpl index c020f2520..c0eeecff8 100644 --- a/view/tpl/wiki_page_list.tpl +++ b/view/tpl/wiki_page_list.tpl @@ -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> {{$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 |