aboutsummaryrefslogtreecommitdiffstats
path: root/view/tpl
diff options
context:
space:
mode:
Diffstat (limited to 'view/tpl')
-rwxr-xr-xview/tpl/abook_edit.tpl34
-rwxr-xr-xview/tpl/group_side.tpl6
-rw-r--r--view/tpl/help.tpl2
-rw-r--r--view/tpl/wiki.tpl38
-rw-r--r--view/tpl/wiki_page_list.tpl53
5 files changed, 64 insertions, 69 deletions
diff --git a/view/tpl/abook_edit.tpl b/view/tpl/abook_edit.tpl
index e7e5b928f..12ec879a9 100755
--- a/view/tpl/abook_edit.tpl
+++ b/view/tpl/abook_edit.tpl
@@ -1,8 +1,25 @@
<div class="generic-content-wrapper">
<div class="section-title-wrapper">
{{if $notself}}
+ <div class="pull-right">
+ <div class="btn-group">
+ <button id="connection-dropdown" class="btn btn-default btn-xs dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
+ <i class="fa fa-caret-down"></i>&nbsp;{{$tools_label}}
+ </button>
+ <ul class="dropdown-menu dropdown-menu-right" aria-labelledby="dLabel">
+ <li><a href="{{$tools.view.url}}" title="{{$tools.view.title}}">{{$tools.view.label}}</a></li>
+ <li><a href="{{$tools.recent.url}}" title="{{$tools.recent.title}}">{{$tools.recent.label}}</a></li>
+ <li class="divider"></li>
+ <li><a href="#" title="{{$tools.refresh.title}}" onclick="window.location.href='{{$tools.refresh.url}}'; return false;">{{$tools.refresh.label}}</a></li>
+ <li><a href="#" title="{{$tools.block.title}}" onclick="window.location.href='{{$tools.block.url}}'; return false;">{{$tools.block.label}}</a></li>
+ <li><a href="#" title="{{$tools.ignore.title}}" onclick="window.location.href='{{$tools.ignore.url}}'; return false;">{{$tools.ignore.label}}</a></li>
+ <li><a href="#" title="{{$tools.archive.title}}" onclick="window.location.href='{{$tools.archive.url}}'; return false;">{{$tools.archive.label}}</a></li>
+ <li><a href="#" title="{{$tools.hide.title}}" onclick="window.location.href='{{$tools.hide.url}}'; return false;">{{$tools.hide.label}}</a></li>
+ <li><a href="#" title="{{$tools.delete.title}}" onclick="window.location.href='{{$tools.delete.url}}'; return false;">{{$tools.delete.label}}</a></li>
+ </ul>
+ </div>
{{if $abook_prev || $abook_next}}
- <div class="btn-group pull-right">
+ <div class="btn-group">
{{if $abook_prev}}
<a href="connedit/{{$abook_prev}}" class="btn btn-default btn-xs" ><i class="fa fa-backward"></i></a>
{{/if}}
@@ -11,21 +28,6 @@
{{/if}}
</div>
{{/if}}
- <div class="dropdown pull-right">
- <button id="connection-dropdown" class="btn btn-default btn-xs" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
- <i class="fa fa-caret-down"></i>&nbsp;{{$tools_label}}
- </button>
- <ul class="dropdown-menu" aria-labelledby="dLabel">
- <li><a href="{{$tools.view.url}}" title="{{$tools.view.title}}">{{$tools.view.label}}</a></li>
- <li><a href="{{$tools.recent.url}}" title="{{$tools.recent.title}}">{{$tools.recent.label}}</a></li>
- <li class="divider"></li>
- <li><a href="#" title="{{$tools.refresh.title}}" onclick="window.location.href='{{$tools.refresh.url}}'; return false;">{{$tools.refresh.label}}</a></li>
- <li><a href="#" title="{{$tools.block.title}}" onclick="window.location.href='{{$tools.block.url}}'; return false;">{{$tools.block.label}}</a></li>
- <li><a href="#" title="{{$tools.ignore.title}}" onclick="window.location.href='{{$tools.ignore.url}}'; return false;">{{$tools.ignore.label}}</a></li>
- <li><a href="#" title="{{$tools.archive.title}}" onclick="window.location.href='{{$tools.archive.url}}'; return false;">{{$tools.archive.label}}</a></li>
- <li><a href="#" title="{{$tools.hide.title}}" onclick="window.location.href='{{$tools.hide.url}}'; return false;">{{$tools.hide.label}}</a></li>
- <li><a href="#" title="{{$tools.delete.title}}" onclick="window.location.href='{{$tools.delete.url}}'; return false;">{{$tools.delete.label}}</a></li>
- </ul>
</div>
{{/if}}
<h2>{{$header}}</h2>
diff --git a/view/tpl/group_side.tpl b/view/tpl/group_side.tpl
index e58cf060d..35f79a07e 100755
--- a/view/tpl/group_side.tpl
+++ b/view/tpl/group_side.tpl
@@ -5,12 +5,10 @@
{{foreach $groups as $group}}
<li>
{{if $group.cid}}
- <a class="pull-right group-edit-tool fakelink" onclick="contactgroupChangeMember('{{$group.id}}','{{$group.enc_cid}}'); return true;"/>
- <i id="group-{{$group.id}}" class="fa {{if $group.ismember}}fa-check-square-o{{else}}fa-square-o{{/if}}"></i>
- </a>
+ <i id="group-{{$group.id}}" class="widget-nav-pills-checkbox fa {{if $group.ismember}}fa-check-square-o{{else}}fa-square-o{{/if}}" onclick="contactgroupChangeMember('{{$group.id}}','{{$group.enc_cid}}'); return true;"></i>
{{/if}}
{{if $group.edit}}
- <a class="pull-right group-edit-tool" href="{{$group.edit.href}}" title="{{$edittext}}"><i class="group-edit-icon fa fa-pencil"></i></a>
+ <a href="{{$group.edit.href}}" class="widget-nav-pills-icons" title="{{$edittext}}"><i class="fa fa-pencil"></i></a>
{{/if}}
<a{{if $group.selected}} class="group-selected"{{/if}} href="{{$group.href}}">{{$group.text}}</a>
</li>
diff --git a/view/tpl/help.tpl b/view/tpl/help.tpl
index 22180bda6..484fd67c9 100644
--- a/view/tpl/help.tpl
+++ b/view/tpl/help.tpl
@@ -2,7 +2,7 @@
<div class="section-title-wrapper">
<h2>{{$title}}</h2>
</div>
- <div class="section-content-wrapper">
+ <div class="section-content-wrapper" id="doco-content">
{{$content}}
</div>
</div>
diff --git a/view/tpl/wiki.tpl b/view/tpl/wiki.tpl
index 6d9f78800..bdce4f4be 100644
--- a/view/tpl/wiki.tpl
+++ b/view/tpl/wiki.tpl
@@ -11,9 +11,6 @@
<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>
</ul>
@@ -239,33 +236,6 @@
ev.preventDefault();
});
- $('#delete-page').click(function (ev) {
- if (window.wiki_resource_id === '' || window.wiki_page_name === '' || window.wiki_page_name === 'Home') {
- window.console.log('You must have a wiki page open in order to delete pages.');
- ev.preventDefault();
- 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},
- function (data) {
- if (data.success) {
- window.console.log('Page deleted successfully.');
- var url = window.location.href;
- if (url.substr(-1) == '/') url = url.substr(0, url.length - 2);
- url = url.split('/');
- url.pop();
- window.location = url.join('/');
- } else {
- alert('Error deleting page.'); // TODO: Replace alerts with auto-timeout popups
- window.console.log('Error deleting page.');
- }
- }, 'json');
- ev.preventDefault();
- });
-
function wiki_revert_page(commitHash) {
if (window.wiki_resource_id === '' || window.wiki_page_name === '') {
window.console.log('You must have a wiki page open in order to revert pages.');
@@ -409,14 +379,6 @@
'json');
};
- function wiki_show_new_page_form() {
- $('div[id^=\'edit-wiki-form-wrapper\']').hide();
- $('#edit-wiki-form-wrapper').hide();
- $('#new-wiki-form-wrapper').hide();
- $('#new-page-form-wrapper').toggle();
- return false;
- }
-
function wiki_show_edit_wiki_form(wiki_title, wiki_resource_id) {
window.wiki_resource_id = wiki_resource_id;
window.wiki_title = wiki_title;
diff --git a/view/tpl/wiki_page_list.tpl b/view/tpl/wiki_page_list.tpl
index 723cd0904..ef2b41490 100644
--- a/view/tpl/wiki_page_list.tpl
+++ b/view/tpl/wiki_page_list.tpl
@@ -4,7 +4,12 @@
<ul class="nav nav-pills nav-stacked">
{{if $pages}}
{{foreach $pages as $page}}
- <li><a href="/wiki/{{$channel}}/{{$wikiname}}/{{$page.url}}">{{$page.title}}</a></li>
+ <li id="{{$page.link_id}}">
+ {{if $page.resource_id && $canadd}}
+ <i class="widget-nav-pills-icons fa fa-trash-o drop-icons" onclick="wiki_delete_page('{{$page.title}}', '{{$page.url}}', '{{$page.resource_id}}', '{{$page.link_id}}')"></i>
+ {{/if}}
+ <a href="/wiki/{{$channel}}/{{$wikiname}}/{{$page.url}}">{{$page.title}}</a>
+ </li>
{{/foreach}}
{{/if}}
{{if $canadd}}
@@ -24,19 +29,47 @@
<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;
+ function(data) {
+ if(data.success) {
+ window.location = data.url;
} else {
- window.console.log('Error creating page.');
+ window.console.log('Error creating page.');
}
}, 'json');
ev.preventDefault();
});
+
+ function wiki_delete_page(wiki_page_name, wiki_page_url, wiki_resource_id, wiki_link_id) {
+ if(!confirm('Are you sure you want to delete the page: ' + wiki_page_name)) {
+ return;
+ }
+ $.post("wiki/{{$channel}}/delete/page", {name: wiki_page_url, resource_id: wiki_resource_id},
+ function (data) {
+ if (data.success) {
+ window.console.log('Page deleted successfully.');
+ if(wiki_page_url == window.wiki_page_name) {
+ var url = window.location.href;
+ if(url.substr(-1) == '/')
+ url = url.substr(0, url.length - 2);
+ url = url.split('/');
+ url.pop();
+ window.location = url.join('/');
+ }
+ else {
+ $('#' + wiki_link_id).remove();
+ }
+ } else {
+ alert('Error deleting page.'); // TODO: Replace alerts with auto-timeout popups
+ window.console.log('Error deleting page.');
+ }
+ }, 'json');
+ return false;
+ }
+
+ function wiki_show_new_page_form() {
+ $('#new-page-form-wrapper').toggle();
+ $('#id_pageName').focus();
+ return false;
+ }
</script>