diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2022-02-13 13:02:47 +0100 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2022-02-13 13:02:47 +0100 |
commit | 5d07953def22327815c0caab94cf17d07eacc57b (patch) | |
tree | 84d15a29ddd18c2a5bf53c67f46942b4cd924548 /.gitignore | |
parent | 2fa078eaea0c0ca39fd4547cd34c9560cd56c540 (diff) | |
download | gigologadmin-5d07953def22327815c0caab94cf17d07eacc57b.tar.gz gigologadmin-5d07953def22327815c0caab94cf17d07eacc57b.tar.bz2 gigologadmin-5d07953def22327815c0caab94cf17d07eacc57b.zip |
Remember filter settings when paginating.
This patch does changes quite a bit of how things work under the hood.
It changes the filter settings from using POST to using query args in a
GET request instead.
This has some challenges:
1. The query args from the form will overwrite any query args in the
original URL, so we have to keep the query args that was passed in as
hidden fields in the form.
2. Since we try to keep the passed in query args, we need to filter out
the query args that we expect to set in the form, otherwise query
args that are dropped by the form will still be present as hidden
args.
Not too happy about how this works tbh, but at least it seems to work
reasonably well for now.
I've also renamed the args set by the form to make the URL a bit nicer,
i.e "city" instead of "selectcity" etc for the query arg keys.
I've also refactored quite a bit to make the code more manageable. Like
using the view helper to create the month selector, so it's consistent
with the others, and remembers it's selection. (I also simplified it to
simply list the months from jan to dec, instead of starting at the
current month. If it's important to keep the old behaviour I'll change
it back.)
There's a few problems still with this implementation.
1. It only works in the admin-section for now. Not sure why. Probably
because shortcodes...
2. In the admin section it gains the `cid` and `pid` query args that
should not be there. Not sure why.
3. If we change the filters while being on a page larger than the total
number of pages after the filter change, we stay on the page even if
it's not a valid page after the filter change. This should be trivial
to fix.
Diffstat (limited to '.gitignore')
0 files changed, 0 insertions, 0 deletions