app/helpers/mdwa_helper.rb in mdd-3.1.1 vs app/helpers/mdwa_helper.rb in mdd-3.1.2
- old
+ new
@@ -1,13 +1,14 @@
module MdwaHelper
- def pagination_footer( object_list )
+ def pagination_footer( object_list, parameters = {} )
+ parameters[:per_page] = WillPaginate.per_page if parameters[:per_page].blank?
options = [
- [WillPaginate.per_page, WillPaginate.per_page],
- [(WillPaginate.per_page*2.5).to_i, (WillPaginate.per_page*2.5).to_i],
- [(WillPaginate.per_page*5).to_i, (WillPaginate.per_page*5).to_i],
+ [parameters[:per_page], parameters[:per_page]],
+ [(parameters[:per_page]*2.5).to_i, (parameters[:per_page]*2.5).to_i],
+ [(parameters[:per_page]*5).to_i, (parameters[:per_page]*5).to_i],
[I18n.t('will_paginate.all'), object_list.count]
]
html = []
html << '<div id="pagination">'
@@ -41,8 +42,16 @@
else
ext = file_name[ file_name.length - 1]
end
return "#{path}/#{size}/#{ext}_file.png"
+ end
+
+ def check_all_th
+ check_box_tag "check_all", '', false, { :onclick => "checkOrUncheckAll( $(\"#check_all\").prop( \"checked\" ) )" }
+ end
+
+ def check_all_td( id, checked = false )
+ check_box_tag "cid[]", id, checked, { :id => "cb#{id}", :class => "cid" }
end
end
\ No newline at end of file