Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Post history pagination & permalinks #1230

Draft
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

Oaphi
Copy link
Member

@Oaphi Oaphi commented Oct 30, 2023

Closes #1229

@Oaphi Oaphi added area: ruby Changes to server-side code area: html/css/js Changes to front-end code labels Oct 30, 2023
@Oaphi Oaphi self-assigned this Oct 30, 2023
@Oaphi Oaphi force-pushed the 0valt/1229/post-history-fixes branch from 532b4fb to fd300a7 Compare October 30, 2023 09:31
@Oaphi Oaphi force-pushed the 0valt/1229/post-history-fixes branch from 09447f3 to 4767da3 Compare October 30, 2023 09:59
@trichoplax
Copy link
Contributor

I'm not familiar with Rails' pagination functionality so I don't know how to completely fix this, but just in case it helps I believe the numbering of the edits can be calculated using information which already seems to be available:

  • @count: the total number of edits
  • per_page: the number to show per page in the pagination
  • @page: the currently displayed page

If you know the number of an item within the current page (from 1 to per_page), say number_in_page, then the number to display (the edit number) can be calculated as:

@count - (number_in_page - 1) - (@page - 1) * per_page

The 1s are due to number_in_page and @page being 1-indexed rather than 0-indexed. They can be omitted if those variables are actually 0-indexed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: html/css/js Changes to front-end code area: ruby Changes to server-side code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Persistent references to post history entries & pagination
2 participants