diff --git a/app/helpers/manage_products_helper.rb b/app/helpers/manage_products_helper.rb index 0e8d8cc..a6f3957 100644 --- a/app/helpers/manage_products_helper.rb +++ b/app/helpers/manage_products_helper.rb @@ -241,6 +241,10 @@ module ManageProductsHelper end end + def remove_qualifier_button + button_to_function(:delete, content_tag('span', _('Delete qualifier')), "jQuery(this).parents('tr').remove()") + end + def select_unit(object) collection_select(object.class.name.downcase, :unit_id, environment.units, :id, :singular, {:include_blank => _('Select the unit')}) end diff --git a/app/views/manage_products/_certifiers_for_selection.rhtml b/app/views/manage_products/_certifiers_for_selection.rhtml index e41279f..07ae53a 100644 --- a/app/views/manage_products/_certifiers_for_selection.rhtml +++ b/app/views/manage_products/_certifiers_for_selection.rhtml @@ -1,5 +1,4 @@ -<%= select_certifiers(@qualifier) + - button_to_function(:delete, content_tag('span', 'Delete qualifier'), "jQuery(this).parents('tr').remove()") %> +<%= select_certifiers(@qualifier) + remove_qualifier_button %> <% javascript_tag do %> jQuery('#product-qualifiers-list *').removeClass('small-loading') <% end %> diff --git a/app/views/manage_products/_edit_info.rhtml b/app/views/manage_products/_edit_info.rhtml index da85131..66caa94 100644 --- a/app/views/manage_products/_edit_info.rhtml +++ b/app/views/manage_products/_edit_info.rhtml @@ -39,8 +39,7 @@ <%= select_qualifiers(@product, qualifier.id) %>