aboutsummaryrefslogtreecommitdiffstats
path: root/view
diff options
context:
space:
mode:
Diffstat (limited to 'view')
-rw-r--r--view/tpl/wiki.tpl16
-rw-r--r--view/tpl/wikilist.tpl11
2 files changed, 24 insertions, 3 deletions
diff --git a/view/tpl/wiki.tpl b/view/tpl/wiki.tpl
index 641b3256a..6ee4a7f89 100644
--- a/view/tpl/wiki.tpl
+++ b/view/tpl/wiki.tpl
@@ -30,6 +30,7 @@
</div>
<button id="new-wiki-submit" class="btn btn-primary" type="submit" name="submit" >Create Wiki</button>
</div>
+ <div>{{$acl}}</div>
</form>
<div class="clear"></div>
<hr>
@@ -74,8 +75,6 @@
</div>
</div>
-<div>{{$acl}}</div>
-
<script>
$(document).ready(function () {
// Show Edit tab first. Otherwise the Ace editor does not load.
@@ -98,4 +97,17 @@
ev.preventDefault();
});
+function wiki_delete_wiki(wikiName, resource_id) {
+ if(!confirm('Are you sure you want to delete the entire wiki: ' + JSON.stringify(wikiName))) {
+ return;
+ }
+ $.post("wiki/{{$channel}}/delete/wiki", {resource_id: resource_id}, function (data) {
+ if (data.success) {
+ window.console.log('Wiki deleted');
+ // Refresh list and redirect page as necessary
+ } else {
+ window.console.log('Error deleting wiki.');
+ }
+ }, 'json');
+}
</script>
diff --git a/view/tpl/wikilist.tpl b/view/tpl/wikilist.tpl
index d5f2d0c04..f3cea489d 100644
--- a/view/tpl/wikilist.tpl
+++ b/view/tpl/wikilist.tpl
@@ -2,7 +2,16 @@
<h3>{{$header}}</h3>
<ul class="nav nav-pills nav-stacked">
{{foreach $wikis as $wiki}}
- <li><a href="/wiki/{{$channel}}/{{$wiki.title}}">{{$wiki.title}}</a></li>
+ <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.title}}" title="View {{$wiki.title}}">View</a></li>
+ <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>
+ </ul>
+ </li>
{{/foreach}}
</ul>
</div>