diff options
author | Andrew Manning <tamanning@zoho.com> | 2016-06-05 20:30:45 -0400 |
---|---|---|
committer | Andrew Manning <tamanning@zoho.com> | 2016-06-05 20:30:45 -0400 |
commit | b8b50bdb5abb5403f3f8a8662b7db0703b39073b (patch) | |
tree | 66e2215423b28adddbfef7e8dfbde483a825693b /view/tpl/wiki.tpl | |
parent | 08a9553ccc0fd883a77fbf36be5941ba119deda1 (diff) | |
download | volse-hubzilla-b8b50bdb5abb5403f3f8a8662b7db0703b39073b.tar.gz volse-hubzilla-b8b50bdb5abb5403f3f8a8662b7db0703b39073b.tar.bz2 volse-hubzilla-b8b50bdb5abb5403f3f8a8662b7db0703b39073b.zip |
Custom commit message available. Improved history viewer and feedback from revert buttons.
Diffstat (limited to 'view/tpl/wiki.tpl')
-rw-r--r-- | view/tpl/wiki.tpl | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/view/tpl/wiki.tpl b/view/tpl/wiki.tpl index d9a490bf8..05ddad05b 100644 --- a/view/tpl/wiki.tpl +++ b/view/tpl/wiki.tpl @@ -101,6 +101,11 @@ </div> </div> + {{if $showCommitMsg}} + <div class="section-content-wrapper"> + {{include file="field_input.tpl" field=$commitMsg}} + </div> + {{/if}} </div> <script> @@ -198,10 +203,16 @@ function wiki_delete_wiki(wikiHtmlName, resource_id) { ev.preventDefault(); return false; } - $.post("wiki/{{$channel}}/save/page", {content: editor.getValue(), name: window.wiki_page_name, resource_id: window.wiki_resource_id}, + $.post("wiki/{{$channel}}/save/page", + { content: editor.getValue(), + commitMsg: $('#id_commitMsg').val(), + name: window.wiki_page_name, + resource_id: window.wiki_resource_id + }, function (data) { if (data.success) { window.console.log('Page saved successfully.'); + $('#id_commitMsg').val(''); // Clear the commit message box } else { alert('Error saving page.'); // TODO: Replace alerts with auto-timeout popups window.console.log('Error saving page.'); @@ -241,7 +252,12 @@ function wiki_delete_wiki(wikiHtmlName, resource_id) { $.post("wiki/{{$channel}}/revert/page", {commitHash: commitHash, name: window.wiki_page_name, resource_id: window.wiki_resource_id}, function (data) { if (data.success) { - window.console.log('Reverted content: ' + data.content); + $('button[id^=revert-]').removeClass('btn-success'); + $('button[id^=revert-]').addClass('btn-danger'); + $('button[id^=revert-]').html('Revert'); + $('#revert-'+commitHash).removeClass('btn-danger'); + $('#revert-'+commitHash).addClass('btn-success'); + $('#revert-'+commitHash).html('Page reverted<br>but not saved'); // put contents in editor editor.getSession().setValue(data.content); } else { |