diff options
author | Andrew Manning <tamanning@zoho.com> | 2016-06-15 06:25:31 -0400 |
---|---|---|
committer | Andrew Manning <tamanning@zoho.com> | 2016-06-15 06:25:31 -0400 |
commit | 688171d016412f30a3ed60d4dc70feb64a19621b (patch) | |
tree | f664ba56a4b2df71db208b848db72b1ce1396b99 /view/tpl/wiki.tpl | |
parent | e5a919c32eae5c04d44e1e60ddadf95a63f9deb3 (diff) | |
download | volse-hubzilla-688171d016412f30a3ed60d4dc70feb64a19621b.tar.gz volse-hubzilla-688171d016412f30a3ed60d4dc70feb64a19621b.tar.bz2 volse-hubzilla-688171d016412f30a3ed60d4dc70feb64a19621b.zip |
Rename page feature added. Fixed bug in git commit function and other minor fixes.
Diffstat (limited to 'view/tpl/wiki.tpl')
-rw-r--r-- | view/tpl/wiki.tpl | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/view/tpl/wiki.tpl b/view/tpl/wiki.tpl index 1312f8518..dc78aad9f 100644 --- a/view/tpl/wiki.tpl +++ b/view/tpl/wiki.tpl @@ -25,7 +25,7 @@ <button id="inline-btn" type="button" class="btn btn-default btn-xs" onclick="makeFullScreen(false); adjustInlineTopBarHeight();"><i class="fa fa-compress"></i></button> </div> - <h2>{{$wikiheader}}</h2> + <h2><span id="wiki-header-name">{{$wikiheaderName}}</span>: <span id="wiki-header-page">{{$wikiheaderPage}}</span></h2> <div class="clear"></div> </div> <div id="new-wiki-form-wrapper" class="section-content-tools-wrapper" style="display:none;"> @@ -57,6 +57,17 @@ <hr> </div> + <div id="rename-page-form-wrapper" class="section-content-tools-wrapper" style="display:none;"> + <form id="rename-page-form" action="wiki/rename/page" method="post" > + <div class="clear"></div> + {{include file="field_input.tpl" field=$pageRename}} + <div class="btn-group pull-right"> + <button id="rename-page-submit" class="btn btn-warning" type="submit" name="submit" >Rename Page</button> + </div> + </form> <div class="clear"></div> + <hr> + </div> + <div id="wiki-content-container" class="section-content-wrapper" {{if $hideEditor}}style="display: none;"{{/if}}> <ul class="nav nav-tabs" id="wiki-nav-tabs"> <li><a data-toggle="tab" href="#edit-pane">Edit</a></li> @@ -67,6 +78,7 @@ <a data-toggle="dropdown" class="dropdown-toggle" href="#">Page <b class="caret"></b></a> <ul class="dropdown-menu"> <li><a id="save-page" data-toggle="tab" href="#">Save</a></li> + <li><a id="rename-page" data-toggle="tab" href="#">Rename</a></li> <li><a id="delete-page" data-toggle="tab" href="#">Delete</a></li> </ul> </li> @@ -115,7 +127,34 @@ if (window.wiki_page_name === 'Home') { $('#delete-page').hide(); + $('#rename-page').hide(); } + + $('#rename-page').click(function (ev) { + $('#rename-page-form-wrapper').show(); + }); + + $( "#rename-page-form" ).submit(function( event ) { + $.post("wiki/{{$channel}}/rename/page", + { + oldName: window.wiki_page_name, + newName: $('#id_pageRename').val(), + resource_id: window.wiki_resource_id + }, + function (data) { + if (data.success) { + $('#rename-page-form-wrapper').hide(); + window.console.log('data: ' + JSON.stringify(data)); + window.wiki_page_name = data.name.urlName; + $('#wiki-header-page').html(data.name.htmlName); + wiki_refresh_page_list(); + } else { + window.console.log('Error renaming page.'); + } + }, 'json'); + event.preventDefault(); + }); + $(document).ready(function () { wiki_refresh_page_list(); // Show Edit tab first. Otherwise the Ace editor does not load. |