Skip to content

Commit 7443017

Browse files
authored
Merge pull request #3325 from metacpan/jordanedward/show-search-hits-at-top
show search hits at page top
2 parents a25a15b + 232029a commit 7443017

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

root/search.tx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@
44
%% after content_classes -> { ' search-results' }
55
%% override content -> {
66
<h3 class="search-results-header">Search results for "[% $search_query %]"</h3>
7+
8+
%% if $pageset && $pageset.total_entries {
9+
<div class="smaller">
10+
[% $pageset.total_entries | format_number %]
11+
[% pluralize("result", $pageset.total_entries) %]
12+
[% if $took { %] ([% $took / 1000 %] seconds)[% } %]
13+
</div>
14+
<hr>
15+
%% }
16+
717
%% if $authors.total {
818
<div class="author-results">
919
<ul class="authors clearfix">

t/controller/search.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ test_psgi app, sub {
4343
my $tx = tx($res);
4444
$tx->like( '/html/head/title', qr/moose/, 'title includes search term' );
4545
my $release
46-
= $tx->find_value(qq!//$xpath{search_results}//div[1]/h3/a/\@href!);
46+
= $tx->find_value(qq!//$xpath{search_results}//div[2]/h3/a/\@href!);
4747
ok( $release, "found release $release" );
4848

4949
{

0 commit comments

Comments
 (0)