Bugzilla – Attachment 107058 Details for
Bug 25630
More capitalization and terminology fixes for system preferences
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25909: Recent change to datatables JS in the OPAC causes errors
Bug-25909-Recent-change-to-datatables-JS-in-the-OP.patch (text/plain), 8.24 KB, created by
Katrin Fischer
on 2020-07-18 16:47:46 UTC
(
hide
)
Description:
Bug 25909: Recent change to datatables JS in the OPAC causes errors
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2020-07-18 16:47:46 UTC
Size:
8.24 KB
patch
obsolete
>From 7625232114d068421c233978d7fb95b90a75b7e8 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Thu, 2 Jul 2020 12:50:17 +0000 >Subject: [PATCH] Bug 25909: Recent change to datatables JS in the OPAC causes > errors > >This patch reverts some changes made by Bug 25287 which prematurely >introduced the double-underscore i18n function. The i18n features >haven't been fully implemented in the OPAC. > >Some lines are reverts to the previous version, and some are additions, >for instance where Bug 25287 introduced new DataTables features and a >new string translation is required. > >In addition to i18n changes, the patch also reverts the default >configuration of DataTables in the OPAC so that the "dom" configuration >option is set back to "t." This turns off features like pagination >buttons, filters, etc. which were previously disabled by default. > >Enabling these features requires revision to the OPAC CSS in order for >them to display well. > >To test, apply the patch and view a page in the OPAC which includes a >DataTable. For instance: checkouts on the "your summary" page, serial >issues on the "full subscription history" page. > >Tables should display correctly and sorting should work correctly. There >should be no other DataTables controls visible. > >To test translatability: > >To test, apply the patch and test that the correct strings are >translatable. In this example I'm testing fr-FR: > > - Update a translation: > > > cd misc/translator > > perl translate update fr-FR > > - Open the corresponding .po file for the strings pulled from > the templates e.g. misc/translator/po/fr-FR-opac-bootstrap.po > - Locate strings pulled from bootstrap/en/includes/datatables.inc > for translation, e.g.: > > #. SCRIPT > #: opac-tmpl/bootstrap/en/includes/datatables.inc:4 > msgid "Copy to clipboard" > msgstr "" > > - Edit the "msgstr" string however you want (it's just for testing) > - Install the updated translation: > > > perl translate install fr-FR > >Open the translated copy of datatables.inc and confirm that the >translated string appears. > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> > >https://bugs.koha-community.org/show_bug.cgi?id=25630 >--- > .../opac-tmpl/bootstrap/en/includes/datatables.inc | 8 +++- > koha-tmpl/opac-tmpl/bootstrap/js/datatables.js | 48 +++++++++++----------- > 2 files changed, 30 insertions(+), 26 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/datatables.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/datatables.inc >index d711ee5bfa..c8f18ec072 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/datatables.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/datatables.inc >@@ -2,7 +2,6 @@ > [% USE Asset %] > [% Asset.js("lib/jquery/plugins/jquery.dataTables.min.js") | $raw %] > <script> >-//<![CDATA[ > var MSG_DT_FIRST = _("First"); > var MSG_DT_LAST = _("Last"); > var MSG_DT_NEXT = _("Next"); >@@ -16,7 +15,12 @@ > var MSG_DT_PROCESSING = _("Processing..."); > var MSG_DT_SEARCH = _("Search:"); > var MSG_DT_ZERO_RECORDS = _("No matching records found"); >+ var MSG_DT_COPY_TO_CLIPBOARD = _("Copy to clipboard"); >+ var MSG_DT_COPY_KEYS = _("Press <i>ctrl</i> or <i>â</i> + <i>C</i> to copy the table data<br>to your system clipboard.<br><br>To cancel, click this message or press escape."); >+ var MSG_DT_COPIED_ROWS = _("Copied %d rows to clipboard"); >+ var MSG_DT_COPIED_ONE_ROW = _("Copied one row to clipboard"); >+ var MSG_CLEAR_FILTER = _("Clear filter"); >+ var MSG_DT_ALL = _("All"); > var CONFIG_EXCLUDE_ARTICLES_FROM_SORT = _("a an the"); >-//]]> > </script> > [% Asset.js("js/datatables.js") | $raw %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/datatables.js b/koha-tmpl/opac-tmpl/bootstrap/js/datatables.js >index 19f2944dde..bc51357529 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/js/datatables.js >+++ b/koha-tmpl/opac-tmpl/bootstrap/js/datatables.js >@@ -5,38 +5,38 @@ > // // other settings > // } ) ); > var dataTablesDefaults = { >- "oLanguage": { >- "oPaginate": { >- "sFirst" : __('First'), >- "sLast" : __('Last'), >- "sNext" : __('Next'), >- "sPrevious" : __('Previous'), >+ "language": { >+ "paginate": { >+ "first" : window.MSG_DT_FIRST || "First", >+ "last" : window.MSG_DT_LAST || "Last", >+ "next" : window.MSG_DT_NEXT || "Next", >+ "previous" : window.MSG_DT_PREVIOUS || "Previous" > }, >- "sEmptyTable" : __('No data available in table'), >- "sInfo" : __('Showing _START_ to _END_ of _TOTAL_ entries'), >- "sInfoEmpty" : __('No entries to show'), >- "sInfoFiltered" : __('(filtered from _MAX_ total entries)'), >- "sLengthMenu" : __('Show _MENU_ entries'), >- "sLoadingRecords" : __('Loading...'), >- "sProcessing" : __('Processing...'), >- "sSearch" : __('Search:'), >- "sZeroRecords" : __('No matching records found'), >+ "emptyTable" : window.MSG_DT_EMPTY_TABLE || "No data available in table", >+ "info" : window.MSG_DT_INFO || "Showing _START_ to _END_ of _TOTAL_ entries", >+ "infoEmpty" : window.MSG_DT_INFO_EMPTY || "No entries to show", >+ "infoFiltered" : window.MSG_DT_INFO_FILTERED || "(filtered from _MAX_ total entries)", >+ "lengthMenu" : window.MSG_DT_LENGTH_MENU || "Show _MENU_ entries", >+ "loadingRecords" : window.MSG_DT_LOADING_RECORDS || "Loading...", >+ "processing" : window.MSG_DT_PROCESSING || "Processing...", >+ "search" : window.MSG_DT_SEARCH || "Search:", >+ "zeroRecords" : window.MSG_DT_ZERO_RECORDS || "No matching records found", > buttons: { >- "copyTitle" : __('Copy to clipboard'), >- "copyKeys" : __('Press <i>ctrl</i> or <i>â</i> + <i>C</i> to copy the table data<br>to your system clipboard.<br><br>To cancel, click this message or press escape.'), >+ "copyTitle" : window.MSG_DT_COPY_TO_CLIPBOARD || "Copy to clipboard", >+ "copyKeys" : window.MSG_DT_COPY_KEYS || "Press <i>ctrl</i> or <i>â</i> + <i>C</i> to copy the table data<br>to your system clipboard.<br><br>To cancel, click this message or press escape.", > "copySuccess": { >- _: __('Copied %d rows to clipboard'), >- 1: __('Copied one row to clipboard'), >+ _: window.MSG_DT_COPIED_ROWS || "Copied %d rows to clipboard", >+ 1: window.MSG_DT_COPIED_ONE_ROW || "Copied one row to clipboard", > } > } > }, >- "dom": '<"top pager"<"table_entries"ilp><"table_controls"fB>>tr<"bottom pager"ip>', >+ "dom": 't', > "buttons": [{ > fade: 100, > className: "dt_button_clear_filter", >- titleAttr: __('Clear filter'), >+ titleAttr: window.MSG_CLEAR_FILTER, > enabled: false, >- text: '<i class="fa fa-lg fa-remove"></i> <span class="dt-button-text">' + __('Clear filter') + '</span>', >+ text: '<i class="fa fa-lg fa-remove"></i> <span class="dt-button-text">' + window.MSG_CLEAR_FILTER + '</span>', > available: function ( dt ) { > // The "clear filter" button is made available if this test returns true > if( dt.settings()[0].aanFeatures.f ){ // aanFeatures.f is null if there is no search form >@@ -48,7 +48,7 @@ var dataTablesDefaults = { > node.addClass("disabled"); > } > }], >- "aLengthMenu": [[10, 20, 50, 100, -1], [10, 20, 50, 100, __('All')]], >+ "aLengthMenu": [[10, 20, 50, 100, -1], [10, 20, 50, 100, window.MSG_DT_ALL || "All" ]], > "iDisplayLength": 20, > initComplete: function( settings) { > var tableId = settings.nTable.id >@@ -355,7 +355,7 @@ jQuery.extend( jQuery.fn.dataTableExt.oSort, { > * from a configuration file (in English, "a," "an," and "the") > */ > >- var config_exclude_articles_from_sort = __('a an the'); >+ var config_exclude_articles_from_sort = window.CONFIG_EXCLUDE_ARTICLES_FROM_SORT || "a an the"; > if (config_exclude_articles_from_sort){ > var articles = config_exclude_articles_from_sort.split(" "); > var rpattern = ""; >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 25630
:
105459
|
105460
|
105461
|
105462
|
105463
|
105464
|
105465
|
105466
|
105467
|
105468
|
106230
|
106231
|
106232
|
106233
|
106234
|
106235
|
106236
|
106237
|
106238
|
106239
|
106266
|
107058
|
107059
|
107060
|
107061
|
107062
|
107063
|
107064
|
107065
|
107066
|
107067
|
107068
|
108260
|
108261
|
108262
|
108263
|
108264
|
108265
|
108266
|
108267
|
108268
|
108269
|
108270
|
108910
|
108911
|
108912
|
108913
|
108914
|
108915
|
108916
|
108917
|
108918
|
108919
|
108920
|
109446
|
109447
|
109448
|
109449
|
109450
|
109451
|
109452
|
109453
|
109454
|
109455
|
109456