|
|
@@ -28,9 +28,6 @@ ${ commonheader(_('Search'), "search", user, "29px") | n,unicode }
|
|
|
|
|
|
<div class="search-bar" style="height: 30px">
|
|
|
<div class="pull-right" style="margin-top: 4px; margin-right: 20px">
|
|
|
- <button type="button" class="btn importBtn">
|
|
|
- <i class="fa fa-plus-circle"></i> ${ _('Import Index') }
|
|
|
- </button>
|
|
|
<a class="btn importBtn" href="${ url('indexer:collections') }">
|
|
|
<i class="fa fa-database"></i> ${ _('Indexes') }
|
|
|
</a>
|
|
|
@@ -56,7 +53,12 @@ ${ commonheader(_('Search'), "search", user, "29px") | n,unicode }
|
|
|
<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 collections defined.') }<br/><a href="javascript:void(0)" class="importBtn">${ _('Click here to add') }</a> ${ _('one or more.') }</h1>
|
|
|
+ <h1 class="emptyMessage">
|
|
|
+ ${ _('There are currently no collections defined.') }<br/>
|
|
|
+ <a class="btn importBtn" href="${ url('search:new_search') }">
|
|
|
+ <i class="fa fa-file-o"></i> ${ _('Dashboard') }
|
|
|
+ </a>
|
|
|
+ </h1>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="row-fluid" data-bind="visible: isLoading()">
|
|
|
@@ -83,31 +85,8 @@ ${ commonheader(_('Search'), "search", user, "29px") | n,unicode }
|
|
|
</li>
|
|
|
</script>
|
|
|
</div>
|
|
|
-
|
|
|
</div>
|
|
|
|
|
|
-<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>
|
|
|
- </div>
|
|
|
- <div class="modal-body">
|
|
|
- <img src="/static/art/spinner.gif" data-bind="visible: isLoadingImportables()" />
|
|
|
- <div data-bind="visible: !isLoadingImportables()">
|
|
|
- <h5>${ _('Collections') }</h5>
|
|
|
- <div class="alert" data-bind="visible: importableCollections().length == 0">${ _('All available collections from the Solr URL in hue.ini have been imported.') }</div>
|
|
|
- <table data-bind="visible: importableCollections().length > 0, template: {name: 'importableTemplate', foreach: importableCollections}"></table>
|
|
|
-
|
|
|
- <h5 style="margin-top: 20px">${ _('Cores') }</h5>
|
|
|
- <div class="alert" data-bind="visible: importableCores().length == 0">${ _('All available cores from the Solr URL in hue.ini have been imported.') }</div>
|
|
|
- <table data-bind="visible: importableCores().length > 0, template: {name: 'importableTemplate', foreach: importableCores}"></table>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="modal-footer">
|
|
|
- <a href="javascript:void(0)" class="btn" data-dismiss="modal">${ _('Cancel') }</a>
|
|
|
- <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>
|
|
|
|
|
|
<script id="importableTemplate" type="text/html">
|
|
|
<tr>
|
|
|
@@ -156,8 +135,6 @@ ${ commonheader(_('Search'), "search", user, "29px") | n,unicode }
|
|
|
var appProperties = {
|
|
|
labels: [],
|
|
|
listCollectionsUrl: "${ url("search:admin_collections") }?format=json",
|
|
|
- listImportablesUrl: "${ url("search:admin_collections_import") }?format=json",
|
|
|
- importUrl: "${ url("search:admin_collections_import") }",
|
|
|
deleteUrl: "${ url("search:admin_collection_delete") }",
|
|
|
copyUrl: "${ url("search:admin_collection_copy") }"
|
|
|
}
|
|
|
@@ -186,47 +163,10 @@ ${ commonheader(_('Search'), "search", user, "29px") | n,unicode }
|
|
|
}, 300);
|
|
|
});
|
|
|
|
|
|
- $("#importModal").modal({
|
|
|
- show: false
|
|
|
- });
|
|
|
-
|
|
|
$("#deleteModal").modal({
|
|
|
show: false
|
|
|
});
|
|
|
|
|
|
- % if is_redirect:
|
|
|
- showImportModal();
|
|
|
- % endif
|
|
|
-
|
|
|
- $(".importBtn").on("click", function () {
|
|
|
- showImportModal();
|
|
|
- });
|
|
|
-
|
|
|
- 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 (e, data) {
|
|
|
- $("#importModal").modal("hide");
|
|
|
- $("#importModalBtn").button("reset");
|
|
|
- if (data.status == 0){
|
|
|
- $(document).trigger("info", data.message + "<br/>${_('Imported: ')}" + data.imported.join(", "));
|
|
|
- }
|
|
|
- else if (data.status == 1){
|
|
|
- $(document).trigger("info", data.message + "<br/>${_('Imported: ')}" + data.imported.join(", ") + "<br/>${_('Not imported: ')}" + data.notImported.join(", "));
|
|
|
- }
|
|
|
- else {
|
|
|
- $(document).trigger("error", data.message+ "<br/>${_('Not imported: ')}" + data.notImported.join(", "));
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
$(document).on("deleting", function () {
|
|
|
var _btn = $("#deleteModalBtn");
|
|
|
_btn.attr("data-loading-text", _btn.text() + " ...");
|