| % content 'main' => begin |
| % unless (param 'snippet') { |
| <div style="clear: both"> |
| % my $url = url_with->query(['p' => '{page}']); |
| % my $pages = (stash('search.totalResults') / (stash('search.itemsPerPage') || 1)); |
| % $pages = $pages < 0 ? 0 : $pages; |
| <div id="pagination"><%= pagination(stash('search.startPage'), $pages, $url) =%></div> |
| <span id="total-results"><%= commify(stash('search.totalResults')) %> matches</span> |
| <% if (stash 'search.bm.hit') { %> in <%= stash 'search.bm.hit' %> (<%= stash 'search.bm.result' %>)<% } %> |
| <ol class="left-aligned"> |
| %= include 'match', match => $_ |
| % content 'javascript' => begin |
| $("#search > ol > li:not(.active)").on("click", function (e) { |
| $(this).addClass('active'); |
| $("#search > ol > li:not(.active) > ul > li.close").on("click", function (e) { |
| $(this.parentNode.parentNode).removeClass('active'); |