Bug 10632 - Enable datatables for courses and course details in the OPAC
Summary: Enable datatables for courses and course details in the OPAC
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Course reserves (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Kyle M Hall (khall)
QA Contact: Testopia
URL:
Keywords:
Depends on: 10566
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-23 16:13 UTC by Kyle M Hall (khall)
Modified: 2015-06-04 23:33 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 10632 - Enable datatables for courses and course details in the OPAC (5.07 KB, patch)
2013-07-23 16:17 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 10632 - Enable datatables for courses and course details in the OPAC (5.22 KB, patch)
2014-10-09 16:47 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 10632 - Enable datatables for courses and course details in the OPAC (5.39 KB, patch)
2014-10-10 12:48 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 10632 [Follow-up] Enable datatables for courses and course details in the OPAC (13.13 KB, patch)
2014-10-10 12:48 UTC, Owen Leonard
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 10632 [Follow-up] Enable datatables for courses and course details in the OPAC (13.15 KB, patch)
2014-10-10 13:01 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 10632 - Enable datatables for courses and course details in the OPAC (5.40 KB, patch)
2014-10-11 15:32 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 10632 [Follow-up] Enable datatables for courses and course details in the OPAC (13.20 KB, patch)
2014-10-11 15:32 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 10632 [Follow-up] Enable datatables for courses and course details in the OPAC (13.14 KB, patch)
2014-11-11 19:02 UTC, Owen Leonard
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle M Hall (khall) 2013-07-23 16:13:51 UTC
We should use datatables for the courses and course items tables. This will make the tables sortable and searchable from the client side.
Comment 1 Kyle M Hall (khall) 2013-07-23 16:17:29 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2013-07-23 18:21:08 UTC
DataTables won't be styled correctly without changes to the CSS and the addition of DataTables-related images. That needs to be taken care of before this patch goes in.
Comment 3 Kyle M Hall (khall) 2014-10-03 13:40:12 UTC
Owen, what did I do here differently from bug 10634? Can you describe what I need to do? Is there an existing example in Koha I can use as a pattern? Thanks!
Comment 4 Owen Leonard 2014-10-03 14:40:37 UTC
I can see a couple of things offhand which need to be addressed:

- Apply to the Bootstrap theme
- Use the new DataTables include file

> DataTables won't be styled correctly without changes to the CSS and the
> addition of DataTables-related images. That needs to be taken care of before
> this patch goes in.

This patch doesn't work properly for me anymore in master (missing datatables-strings.inc file), so I can't say for sure but it sounds like the existing CSS file in the OPAC doesn't (fully?) handle the pagination menu controls.
Comment 5 Kyle M Hall (khall) 2014-10-09 16:47:29 UTC Comment hidden (obsolete)
Comment 6 Owen Leonard 2014-10-10 12:48:33 UTC Comment hidden (obsolete)
Comment 7 Owen Leonard 2014-10-10 12:48:42 UTC Comment hidden (obsolete)
Comment 8 Kyle M Hall (khall) 2014-10-10 13:01:12 UTC Comment hidden (obsolete)
Comment 9 Jonathan Druart 2014-10-11 15:32:36 UTC
Created attachment 32250 [details] [review]
Bug 10632 - Enable datatables for courses and course details in the OPAC

We should use datatables for the courses and course items tables. This
will make the tables sortable and searchable from the client side.

Test Plan:
1) Apply this patch
2) View the courses in the OPAC, try sorting and searching
3) View the course details for a course, try sorting and searching the items.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signing off, but have a follow-up to address some missing stuff.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 10 Jonathan Druart 2014-10-11 15:32:42 UTC Comment hidden (obsolete)
Comment 11 Jonathan Druart 2014-10-11 15:35:14 UTC
I am not sure about removing the "unused" code in the DT css file.
This code is maybe used in the patch queue (NSO, SO, PQA), but I am not sure about that.
Actually I think we need the same file for the OPAC and the intranet, to be maintained easily. But it's not a big deal, it could be reinserted late.
Comment 12 Owen Leonard 2014-10-11 20:42:38 UTC
(In reply to Jonathan Druart from comment #11)
> I am not sure about removing the "unused" code in the DT css file.

I hesitated as well, but I think of it this way: Keeping the CSS to a minimum is something which may take extra effort on our part, but it benefits the users of Koha. We shouldn't maintain two identical CSS files in the OPAC and staff client just because it makes things easier for us as developers.
Comment 13 Jonathan Druart 2014-10-11 20:54:50 UTC
(In reply to Owen Leonard from comment #12)
> We shouldn't maintain two identical CSS files in
> the OPAC and staff client just because it makes things easier for us as
> developers.

Yes but... developers are lazy ;)
Comment 14 Owen Leonard 2014-11-11 19:02:04 UTC
Created attachment 33465 [details] [review]
Bug 10632 [Follow-up] Enable datatables for courses and course details in the OPAC

This follow-up adds some style improvements and corrects some errors in
the previous patch:

- The path to datatables.css has been corrected
- Unused CSS has been removed from datatables.css (particularly related
  to pagination controls, which are currently unused in the OPAC).
- Style has been added to datatables.css to make the table search form
  look better.
- The configuration of the course details table has been enhanced to
  include a title sort which ignores articles and date sorting according
  to the "title-string" method for date format agnostic sorting.
- Unrelated: A message <div> has been modified to have the correct style
  for the Bootstrap theme.

To test you should have multiple courses and at least one course with
multiple reserves. Clear your browser cache if necessary and view the
list of courses in the OPAC. All table sorting should work correctly, as
should the table search form.

View the details of a course which has multiple reserves. All sorting
should work correctly, including title sort excluding articles. Sorting
by date due should work correctly for any dateformat system preference
setting.

View the details of a course which has no reserves. You should see a "No
reserves" message box with a style consistent with similar messages in
the Bootstrap OPAC.

View other sorted tables in the OPAC to confirm that the CSS changes
have not negatively affected their appearance: opac-user.pl for
instance, or opac-detail.pl.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 15 Tomás Cohen Arazi (tcohen) 2014-11-11 20:30:45 UTC
Patches pushed to master.

Thanks Kyle and Owen!