diff --git a/admin/themes/default/js/history.js b/admin/themes/default/js/history.js index 1d5bd5195..0d0ca9d79 100644 --- a/admin/themes/default/js/history.js +++ b/admin/themes/default/js/history.js @@ -169,6 +169,17 @@ function fillSummaryResult(summary) { } } +function showResults(doShow) { + console.log("EMPTY"); + if (doShow) { + $(".search-summary").show(); + $(".container").show(); + } else { + $(".search-summary").hide(); + $(".container").hide(); + } +} + function fillHistoryResult(ajaxParam) { // console.log(current_param); // $(".tab .search-line").remove(); @@ -178,8 +189,9 @@ function fillHistoryResult(ajaxParam) { dataType: "JSON", data: ajaxParam, beforeSend: function () { - $(".tab .search-line").remove(); + showResults(false); $(".loading").removeClass("hide"); + $(".noResults").hide(); }, success: function (raw_data) { @@ -191,14 +203,21 @@ function fillHistoryResult(ajaxParam) { //clear lines before refill - - var id = 0; - data.forEach(line => { - lineConstructor(line, id, imageDisplay) - id++ - }); + if (data.length > 0) { + var id = 0; + data.forEach(line => { + lineConstructor(line, id, imageDisplay) + id++ + }); + + fillSummaryResult(summary); + showResults(true); + $(".noResults").hide(); + } else { + showResults(false); + $(".noResults").show(); + } - fillSummaryResult(summary); }, error: function (e) { console.log(e); diff --git a/admin/themes/default/template/history.tpl b/admin/themes/default/template/history.tpl index 99d55df8e..d2c6a2051 100644 --- a/admin/themes/default/template/history.tpl +++ b/admin/themes/default/template/history.tpl @@ -149,6 +149,12 @@ const guest_id = {$guest_id}; {if !empty($navbar) }{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if} +
+ +
+
+ {'No results'|@translate} +
@@ -210,9 +216,6 @@ const guest_id = {$guest_id};
-
- -
@@ -278,7 +281,7 @@ jQuery(document).ready( function() {