@@ -, +, @@
- Apply the patch and go to Administration -> Item types.
- Edit an item type.
- Click the translate link.
- Add a new translation. The table of translations should be updated
with your new translation.
- Test the "Delete" link corresponding to your new entry. It should
work correctly.
---
.../prog/en/modules/admin/localization.tt | 84 ++++++++++++++++------
1 file changed, 61 insertions(+), 23 deletions(-)
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/localization.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/localization.tt
@@ -4,37 +4,68 @@
[% INCLUDE 'doc-head-open.inc' %]
Koha › Localization
[% INCLUDE 'doc-head-close.inc' popup => 1 %]
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
Id
Entity
Code
-
Lang
+
Language
Translation
-
+
@@ -50,7 +81,9 @@
[% END %]
-
+
+
+
[% MACRO jsinclude BLOCK %]
[% INCLUDE 'datatables.inc' %]
@@ -117,7 +150,7 @@
}
},
error: function (data) {
- $(cell).css('background-color', '#FF0000');
+ $(cell).css('background-color', '#FF9090');
if ( $(cell).hasClass('lang') ) {
$(cell).text(data.lang)
} else if ( $(cell).hasClass('translation') ) {
@@ -137,7 +170,7 @@
show_message({ type: 'success_on_delete', data: data });
},
error: function (data) {
- $(cell).css('background-color', '#FF0000');
+ $(cell).css('background-color', '#FF9090');
show_message({ type: 'error_on_delete', data: data });
},
});
@@ -147,10 +180,15 @@
$(".dialog").hide();
var table = $("#localization").DataTable($.extend(true, {}, dataTablesDefaults, {
+ "dom": 't',
+ "columnDefs": [
+ { 'sortable': false, 'targets': [ 'NoSort' ] }
+ ],
'bPaginate': false,
+ 'autoWidth': false,
}));
- var languages_select = $('');
+ var languages_select = $('');
[% FOR language IN languages %]
[% FOR sublanguage IN language.sublanguages_loop %]
var option;
@@ -197,7 +235,7 @@
send_update_request( data, this );
});
- $("a.delete").on('click', function(e){
+ $("body").on("click", "a.delete", function(e){
e.preventDefault();
if ( confirm(_("Are you sure you want to delete this translation?")) ) {
var td = $(this).parent();
@@ -222,8 +260,8 @@
if ( data.error ) {
show_message({ type: 'error_on_insert', data: data });
} else {
- // FIXME Should append the delete link
- table.row.add( [ data.id, data.entity, data.code, data.lang, data.translation, "" ] ).draw();
+ var new_row = table.row.add( [ data.id, data.entity, data.code, data.lang, data.translation, " Delete" ] ).draw().node();
+ $( new_row ).attr("id", "row_id_" + data.id ).data("id", data.id );
show_message({ type: 'success_on_insert', data: data });
}
},
--