|
|
@@ -38,55 +38,67 @@ ${ commonheader(_('Search'), "search", user, "29px") | n,unicode }
|
|
|
|
|
|
<div class="container-fluid">
|
|
|
<div class="card">
|
|
|
- <%actionbar:render>
|
|
|
- <%def name="search()">
|
|
|
- <input type="text" placeholder="${_('Filter dashboards...')}" class="input-xlarge search-query" id="filterInput" data-bind="visible: collections().length > 0 && !isLoading()">
|
|
|
-
|
|
|
-
|
|
|
- <a data-bind="visible: collections().length > 0 && !isLoading()" class="btn" href="${ url('search:new_search') }" title="${ _('Create a new dashboard') }"><i class="fa fa-plus-circle"></i> ${ _('Dashboard') }</a>
|
|
|
- </%def>
|
|
|
-
|
|
|
- <%def name="creation()">
|
|
|
- </%def>
|
|
|
- </%actionbar:render>
|
|
|
-
|
|
|
- <div class="row-fluid" data-bind="visible: collections().length == 0 && !isLoading()">
|
|
|
- <div class="span10 offset1 center importBtn" style="cursor: pointer">
|
|
|
- <i class="fa fa-plus-circle waiting"></i>
|
|
|
- <h1 class="emptyMessage">
|
|
|
- ${ _('There are currently no dashboards defined.') }<br/>
|
|
|
- <a class="btn importBtn" href="${ url('search:new_search') }">
|
|
|
- <i class="fa fa-plus-circle"></i> ${ _('Dashboard') }
|
|
|
- </a>
|
|
|
- </h1>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="row-fluid" data-bind="visible: isLoading()">
|
|
|
- <div class="span10 offset1 center">
|
|
|
- <i class="fa fa-spinner fa-spin" style="font-size: 60px; color: #DDD"></i>
|
|
|
+ <%actionbar:render>
|
|
|
+ <%def name="search()">
|
|
|
+ <input type="text" placeholder="${_('Filter dashboards...')}" class="input-xlarge search-query" id="filterInput" data-bind="visible: collections().length > 0 && !isLoading()">
|
|
|
+
|
|
|
+
|
|
|
+ <a data-bind="visible: collections().length > 0 && !isLoading()" class="btn" href="${ url('search:new_search') }" title="${ _('Create a new dashboard') }"><i class="fa fa-plus-circle"></i> ${ _('Dashboard') }</a>
|
|
|
+ </%def>
|
|
|
+
|
|
|
+ <%def name="creation()">
|
|
|
+ </%def>
|
|
|
+ </%actionbar:render>
|
|
|
+
|
|
|
+ <div class="row-fluid" data-bind="visible: collections().length == 0 && !isLoading()">
|
|
|
+ <div class="span10 offset1 center importBtn pointer">
|
|
|
+ <i class="fa fa-plus-circle waiting"></i>
|
|
|
+ <h1 class="emptyMessage">
|
|
|
+ ${ _('There are currently no dashboards defined.') }<br/>
|
|
|
+ <a class="btn importBtn" href="${ url('search:new_search') }">
|
|
|
+ <i class="fa fa-plus-circle"></i> ${ _('Dashboard') }
|
|
|
+ </a>
|
|
|
+ </h1>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div class="row-fluid">
|
|
|
- <div class="span12">
|
|
|
- <p>
|
|
|
- <ul id="collections" data-bind="template: {name: 'collectionTemplate', foreach: filteredCollections}">
|
|
|
- </ul>
|
|
|
- </p>
|
|
|
+
|
|
|
+ <div class="row-fluid" data-bind="visible: isLoading()">
|
|
|
+ <div class="span10 offset1 center">
|
|
|
+ <i class="fa fa-spinner fa-spin spinner"></i>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
|
|
|
- <script id="collectionTemplate" type="text/html">
|
|
|
- <li class="collectionRow" data-bind="click: $root.editCollection" title="${ _('Click to edit') }">
|
|
|
- <div class="pull-right" style="margin-top: 10px;margin-right: 10px; cursor: pointer">
|
|
|
- <a data-bind="click: $root.copyCollection, clickBubble: false"><i class="fa fa-files-o"></i> ${_('Copy')}</a>
|
|
|
- <a data-bind="click: $root.markForDeletion, clickBubble: false"><i class="fa fa-times"></i> ${_('Delete')}</a>
|
|
|
- </div>
|
|
|
- <h4><img src="/search/static/art/icon_search_48.png" class="app-icon"/> <span data-bind="text: label"></span></h4>
|
|
|
- </li>
|
|
|
- </script>
|
|
|
+ <div class="row-fluid" data-bind="visible: collections().length > 0 && !isLoading()">
|
|
|
+ <table class="table table-condensed">
|
|
|
+ <thead>
|
|
|
+ <tr>
|
|
|
+ <th>
|
|
|
+ <span data-bind="click: toggleSelectAll, css: {'fa-check': !ko.utils.arrayFilter(filteredCollections(), function(collection) {return !collection.selected()}).length}" class="hueCheckbox fa"></span>
|
|
|
+ </th>
|
|
|
+ <th width="100%">
|
|
|
+ <span class="coll-heading">${_('Name')}</span>
|
|
|
+ <span class="pull-right collection-actions">
|
|
|
+ <a data-bind="click: $root.copyCollections, clickBubble: false"><i class="fa fa-files-o"></i> ${_('Copy')}</a>
|
|
|
+ <a data-bind="click: $root.markManyForDeletion, clickBubble: false"><i class="fa fa-times"></i> ${_('Delete')}</a>
|
|
|
+ </span>
|
|
|
+ </th>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody data-bind="foreach: filteredCollections">
|
|
|
+ <tr class="pointer">
|
|
|
+ <td data-bind="click: $root.toggleCollectionSelect.bind($root), clickBubble: false">
|
|
|
+ <span data-bind="css: {'fa-check': $root.filteredCollections()[$index()].selected()}" class="hueCheckbox fa"></span>
|
|
|
+ </td>
|
|
|
+ <td data-bind="text: label, click: $root.editCollection" title="${ _('Click to edit') }"></td>
|
|
|
+ </tr>
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
+<!-- PAUL - REMOVE before committing -->
|
|
|
+<pre data-bind="text: ko.toJSON($root, null, 2)"></pre>
|
|
|
|
|
|
<script id="importableTemplate" type="text/html">
|
|
|
<tr>
|
|
|
@@ -111,27 +123,25 @@ ${ commonheader(_('Search'), "search", user, "29px") | n,unicode }
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
-
|
|
|
-<style type="text/css">
|
|
|
- #collections {
|
|
|
- list-style-type: none;
|
|
|
- margin: 0;
|
|
|
- padding: 0;
|
|
|
- width: 100%;
|
|
|
- }
|
|
|
-
|
|
|
- .placeholder {
|
|
|
- height: 40px;
|
|
|
- background-color: #F5F5F5;
|
|
|
- border: 1px solid #E3E3E3;
|
|
|
- }
|
|
|
-</style>
|
|
|
+<div id="deleteManyModal" class="modal hide fade">
|
|
|
+ <div class="modal-header">
|
|
|
+ <a href="#" class="close" data-dismiss="modal">×</a>
|
|
|
+ <h3>${_('Confirm Delete')}</h3>
|
|
|
+ </div>
|
|
|
+ <div class="modal-body">
|
|
|
+ <p>${_('Are you sure you want to delete this collection?')}</p>
|
|
|
+ </div>
|
|
|
+ <div class="modal-footer">
|
|
|
+ <a class="btn" data-dismiss="modal">${_('No')}</a>
|
|
|
+ <a id="deleteModalBtn" class="btn btn-danger disable-feedback" data-bind="click: deleteCollections">${_('Yes')}</a>
|
|
|
+ </div>
|
|
|
+</div>
|
|
|
|
|
|
<script src="/static/ext/js/knockout-min.js" type="text/javascript" charset="utf-8"></script>
|
|
|
<script src="/search/static/js/collections.ko.js" type="text/javascript" charset="utf-8"></script>
|
|
|
|
|
|
-<script type="text/javascript">
|
|
|
-
|
|
|
+<script>
|
|
|
+//(function () {
|
|
|
var appProperties = {
|
|
|
labels: [],
|
|
|
listCollectionsUrl: "${ url("search:admin_collections") }?format=json",
|
|
|
@@ -146,14 +156,13 @@ ${ commonheader(_('Search'), "search", user, "29px") | n,unicode }
|
|
|
viewModel.updateCollections();
|
|
|
|
|
|
var orderedCores;
|
|
|
- serializeList();
|
|
|
|
|
|
- function serializeList() {
|
|
|
+ (function serializeList() {
|
|
|
orderedCores = [];
|
|
|
$("#collections li").each(function () {
|
|
|
orderedCores.push($(this).data("collection"));
|
|
|
});
|
|
|
- }
|
|
|
+ }());
|
|
|
|
|
|
var filter = -1;
|
|
|
$("#filterInput").on("keyup", function () {
|
|
|
@@ -163,7 +172,7 @@ ${ commonheader(_('Search'), "search", user, "29px") | n,unicode }
|
|
|
}, 300);
|
|
|
});
|
|
|
|
|
|
- $("#deleteModal").modal({
|
|
|
+ $("#deleteModal, #deleteManyModal").modal({
|
|
|
show: false
|
|
|
});
|
|
|
|
|
|
@@ -174,7 +183,7 @@ ${ commonheader(_('Search'), "search", user, "29px") | n,unicode }
|
|
|
});
|
|
|
|
|
|
$(document).on("collectionDeleted", function () {
|
|
|
- $("#deleteModal").modal("hide");
|
|
|
+ $("#deleteModal, #deleteManyModal").modal("hide");
|
|
|
$("#deleteModalBtn").button("reset");
|
|
|
$(document).trigger("info", "${ _("Collection deleted successfully.") }");
|
|
|
});
|
|
|
@@ -187,7 +196,12 @@ ${ commonheader(_('Search'), "search", user, "29px") | n,unicode }
|
|
|
$("#deleteModal").modal('show');
|
|
|
});
|
|
|
|
|
|
+ $(document).on("confirmDeleteMany", function () {
|
|
|
+ $("#deleteManyModal").modal('show');
|
|
|
+ });
|
|
|
+
|
|
|
});
|
|
|
+//}());
|
|
|
</script>
|
|
|
|
|
|
${ commonfooter(messages) | n,unicode }
|