Commit bad8766a116471895981c18d724ed11042f1907c
1 parent
d552ea62
Exists in
master
and in
22 other branches
Update every old syntax of form_for and javascript_tag
Showing
13 changed files
with
13 additions
and
13 deletions
Show diff stats
app/views/invite/_dialog_wait_loading.html.erb
app/views/manage_products/_certifiers_for_selection.html.erb
1 | <%= select_certifiers(@qualifier) + remove_qualifier_button %> | 1 | <%= select_certifiers(@qualifier) + remove_qualifier_button %> |
2 | -<% javascript_tag do %> | 2 | +<%= javascript_tag do %> |
3 | jQuery('#product-qualifiers-list *').removeClass('small-loading') | 3 | jQuery('#product-qualifiers-list *').removeClass('small-loading') |
4 | <% end %> | 4 | <% end %> |
app/views/manage_products/_display_name.html.erb
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | <h2><%= @product.name_with_unit %></h2> | 2 | <h2><%= @product.name_with_unit %></h2> |
3 | <%= edit_product_link_to_remote(@product, 'name', _('Edit name and unit'), :title => _('Click here to edit the name of your product and the unit')) %> | 3 | <%= edit_product_link_to_remote(@product, 'name', _('Edit name and unit'), :title => _('Click here to edit the name of your product and the unit')) %> |
4 | </div> | 4 | </div> |
5 | -<% javascript_tag do %> | 5 | +<%= javascript_tag do %> |
6 | $$('#display-product-category .hierarchy-category')[0].update('<%= | 6 | $$('#display-product-category .hierarchy-category')[0].update('<%= |
7 | escape_javascript(hierarchy_category_navigation( | 7 | escape_javascript(hierarchy_category_navigation( |
8 | @product.product_category, | 8 | @product.product_category, |
app/views/manage_products/_edit_input.html.erb
1 | -<%= form_for(@input, :url => {:controller => 'manage_products', :action => 'edit_input', :id => @input}, | 1 | +<%= form_for(:input, :url => {:controller => 'manage_products', :action => 'edit_input', :id => @input}, |
2 | :html => {:method => 'post', :id => "edit-input-#{ @input.id }-form"}) do |f| %> | 2 | :html => {:method => 'post', :id => "edit-input-#{ @input.id }-form"}) do |f| %> |
3 | 3 | ||
4 | <%= hidden_field_tag 'input-bar-update-url', @input.product.price_composition_bar_display_url, :class => 'bar-update-url' %> | 4 | <%= hidden_field_tag 'input-bar-update-url', @input.product.price_composition_bar_display_url, :class => 'bar-update-url' %> |
app/views/manage_products/_form.html.erb
1 | <%= error_messages_for :product %> <br/> | 1 | <%= error_messages_for :product %> <br/> |
2 | 2 | ||
3 | -<%= form_for :product, @product, :html => {:multipart => true }, :url => {:action => mode} do |f| %> | 3 | +<%= form_for :product, :html => {:multipart => true }, :url => {:action => mode} do |f| %> |
4 | <%= required_fields_message %> | 4 | <%= required_fields_message %> |
5 | 5 | ||
6 | <%= display_form_field( _('Name:'), f.text_field(:name) ) %> | 6 | <%= display_form_field( _('Name:'), f.text_field(:name) ) %> |
app/views/manage_products/_price_composition_bar.html.erb
1 | -<% javascript_tag do %> | 1 | +<%= javascript_tag do %> |
2 | var value = <%= @product.price_description_percentage %>; | 2 | var value = <%= @product.price_description_percentage %>; |
3 | var total_cost = <%= @product.total_production_cost %>; | 3 | var total_cost = <%= @product.total_production_cost %>; |
4 | var price = '<%= @product.formatted_value(:price) %>'; | 4 | var price = '<%= @product.formatted_value(:price) %>'; |
app/views/manage_products/new.html.erb
@@ -25,6 +25,6 @@ | @@ -25,6 +25,6 @@ | ||
25 | 25 | ||
26 | <% end %> | 26 | <% end %> |
27 | 27 | ||
28 | -<% javascript_tag do %> | 28 | +<%= javascript_tag do %> |
29 | toggleDisabled(<%= @category && @category.accept_products? ? 'true' : 'false' %>, $('save_and_continue')) | 29 | toggleDisabled(<%= @category && @category.accept_products? ? 'true' : 'false' %>, $('save_and_continue')) |
30 | <% end %> | 30 | <% end %> |
app/views/profile/report_abuse.html.erb
1 | -<%= form_for @abuse_report, :url => {:action => 'register_report'}, | 1 | +<%= form_for :abuse_report, :url => {:action => 'register_report'}, |
2 | :html => {:onsubmit => "return send_request(this)", :id => 'report-abuse-form'} do |f| %> | 2 | :html => {:onsubmit => "return send_request(this)", :id => 'report-abuse-form'} do |f| %> |
3 | <%= labelled_form_field('* ' + _('Report reasons'), f.text_area(:reason, :rows => 6, :cols => 60, :class => 'required')) %> | 3 | <%= labelled_form_field('* ' + _('Report reasons'), f.text_area(:reason, :rows => 6, :cols => 60, :class => 'required')) %> |
4 | <%= hidden_field_tag(:content_type, params[:content_type]) %> | 4 | <%= hidden_field_tag(:content_type, params[:content_type]) %> |
app/views/search/_image.html.erb
@@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
5 | <% if ['jpg', 'jpeg', 'gif', 'png', 'tiff', 'svg'].include? extension %> | 5 | <% if ['jpg', 'jpeg', 'gif', 'png', 'tiff', 'svg'].include? extension %> |
6 | <%= link_to '', image.view_url, :class => "search-image-pic", :style => 'background-image: url(%s)'% image.public_filename(:thumb) %> | 6 | <%= link_to '', image.view_url, :class => "search-image-pic", :style => 'background-image: url(%s)'% image.public_filename(:thumb) %> |
7 | <% if image.width && image.height %> | 7 | <% if image.width && image.height %> |
8 | - <% javascript_tag do %> | 8 | + <%= javascript_tag do %> |
9 | image = jQuery('script').last().parent().find('.search-image-pic'); | 9 | image = jQuery('script').last().parent().find('.search-image-pic'); |
10 | des_width = parseInt(image.css('width')); | 10 | des_width = parseInt(image.css('width')); |
11 | des_height = parseInt(image.css('height')); | 11 | des_height = parseInt(image.css('height')); |
app/views/search/search_page.html.erb
@@ -11,7 +11,7 @@ | @@ -11,7 +11,7 @@ | ||
11 | <div style="clear: both"></div> | 11 | <div style="clear: both"></div> |
12 | 12 | ||
13 | <% if @asset == :product %> | 13 | <% if @asset == :product %> |
14 | - <% javascript_tag do %> | 14 | + <%= javascript_tag do %> |
15 | jQuery('.search-product-price-details').altBeautify(); | 15 | jQuery('.search-product-price-details').altBeautify(); |
16 | <% end %> | 16 | <% end %> |
17 | <% end %> | 17 | <% end %> |
app/views/shared/_dialog_error_messages.html.erb
app/views/shared/_numbers_only_javascript.html.erb
1 | -<% javascript_tag do %> | 1 | +<%= javascript_tag do %> |
2 | jQuery(".numbers-only").keypress(function(event) { | 2 | jQuery(".numbers-only").keypress(function(event) { |
3 | var separator = "<%= environment.currency_separator %>" | 3 | var separator = "<%= environment.currency_separator %>" |
4 | return numbersonly(event, separator) | 4 | return numbersonly(event, separator) |
app/views/shared/_redirect_via_javascript.html.erb