Merge branch 'ticket/master/191-next-prev-search-results'

pull/351/head
Eric Davis 14 years ago
commit b646a731fb
  1. 10
      app/helpers/search_helper.rb
  2. 10
      app/views/search/_pagination.html.erb
  3. 14
      app/views/search/index.rhtml
  4. 3
      public/stylesheets/application.css

@ -57,4 +57,14 @@ module SearchHelper
end
('<ul>' + links.map {|link| content_tag('li', link)}.join(' ') + '</ul>') unless links.empty?
end
def link_to_previous_search_page(pagination_previous_date)
link_to_content_update('&#171; ' + l(:label_previous),
params.merge(:previous => 1, :offset => pagination_previous_date.strftime("%Y%m%d%H%M%S")))
end
def link_to_next_search_page(pagination_next_date)
link_to_content_update(l(:label_next) + ' &#187;',
params.merge(:previous => nil, :offset => pagination_next_date.strftime("%Y%m%d%H%M%S")))
end
end

@ -0,0 +1,10 @@
<div class="search-pagination">
<p>
<% if pagination_previous_date %>
<%= link_to_previous_search_page(pagination_previous_date) %>
<% end %>
<% if pagination_next_date %>
<%= link_to_next_search_page(pagination_next_date) %>
<% end %>
</p>
</div>

@ -24,6 +24,9 @@
</div>
<h3><%= l(:label_result_plural) %> (<%= @results_by_type.values.sum %>)</h3>
<%= render :partial => 'pagination', :locals => {:pagination_previous_date => @pagination_previous_date, :pagination_next_date => @pagination_next_date } %>
<dl id="search-results">
<% @results.each do |e| %>
<dt class="<%= e.event_type %>">
@ -36,15 +39,6 @@
</dl>
<% end %>
<p><center>
<% if @pagination_previous_date %>
<%= link_to_content_update('&#171; ' + l(:label_previous),
params.merge(:previous => 1, :offset => @pagination_previous_date.strftime("%Y%m%d%H%M%S"))) %>&nbsp;
<% end %>
<% if @pagination_next_date %>
<%= link_to_content_update(l(:label_next) + ' &#187;',
params.merge(:previous => nil, :offset => @pagination_next_date.strftime("%Y%m%d%H%M%S"))) %>
<% end %>
</center></p>
<%= render :partial => 'pagination', :locals => {:pagination_previous_date => @pagination_previous_date, :pagination_next_date => @pagination_next_date } %>
<% html_title(l(:label_search)) -%>

@ -331,6 +331,9 @@ dt.time-entry { background-image: url(../images/time.png); }
#search-results dt.issue.closed { background-image: url(../images/ticket_checked.png); }
.search-pagination { text-align: center; }
.search-pagination a {padding: 0 5px; }
div#roadmap .related-issues { margin-bottom: 1em; }
div#roadmap .related-issues td.checkbox { display: none; }
div#roadmap .wiki h1:first-child { display: none; }

Loading…
Cancel
Save