diff --git a/app/helpers/custom_message_settings_helper.rb b/app/helpers/custom_message_settings_helper.rb index 326088c..3fab8dd 100644 --- a/app/helpers/custom_message_settings_helper.rb +++ b/app/helpers/custom_message_settings_helper.rb @@ -16,7 +16,7 @@ def normal_mode_input_fields(setting, lang) custom_messages_hash.each do |k, v| content += content_tag(:p) do content_tag(:label, k) + - text_field_tag("settings[custom_messages[#{k}]]", v.to_s) + + text_field_tag("settings[custom_messages][#{k}]", v.to_s) + link_to_function('', '$(this).closest("p").remove();', class: 'icon icon-del clear-key-link') end end diff --git a/app/views/custom_message_settings/_messages.html.erb b/app/views/custom_message_settings/_messages.html.erb index 3987440..d8486d4 100644 --- a/app/views/custom_message_settings/_messages.html.erb +++ b/app/views/custom_message_settings/_messages.html.erb @@ -40,7 +40,7 @@ function AddMessageInputField(key, val){ $('').attr({ type: 'text', value: val.replace(/.*: /, ''), - name: 'settings[custom_messages[' + key + ']]' + name: 'settings[custom_messages][' + key + ']' }).appendTo($('#edit-custom-messages .tabular p:first')); $('').attr({ class: 'icon icon-del clear-key-link', diff --git a/init.rb b/init.rb index 4064bc4..592fb2b 100644 --- a/init.rb +++ b/init.rb @@ -6,7 +6,7 @@ p = Redmine::Plugin.register :redmine_message_customize do name 'Redmine message customize plugin' - version '0.1.8' + version '0.1.9' description 'This is a plugin that allows messages in Redmine to be overwritten from the admin view' author 'Far End Technologies Corporation' url 'https://github.com/farend/redmine_message_customize' diff --git a/test/functional/custom_message_settings_controller_test.rb b/test/functional/custom_message_settings_controller_test.rb index 2b54b6b..05c9e90 100644 --- a/test/functional/custom_message_settings_controller_test.rb +++ b/test/functional/custom_message_settings_controller_test.rb @@ -22,6 +22,7 @@ def test_edit assert_select 'a#tab-normal' assert_select 'a#tab-yaml' end + assert_select 'div#edit-custom-messages input[name=?]', 'settings[custom_messages][label_home]' end def test_edit_except_admin_user @request.session[:user_id] = 2