jarun/buku

The "last page" link in bukuserver doesn't use the current index

LeXofLeviafan opened this issue · 8 comments

When clicking on the "last page" link in bukuserver pagination (»), the page that's being opened isn't the current last page but the one that was last at the time of the current page rendering; if the bookmarks DB had been updated since then (i.e. there was enough bookmarks added/removed to change the amount of pages), the link would be pointing on a page which isn't the last one, or even a non-existing one.

A correct way to open the last page in the list would be to send a parameter requesting the actual last page (such as page=last), to which the server could redirect to the current last page (e.g. using HTTP 302), or the URL could be updated by the client in-browser.

i can't decide about this one

first this is flask-admin feature

quick search for last page show no issue (only first page, but i will continue to search it later)

if we want to implement this, it mean several things

  • edit route from flask-admin to accept page=last query
  • edit the link for that character. i suspect we have to create new html template that inherit flask-admin template

looking at that i don't know if the change is worth it

@jarun comment?

e: TIL it is called double angle quotation mark

https://en.wikipedia.org/wiki/Guillemet

jarun commented

Please leave it as it is. Not a big deal.

i think this issue can be closed for now

reopen this if flask-admin have easier method to implement page=last query or someone can hack flask-admin just like above description

…After I've done some fiddling with flask/flask-admin, I can say for sure that this URL can be modified at runtime (i.e. after the page is rendered) to point at a custom redirect endpoint (or just set page number as -1 and add a conditional redirect in get_list).

…Correction: apparently redirects only work as return values, so get_list doesn't support those (and using it to precalculate the list requires preprocessing parameters).

…I've made a working implementation in a feature branch; it can be adopted as a pull request should you decide to go through with it.

jarun commented

Please raise the PR.

reopen this because there is ongoing pr