page_entries_info with :per_page => 1 #15

Closed
slepafrika opened this Issue Nov 4, 2009 · 1 comment

2 participants

@slepafrika

first of all thanks for sharing this great stuff. I am using this, amongst others, to skip through a stock of input forms of the same type. That means I am showing only 1 item per page and the user is able to jump or skip through the whole stock. To improve the visualisation I had to change your code of "page_entries_info" like that:

  if collection.length == 1
    %{Displaying #{entry_name} <b>%d</b> of <b>%d</b> in total} % [
      collection.offset + 1,
      collection.total_entries
    ]
  else
    %{Displaying #{entry_name.pluralize} <b>%d&nbsp;-&nbsp;%d</b> of <b>%d</b> in total} % [
      collection.offset + 1,
      collection.offset + collection.length,
      collection.total_entries
    ]
  end

Maybe you like to change this as well for others.

@mislav
Owner

Hey! This is a pretty specific use case. I think I'll leave the helper as-is, and let people customize it with localization files. If that's not enough, I encourange anyone to write their own view helper.

@mislav mislav closed this Jan 10, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment