Bug 28058

Summary: Move JavaScript out of columns_settings.inc into separate file
Product: Koha Reporter: Owen Leonard <oleonard>
Component: TemplatesAssignee: Owen Leonard <oleonard>
Status: ASSIGNED --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: david, jonathan.druart, testopia
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 28055, 34913    
Bug Blocks:    
Attachments: Bug 28058: Move javascript out of columns_settings.inc into separate file
Bug 28058: Move javascript out of columns_settings.inc into separate file
Bug 28058: Move javascript out of columns_settings.inc into separate file
Bug 28058: (follow-up) Make same change in the OPAC; Use "table_settings" as file name

Description Owen Leonard 2021-03-30 17:21:24 UTC
Having a separate file for JavaScript makes the file cache-able and lint-able. This patch will move the <script> block (which contains no template markup) into a separate file.
Comment 1 Owen Leonard 2021-03-30 17:24:19 UTC
I'm also moving the contents of table_filters.js into the new JS file (tablesettings.js). table_filters.js contained only two functions and was only used on pages which already include columns_settings.inc.
Comment 2 Owen Leonard 2021-03-30 17:38:28 UTC Comment hidden (obsolete)
Comment 3 David Nind 2021-04-03 20:56:57 UTC Comment hidden (obsolete)
Comment 4 Katrin Fischer 2021-04-03 22:10:25 UTC Comment hidden (obsolete)
Comment 5 Jonathan Druart 2021-04-06 13:39:11 UTC
Shouldn't we also apply the changes to the OPAC?
Shouldn't the file be named table_settings.js instead?
Comment 6 Owen Leonard 2021-04-07 00:20:30 UTC
I called it "columns_settings.js" because it corresponds to "columns_settings.inc" and I thought it made sense for them to be the same. I'm happy to change it. I could also change the name of columns_settings.inc at the same time.

Anyone have preferences?

I can do the same in the OPAC but I think that can happen on another bug without holding up this one.
Comment 7 Jonathan Druart 2021-04-07 14:27:53 UTC
(In reply to Owen Leonard from comment #6)
> I called it "columns_settings.js" because it corresponds to
> "columns_settings.inc" and I thought it made sense for them to be the same.
> I'm happy to change it. I could also change the name of columns_settings.inc
> at the same time.
> 
> Anyone have preferences?

Everything should now be "tables_settings".

> I can do the same in the OPAC but I think that can happen on another bug
> without holding up this one.

For consistency I would prefer to keep both in sync. We can do it on a separate bug report but I will push them together.
Comment 8 Owen Leonard 2021-04-08 12:32:45 UTC Comment hidden (obsolete)
Comment 9 David Nind 2021-05-17 10:48:54 UTC
Patch no longer applies 8-(..