Opened 16 years ago
Closed 16 years ago
#8584 closed enhancement (fixed)
Update pagination links on edit-comments when approving/deleting/etc
Reported by: | mdawaffe | Owned by: | |
---|---|---|---|
Milestone: | 2.8 | Priority: | normal |
Severity: | normal | Version: | |
Component: | General | Keywords: | has-patch needs-testing |
Focuses: | Cc: |
Description
If you have 23 comments pending approval, and you approve 3 of them, the pagination links should reflect the fact that there is now only 1 page worth of comments.
Attached keeps track of how many total comments there are (for that comment view: all, pending, approved...) and keeps the displayed total and displayed page links up to date.
This also keeps the total and the pagination links up to date in the event of new comments coming in.
Method:
- When a comment is removed, the total decrements: no DB access needed.
- Comment totals are calculated explicitly from the DB when:
- The browser thinks the total number of pages is about to change.
- Randomly at a frequency of
1/$per_page
.
The first time to reset the total and page links to the real value, the second time to keep everyone honest.
- All AJAX data is sent back to the browser with a timestamp, so the JS can decide if the new total is more or less up to date than what it thinks.
Attachments (1)
Change History (2)
Note: See
TracTickets for help on using
tickets.
(In [10204]) Update pagination links on edit-comments when approving/deleting/etc. Hat tip: mdawaffe. Fixes #8584.