Fixed articles views.
This commit is contained in:
parent
fd361090b4
commit
f30e57dd49
18 changed files with 159 additions and 153 deletions
|
|
@ -47,13 +47,13 @@ module ApplicationHelper
|
|||
end
|
||||
|
||||
def sort_td_class_helper(param)
|
||||
result = 'class="sortup"' if params[:sort] == param
|
||||
result = 'class="sortdown"' if params[:sort] == param + "_reverse"
|
||||
result = 'sortup' if params[:sort] == param.to_s
|
||||
result = 'sortdown' if params[:sort] == param.to_s + "_reverse"
|
||||
result
|
||||
end
|
||||
|
||||
def sort_link_helper(text, key, options = {})
|
||||
per_page = options[:per_page] || 10
|
||||
per_page = options[:per_page] || @per_page
|
||||
remote = options[:remote].nil? ? true : options[:remote]
|
||||
key += "_reverse" if params[:sort] == key
|
||||
url = url_for(:sort => key, :page => nil, :per_page => per_page)
|
||||
|
|
|
|||
|
|
@ -11,4 +11,9 @@ module ArticlesHelper
|
|||
classes += " just_updated" if article.recently_updated && article.availability
|
||||
classes
|
||||
end
|
||||
|
||||
# Flatten search params, used in import from external database
|
||||
def search_params
|
||||
Hash[params[:search].map { |k,v| [k, (v.is_a?(Array) ? v.join(" ") : v)] }]
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue