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

[#191] Refactor: extract methods to helper

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