[#191] Refactor: extract methods to helper
This commit is contained in:
parent
4a3e32b0f4
commit
97dd339bbb
|
@ -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('« ' + 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) + ' »',
|
||||
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('« ' + l(:label_previous),
|
||||
params.merge(:previous => 1, :offset => @pagination_previous_date.strftime("%Y%m%d%H%M%S"))) %>
|
||||
<%= link_to_previous_search_page(@pagination_previous_date) %>
|
||||
<% end %>
|
||||
<% if @pagination_next_date %>
|
||||
<%= link_to_content_update(l(:label_next) + ' »',
|
||||
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>
|
||||
|
||||
|
|
Loading…
Reference in New Issue