|
|
@@ -46,6 +46,14 @@ ${ commonheader(_('Search'), "search", user, "40px") | n,unicode }
|
|
|
</%def>
|
|
|
</%actionbar:render>
|
|
|
|
|
|
+ <div class="row-fluid" data-bind="visible: collections().length == 0">
|
|
|
+ <div class="span10 offset1 center">
|
|
|
+
|
|
|
+ <i class="icon-plus-sign waiting"></i>
|
|
|
+ <h1 class="emptyMessage">${ _('There are currently no collections defined.') }<br/>${ _('Please click on Import to add one or more.') }</h1>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
<div class="row-fluid">
|
|
|
<div class="span12">
|
|
|
<ul id="collections" data-bind="template: {name: 'collectionTemplate', foreach: filteredCollections}">
|
|
|
@@ -61,14 +69,18 @@ ${ commonheader(_('Search'), "search", user, "40px") | n,unicode }
|
|
|
|
|
|
<script id="collectionTemplate" type="text/html">
|
|
|
<li style="cursor: move">
|
|
|
- <a data-bind="attr: {'href': absoluteUrl}" class="pull-right" style="margin-top: 10px;margin-right: 10px"><i class="icon-edit"></i> ${_('Edit')}</a>
|
|
|
+ <div class="pull-right" style="margin-top: 10px;margin-right: 10px; cursor: pointer">
|
|
|
+ <a data-bind="attr: {'href': absoluteUrl}"><i class="icon-edit"></i> ${_('Edit')}</a>
|
|
|
+ <a data-bind="click: $root.copyCollection"><i class="icon-copy"></i> ${_('Copy')}</a>
|
|
|
+ <a data-bind="click: $root.markForDeletion"><i class="icon-remove"></i> ${_('Delete')}</a>
|
|
|
+ </div>
|
|
|
<h4><i class="icon-list"></i> <span data-bind="text: label"></span></h4>
|
|
|
</li>
|
|
|
</script>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
-<div id="importDialog" class="modal hide fade">
|
|
|
+<div id="importModal" class="modal hide fade">
|
|
|
<div class="modal-header">
|
|
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
|
|
<h3>${ _('Import Collections and Cores') }</h3>
|
|
|
@@ -87,7 +99,7 @@ ${ commonheader(_('Search'), "search", user, "40px") | n,unicode }
|
|
|
</div>
|
|
|
<div class="modal-footer">
|
|
|
<a href="javascript:void(0)" class="btn" data-dismiss="modal">${ _('Cancel') }</a>
|
|
|
- <button href="javascript:void(0)" class="btn btn-primary" data-bind="enable: selectedImportableCollections().length > 0 || selectedImportableCores().length > 0, click: importCollectionsAndCores">${ _('Import Selected') }</button>
|
|
|
+ <button id="importModalBtn" href="javascript:void(0)" class="btn btn-primary disable-feedback" data-bind="enable: selectedImportableCollections().length > 0 || selectedImportableCores().length > 0, click: importCollectionsAndCores">${ _('Import Selected') }</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
@@ -100,6 +112,21 @@ ${ commonheader(_('Search'), "search", user, "40px") | n,unicode }
|
|
|
</tr>
|
|
|
</script>
|
|
|
|
|
|
+<div id="deleteModal" 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: deleteCollection">${_('Yes')}</a>
|
|
|
+ </div>
|
|
|
+</div>
|
|
|
+
|
|
|
+
|
|
|
<style type="text/css">
|
|
|
#collections {
|
|
|
list-style-type: none;
|
|
|
@@ -132,7 +159,9 @@ ${ commonheader(_('Search'), "search", user, "40px") | n,unicode }
|
|
|
labels: [],
|
|
|
listCollectionsUrl: "${ url("search:admin_collections") }?format=json",
|
|
|
listImportablesUrl: "${ url("search:admin_collections_import") }?format=json",
|
|
|
- importUrl: "${ url("search:admin_collections_import") }"
|
|
|
+ importUrl: "${ url("search:admin_collections_import") }",
|
|
|
+ deleteUrl: "${ url("search:admin_collection_delete") }",
|
|
|
+ copyUrl: "${ url("search:admin_collection_copy") }"
|
|
|
}
|
|
|
|
|
|
var viewModel = new SearchCollectionsModel(appProperties);
|
|
|
@@ -169,25 +198,57 @@ ${ commonheader(_('Search'), "search", user, "40px") | n,unicode }
|
|
|
}, 300);
|
|
|
});
|
|
|
|
|
|
- $("#importDialog").modal({
|
|
|
+ $("#importModal").modal({
|
|
|
+ show: false
|
|
|
+ });
|
|
|
+
|
|
|
+ $("#deleteModal").modal({
|
|
|
show: false
|
|
|
});
|
|
|
|
|
|
% if is_redirect:
|
|
|
- showImportDialog();
|
|
|
+ showImportModal();
|
|
|
% endif
|
|
|
|
|
|
$("#importBtn").on("click", function () {
|
|
|
- showImportDialog();
|
|
|
+ showImportModal();
|
|
|
});
|
|
|
|
|
|
- function showImportDialog() {
|
|
|
- $("#importDialog").modal('show');
|
|
|
+ function showImportModal() {
|
|
|
+ $("#importModal").modal("show");
|
|
|
viewModel.updateImportables();
|
|
|
}
|
|
|
|
|
|
+ $(document).on("importing", function () {
|
|
|
+ var _btn = $("#importModalBtn");
|
|
|
+ _btn.attr("data-loading-text", _btn.text() + " ...");
|
|
|
+ _btn.button("loading");
|
|
|
+ });
|
|
|
+
|
|
|
$(document).on("imported", function () {
|
|
|
- $("#importDialog").modal('hide');
|
|
|
+ $("#importModal").modal("hide");
|
|
|
+ $("#importModalBtn").button("reset");
|
|
|
+ $.jHueNotify.info("${ _("Collections imported successfully.") }");
|
|
|
+ });
|
|
|
+
|
|
|
+ $(document).on("deleting", function () {
|
|
|
+ var _btn = $("#deleteModalBtn");
|
|
|
+ _btn.attr("data-loading-text", _btn.text() + " ...");
|
|
|
+ _btn.button("loading");
|
|
|
+ });
|
|
|
+
|
|
|
+ $(document).on("collectionDeleted", function () {
|
|
|
+ $("#deleteModal").modal("hide");
|
|
|
+ $("#deleteModalBtn").button("reset");
|
|
|
+ $.jHueNotify.info("${ _("Collection deleted successfully.") }");
|
|
|
+ });
|
|
|
+
|
|
|
+ $(document).on("collectionCopied", function () {
|
|
|
+ $.jHueNotify.info("${ _("Collection copied successfully.") }");
|
|
|
+ });
|
|
|
+
|
|
|
+ $(document).on("confirmDelete", function () {
|
|
|
+ $("#deleteModal").modal('show');
|
|
|
});
|
|
|
|
|
|
});
|