Bugzilla – Attachment 186127 Details for
Bug 40453
Allow newly-added item type translations to be edited
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40453: Do not rely on hardcoded index
Bug-40453-Do-not-rely-on-hardcoded-index.patch (text/plain), 2.59 KB, created by
Jonathan Druart
on 2025-09-04 09:16:36 UTC
(
hide
)
Description:
Bug 40453: Do not rely on hardcoded index
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2025-09-04 09:16:36 UTC
Size:
2.59 KB
patch
obsolete
>From 33815731425a3acb6a932e248dea87ac25039df1 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 4 Sep 2025 11:14:35 +0200 >Subject: [PATCH] Bug 40453: Do not rely on hardcoded index > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > .../prog/en/modules/admin/localization.tt | 12 +++++++----- > 1 file changed, 7 insertions(+), 5 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/localization.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/localization.tt >index 67ab0b4c603..fd60bb4987f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/localization.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/localization.tt >@@ -103,8 +103,8 @@ > <th>Id</th> > <th>Entity</th> > <th>Code</th> >- <th>Language</th> >- <th>Translation</th> >+ <th class="lang">Language</th> >+ <th class="translation">Translation</th> > <th class="no-sort"> </th> > </tr> > </thead> >@@ -296,6 +296,9 @@ > } > }); > >+ const th_lang_index = document.querySelector('th.lang').cellIndex; >+ const th_translation_index = document.querySelector('th.translation').cellIndex; >+ > $("#add_translation").on('submit', function(e){ > e.preventDefault(); > let localization = { >@@ -312,9 +315,8 @@ > } else { > var new_row = table_dt.row.add( [ success.id, success.entity, success.code, success.lang, success.translation, "<a href=\"#\" class=\"btn btn-default btn-xs delete\"><i class=\"fa fa-trash-can\"></i> Delete</a>" ] ).draw().node(); > $( new_row ).attr("id", "row_id_" + success.id ).data("id", success.id ); >- /* Is there a better way to target contenteditable cells than by index? */ >- $( new_row.children[3] ).prop("contenteditable", true).addClass("lang") >- $( new_row.children[4] ).prop("contenteditable", true).addClass("translation") >+ $( new_row.children[th_lang_index] ).prop("contenteditable", true).addClass("lang") >+ $( new_row.children[th_translation_index] ).prop("contenteditable", true).addClass("translation") > show_message({ type: 'success_on_insert', data: success }); > } > }, >-- >2.34.1
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 40453
:
184408
|
185106
|
186126
| 186127