The tables on parcel.pl default to show only the first five items in the table, and librarians must click the a link to display all the items. Every time the page is reloaded, the table gets re-collapsed, and the librarian must again click the link. Parcel.pl should remember which way the table is set and keep it that way until it is changed again.
Created attachment 9372 [details] [review] Bug 8028 - Make table collapsing on parcel.pl sticky The tables on parcel.pl default to show only the first five items in the table, and librarians must click the a link to display all the items. Every time the page is reloaded, the table gets re-collapsed, and the librarian must again click the link. Parcel.pl should remember which way the table is set and keep it that way until it is changed again. This is accomplished by adding two cookies for this page, one for each table. This cookie stores the state of the table ( collapsed, or uncollapsed ) and sets each table to the correct state on each page load.
Hi Kyle, wouldn't it work to pass around the setting instead of using cookies?
(In reply to comment #2) > Hi Kyle, wouldn't it work to pass around the setting instead of using > cookies? That would work for refreshing the page, but not for moving from say parcel.pl to the item details page and back. It could be done, but would require far more code and I don't see any advantage to that. The alternative would be a system preference, but then the librarians would be in the opposite situation, where if they wanted it collapsed, they'd have to click the link every time.
Created attachment 10797 [details] [review] Bug 8028 - Make table collapsing on parcel.pl sticky The tables on parcel.pl default to show only the first five items in the table, and librarians must click the a link to display all the items. Every time the page is reloaded, the table gets re-collapsed, and the librarian must again click the link. Parcel.pl should remember which way the table is set and keep it that way until it is changed again. This is accomplished by adding two cookies for this page, one for each table. This cookie stores the state of the table ( collapsed, or uncollapsed ) and sets each table to the correct state on each page load. Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Works as expected. But a "funny" behaviour, if I have only 1 item (or < 6): All 1 items are displayed. Click here to show only the first 5 items. and Only the first 5 items are displayed. Click here to show all 1 items.
If anyone has a suggestion for a good way to word this, I will write a patch to update the language.
Kyle, Thanks for signed-off ! > If anyone has a suggestion for a good way to word this, I will write a patch to update the language. I think we can just check if the number of items are > 5 to display links.
Created attachment 10878 [details] [review] Bug 8028 - Make table collapsing on parcel.pl sticky - Hide link for 5 or fewer items.
Created attachment 10926 [details] [review] Bug 8028 - Make table collapsing on parcel.pl sticky - Hide link for 5 or fewer items. Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
QA comment: I'm unable to understand & reproduce the problem and the solution. Could you give me more explanations ? A screenshot ? 2 comments (that will maybe be removed when I understand & reproduce): * is using a cookie the best way to do that ? * isn't DataTable jquery plugin what we should use ?
(In reply to comment #9) > QA comment: I'm unable to understand & reproduce the problem and the > solution. Could you give me more explanations ? A screenshot ? Currently, if there are more than 5 items in the table on parcel.pl, it only shows you the first 5. You must click a link to show more than 5. This patch makes the page 'remember' if you would prefer to see just the first 5, or more than 5. > 2 comments (that will maybe be removed when I understand & reproduce): > * is using a cookie the best way to do that ? I think it is the best way to accomplish this. The idea is to give the librarians the choice. A system preference would force all the librarians to have the same behavior ( 5 or more than 5 ). Additionally, parameter passing won't work without adding the parameter to *every* page in Koha, which sounds like a far worse solution. > * isn't DataTable jquery plugin what we should use ? Nobody as implemented DataTables here, and it is outside the scope of this bug.
Adds a couple small cookies for stickiness, and some logic to handle them. Followup patch fixes conditional nesting. Marking Passed QA.
mmm... I made a basket with 6 lines, and had another one with 2 lines pending. When I reach the parcel.pl page, I see the 8 pending lines directly, and no link to collapse/expand. Am I missing something ? (I recieved 4 of them, and saw no change)
Kyle, ping on my comment 12. I need to test that before pushing !
Created attachment 12059 [details] [review] Bug 8028 - Followup
(In reply to comment #12) > mmm... I made a basket with 6 lines, and had another one with 2 lines > pending. When I reach the parcel.pl page, I see the 8 pending lines > directly, and no link to collapse/expand. > Am I missing something ? > > (I recieved 4 of them, and saw no change) Good catch. I've attach a small followup to fix the issue.
This time it's OK, patch pushed to master !