% if (param 'q') {
% content 'main' => begin
%     unless (param 'snippet') {
<div style="clear: both">
%       my $url = url_with->query(['p' => '{page}']);
%       my $pages = search->total_pages;
  <div id="pagination"><%= pagination(search->start_page, $pages, $url) =%></div>
  <p class="found">Found
% my $found = search->total_results;
% if ($found == -1) {
%   $found = 'unknown amount of';
% } elsif (search->timeExceeded) {
%   $found = 'more than ' . $found;
% }; 
    <span id="total-results"><%= $found %> matches</span>
    <% if (search->benchmark) { %> in <%= search->benchmark %><% } %>
  </p>
</div>
%= include 'query'
%= include 'api-communication'
%     };

% if (search->total_results != 0 && search->results->size) {
<div id="search">
<ol class="align-left">
%=    search_results begin
%=      include 'match', match => $_
%     end
</ol>
</div>
% };
% end

% content 'javascript' => begin
%=   javascript begin

var openLi = function (e) {
  this.classList.add("active");
  e.stopPropagation();
};

var closeLi = function (e) {
  this.parentNode.parentNode.classList.remove("active");
  e.stopPropagation();
};

var inactiveLi = document.querySelectorAll("#search > ol > li:not(.active)");
for (var i = 0; i < inactiveLi.length; i++) {
  inactiveLi[i].addEventListener("click", openLi, false);
  inactiveLi[i].getElementsByClassName("close")[0].addEventListener("click", closeLi, false);
};

%   end
% end
% };
