Round the search time and make sure the count is shown #2453

This commit is contained in:
James Cole
2019-08-21 04:37:17 +02:00
parent c76337926b
commit 22f110df8d
6 changed files with 11 additions and 20 deletions

View File

@@ -89,7 +89,7 @@ class SearchController extends Controller
$searcher->parseQuery($fullQuery);
$searcher->setLimit((int)config('firefly.search_result_limit'));
$groups = $searcher->searchTransactions();
$searchTime = $searcher->searchTime(); // in seconds
$searchTime = round($searcher->searchTime(), 3); // in seconds
try {
$html = view('search.search', compact('groups','searchTime'))->render();

View File

@@ -21,6 +21,9 @@
var count = 0;
$(document).ready(function () {
updateListButtons();
});
function updateListButtons() {
// top button to select all / deselect all:
$('input[name="select-all"]').change(function () {
if (this.checked) {
@@ -46,9 +49,7 @@ $(document).ready(function () {
countChecked();
updateActionButtons();
});
});
}
/**
*

View File

@@ -42,17 +42,6 @@ function presentSearchResults(data) {
$('.search_box').find('.overlay').remove();
$('.search_results').html(data.html).show();
$('.select_all_single').unbind('change').change(function () {
countChecked();
});
// make sure select button works:
$('input[name="select_all"]').change(function () {
if (this.checked) {
checkAll();
countChecked();
} else {
uncheckAll();
countChecked();
}
});
updateListButtons();
}

View File

@@ -151,7 +151,7 @@ TODO: hide and show columns
<button type="button" class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{{ 'actions'|_ }} <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<ul class="dropdown-menu dropdown-menu-right">
<li><a href="#" class="mass-edit"><i class="fa fa-fw fa-pencil"></i> <span>{{ 'mass_edit'|_ }}</span></a></li>
<li><a href="#" class="bulk-edit"><i class="fa fa-fw fa-pencil-square-o"></i> <span>{{ 'bulk_edit'|_ }}</span></a></li>
<li><a href="#" class="mass-delete"><i class="fa fa-fw fa-trash"></i> <span>{{ 'mass_delete'|_ }}</span></a></li>

View File

@@ -123,7 +123,8 @@
var searchQuery = "{{ fullQuery|escape('js') }}";
var searchUri = "{{ route('search.search') }}";
</script>
<script type="text/javascript" src="v1/js/ff/search/index.js?v={{ FF_VERSION }}"></script>
{# required for groups.twig #}
<script type="text/javascript" src="v1/js/ff/list/groups.js?v={{ FF_VERSION }}"></script>
<script type="text/javascript" src="v1/js/ff/search/index.js?v={{ FF_VERSION }}"></script>
{% endblock %}

View File

@@ -1,6 +1,6 @@
<p>
<p class="search_count">
{{ trans('firefly.search_found_transactions', {count: transactions.count, time: searchTime}) }}
{{ trans('firefly.search_found_transactions', {count: groups.count, time: searchTime}) }}
</p>
{% include 'list.groups' %}