lib/tr8n/extensions/action_view_extension.rb in tr8n-3.1.1 vs lib/tr8n/extensions/action_view_extension.rb in tr8n-3.1.2

- old
+ new

@@ -322,38 +322,10 @@ else img_tag.html_safe end end - def tr8n_will_paginate(collection = nil, options = {}) - will_paginate(collection, options.merge(:previous_label => tr("&laquo; Previous", "Previous entries in a list", {}, options), - :next_label => tr("Next &raquo;", "Next entries in a list", {}, options))).html_safe - end - - def tr8n_page_entries_info(collection, options = {}) - entry_name = options[:entry_name] || (collection.empty? ? 'entry' : collection.first.class.name.underscore.sub('_', ' ')) - - if collection.total_pages < 2 - case collection.size - when 0 - tr("None found", "Paginator no entries message", {}, options) - when 1 - tr("Displaying [bold: 1] #{entry_name}", "Paginator one page message", {}, options) - else - tr("Displaying [bold: all {count}] #{entry_name.pluralize}", "Paginator all entries message", {:count => collection.size}, options) - end - else - tr("Displaying #{entry_name.pluralize} [bold: {start_num} - {end_num}] of [bold: {total_count}] in total", - "Paginator custom message", { - :start_num => collection.offset + 1, - :end_num => collection.offset + collection.length, - :total_count => collection.total_entries - }, options - ) - end - end - def tr8n_select_month(date, options = {}, html_options = {}) month_names = options[:use_short_month] ? Tr8n::Config.default_abbr_month_names : Tr8n::Config.default_month_names select_month(date, options.merge( :use_month_names => month_names.collect{|month_name| Tr8n::Language.translate(month_name, options[:description] || "Month name")} ), html_options) @@ -368,9 +340,13 @@ ret end def tr8n_button_tag(label, function, opts = {}) link_to_function("<span>#{label}</span>".html_safe, function, :class => "tr8n_grey_button tr8n_pcb") + end + + def tr8n_paginator_tag(collection, options) + render :partial => "/tr8n/common/paginator", :locals => {:collection => collection, :options => options} end private def generate_sitemap(sections, options = {})