aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Zotlabs/Module/Wiki.php2
-rw-r--r--view/tpl/wiki.tpl73
-rw-r--r--view/tpl/wikilist.tpl22
3 files changed, 61 insertions, 36 deletions
diff --git a/Zotlabs/Module/Wiki.php b/Zotlabs/Module/Wiki.php
index aaa1f1e3d..b73244a1c 100644
--- a/Zotlabs/Module/Wiki.php
+++ b/Zotlabs/Module/Wiki.php
@@ -211,6 +211,8 @@ class Wiki extends \Zotlabs\Web\Controller {
'$wikiheaderPage' => $wikiheaderPage,
'$hideEditor' => $hide_editor,
'$showPageControls' => $showPageControls,
+ '$tools_label' => 'Wiki Tools',
+ '$showTools' => $showNewWikiButton || $showNewPageButton,
'$showNewWikiButton'=> $showNewWikiButton,
'$showNewPageButton'=> $showNewPageButton,
'$hidePageHistory' => $hidePageHistory,
diff --git a/view/tpl/wiki.tpl b/view/tpl/wiki.tpl
index 8fdf56e77..7e18b0fc4 100644
--- a/view/tpl/wiki.tpl
+++ b/view/tpl/wiki.tpl
@@ -13,13 +13,42 @@
</style>
<div class="generic-content-wrapper">
<div class="section-title-wrapper">
+
<div class="pull-right">
- {{if $showNewWikiButton}}
- <button class="btn btn-primary btn-xs acl-form-trigger" onclick="$('#new-page-form-wrapper').hide(); openClose('new-wiki-form-wrapper');" data-form_id="new-wiki-form">New Wiki</button>
- {{/if}}
- {{if $showNewPageButton}}
- <button class="btn btn-success btn-xs" onclick="$('#new-wiki-form-wrapper').hide(); openClose('new-page-form-wrapper');">New Page</button>
- {{/if}}
+ {{if $showNewWikiButton || $showPageControls}}
+ <div class="btn-group">
+ <button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown">
+ <i class="fa fa-caret-down"></i>&nbsp;{{$tools_label}}
+ </button>
+ <ul class="dropdown-menu">
+ {{if $showNewWikiButton}}
+ <li class="nav-item">
+ <a class="nav-link" href="#" onclick="$('#new-page-form-wrapper').hide(); openClose('new-wiki-form-wrapper'); return false;" data-form_id="new-wiki-form"><i class="fa fa-book"></i>&nbsp;New Wiki</a>
+ </li>
+ {{/if}}
+ {{if $showNewPageButton}}
+ <li class="nav-item">
+ <a class="nav-link" href="#" onclick="$('#new-wiki-form-wrapper').hide(); openClose('new-page-form-wrapper'); return false;" data-form_id="new-page-form"><i class="fa fa-file-text-o"></i>&nbsp;New Page</a>
+ </li>
+ {{/if}}
+ {{if $showPageControls}}
+ <li class="divider"></li>
+
+ <li class="nav-item">
+ <a id="rename-page" class="nav-link" href="#"><i class="fa fa-edit"></i>&nbsp;Rename Page</a>
+ </li>
+ <li class="nav-item">
+ <a id="delete-page" class="nav-link" href="#"><i class="fa fa-trash-o"></i>&nbsp;Delete Page</a>
+ </li>
+ <li class="nav-item">
+ <a id="embed-image" class="nav-link" href="#"><i class="fa fa-picture-o"></i>&nbsp;Embed Image</a>
+ </li>
+ {{/if}}
+ </ul>
+ </div>
+
+ {{/if}}
+
<button id="fullscreen-btn" type="button" class="btn btn-default btn-xs" onclick="makeFullScreen();
adjustFullscreenTopBarHeight();"><i class="fa fa-expand"></i></button>
<button id="inline-btn" type="button" class="btn btn-default btn-xs" onclick="makeFullScreen(false);
@@ -85,21 +114,10 @@
<li><a data-toggle="tab" href="#edit-pane">Edit</a></li>
<li class="active"><a data-toggle="tab" href="#preview-pane" id="wiki-get-preview">Preview</a></li>
<li {{if $hidePageHistory}}style="display: none;"{{/if}}><a data-toggle="tab" href="#page-history-pane" id="wiki-get-history">History</a></li>
- {{if $showPageControls}}
- <li class="dropdown">
- <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>
- <li class="divider"></li>
- <li><a id="embed-image" data-toggle="tab" href="#">Embed image</a></li>
-
- </ul>
- </li>
- {{/if}}
+
</ul>
- <div class="tab-content" id="wiki-page-tabs">
+
+ <div class="tab-content" id="wiki-page-tabs">
<div id="edit-pane" class="tab-pane fade">
<div id="ace-editor"></div>
@@ -118,10 +136,21 @@
</div>
</div>
{{if $showCommitMsg}}
+ {{if $showPageControls}}
<div class="section-content-wrapper">
- {{include file="field_input.tpl" field=$commitMsg}}
+ <div id="id_{{$commitMsg.0}}_wrapper" class='form-group field input'>
+ <label for='id_{{$commitMsg.0}}' id='label_{{$commitMsg.0}}'>{{$commitMsg.1}}{{if $commitMsg.4}}<span class="required"> {{$commitMsg.4}}</span>{{/if}}</label>
+ <span>
+ <input class="" style="width: 80%;" name='{{$commitMsg.0}}' id='id_{{$commitMsg.0}}' type="text" value="{{$commitMsg.2}}"{{if $commitMsg.5}} {{$commitMsg.5}}{{/if}}>
+ <a id="save-page" href="#" class="btn btn-primary btn-md">Save</a>
+ </span>
+ <span id='help_{{$commitMsg.0}}' class='help-block'>{{$commitMsg.3}}</span>
+
+ <div class="clear"></div>
+ </div>
</div>
{{/if}}
+ {{/if}}
</div>
{{$wikiModal}}
@@ -165,6 +194,7 @@
$('#rename-page').click(function (ev) {
$('#rename-page-form-wrapper').show();
+ ev.preventDefault();
});
$( "#rename-page-form" ).submit(function( event ) {
@@ -316,6 +346,7 @@ function wiki_download_wiki(resource_id) {
return false;
}
if(!confirm('Are you sure you want to delete the page: ' + window.wiki_page_name)) {
+ ev.preventDefault();
return;
}
$.post("wiki/{{$channel}}/delete/page", {name: window.wiki_page_name, resource_id: window.wiki_resource_id},
diff --git a/view/tpl/wikilist.tpl b/view/tpl/wikilist.tpl
index 6b37be4c5..7cf04d35e 100644
--- a/view/tpl/wikilist.tpl
+++ b/view/tpl/wikilist.tpl
@@ -1,21 +1,13 @@
<div id="wiki_list" class="widget">
<h3>{{$header}}</h3>
- <ul class="nav nav-pills nav-stacked">
+ <div>
{{foreach $wikis as $wiki}}
- <li class="dropdown" id="wiki-{{$wiki.resource_id}}">
- <a class="dropdown-toggle" data-toggle="dropdown" href="#">
- <b>{{$wiki.title}}</b><b class="fa fa-caret-down pull-right"></b>
- </a>
- <ul class="dropdown-menu pull-right">
- <li><a href="/wiki/{{$channel}}/{{$wiki.urlName}}/Home" title="View {{$wiki.title}}">View</a></li>
- <li><a href="#" onclick="wiki_download_wiki('{{$wiki.resource_id}}'); return false;" title="Download {{$wiki.title}}">Download</a></li>
- {{if $showControls}}
- <li class="divider"></li>
- <li><a href="#" onclick="wiki_delete_wiki('{{$wiki.title}}','{{$wiki.resource_id}}'); return false;" title="Delete {{$wiki.title}}">Delete wiki</a></li>
- {{/if}}
- </ul>
- </li>
+ <div class="form-group" id="wiki-{{$wiki.resource_id}}">
+ <a href="/wiki/{{$channel}}/{{$wiki.urlName}}/Home" title="View {{$wiki.title}}"><b>{{$wiki.title}}</b></a>
+ <i class="pull-right generic-icons fakelink fa fa-trash-o" onclick="wiki_delete_wiki('{{$wiki.title}}','{{$wiki.resource_id}}'); return false;" title="Delete {{$wiki.title}}"></i>
+ <i class="pull-right generic-icons fakelink fa fa-download" onclick="wiki_download_wiki('{{$wiki.resource_id}}'); return false;" title="Download {{$wiki.title}}"></i>
+ </div>
{{/foreach}}
- </ul>
+ </div>
</div>