Commit 97dd339b authored by Eric Davis's avatar Eric Davis

[#191] Refactor: extract methods to helper

parent 4a3e32b0
......@@ -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
......@@ -38,12 +38,10 @@
<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;
<%= link_to_previous_search_page(@pagination_previous_date) %>&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"))) %>
<%= link_to_next_search_page(@pagination_next_date) %>
<% end %>
</center></p>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment