Commit bad8766a116471895981c18d724ed11042f1907c

Authored by Rodrigo Souto
1 parent d552ea62

Update every old syntax of form_for and javascript_tag

app/views/invite/_dialog_wait_loading.html.erb
1   -<% javascript_tag do %>
  1 +<%= javascript_tag do %>
2 2 jQuery(function($) {
3 3 $("#loading-dialog").dialog({
4 4 height: 160,
... ...
app/views/manage_products/_certifiers_for_selection.html.erb
1 1 <%= select_certifiers(@qualifier) + remove_qualifier_button %>
2   -<% javascript_tag do %>
  2 +<%= javascript_tag do %>
3 3 jQuery('#product-qualifiers-list *').removeClass('small-loading')
4 4 <% end %>
... ...
app/views/manage_products/_display_name.html.erb
... ... @@ -2,7 +2,7 @@
2 2 <h2><%= @product.name_with_unit %></h2>
3 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 4 </div>
5   -<% javascript_tag do %>
  5 +<%= javascript_tag do %>
6 6 $$('#display-product-category .hierarchy-category')[0].update('<%=
7 7 escape_javascript(hierarchy_category_navigation(
8 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 2 :html => {:method => 'post', :id => "edit-input-#{ @input.id }-form"}) do |f| %>
3 3  
4 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 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 4 <%= required_fields_message %>
5 5  
6 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 2 var value = <%= @product.price_description_percentage %>;
3 3 var total_cost = <%= @product.total_production_cost %>;
4 4 var price = '<%= @product.formatted_value(:price) %>';
... ...
app/views/manage_products/new.html.erb
... ... @@ -25,6 +25,6 @@
25 25  
26 26 <% end %>
27 27  
28   -<% javascript_tag do %>
  28 +<%= javascript_tag do %>
29 29 toggleDisabled(<%= @category && @category.accept_products? ? 'true' : 'false' %>, $('save_and_continue'))
30 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 2 :html => {:onsubmit => "return send_request(this)", :id => 'report-abuse-form'} do |f| %>
3 3 <%= labelled_form_field('* ' + _('Report reasons'), f.text_area(:reason, :rows => 6, :cols => 60, :class => 'required')) %>
4 4 <%= hidden_field_tag(:content_type, params[:content_type]) %>
... ...
app/views/search/_image.html.erb
... ... @@ -5,7 +5,7 @@
5 5 <% if ['jpg', 'jpeg', 'gif', 'png', 'tiff', 'svg'].include? extension %>
6 6 <%= link_to '', image.view_url, :class => "search-image-pic", :style => 'background-image: url(%s)'% image.public_filename(:thumb) %>
7 7 <% if image.width && image.height %>
8   - <% javascript_tag do %>
  8 + <%= javascript_tag do %>
9 9 image = jQuery('script').last().parent().find('.search-image-pic');
10 10 des_width = parseInt(image.css('width'));
11 11 des_height = parseInt(image.css('height'));
... ...
app/views/search/search_page.html.erb
... ... @@ -11,7 +11,7 @@
11 11 <div style="clear: both"></div>
12 12  
13 13 <% if @asset == :product %>
14   - <% javascript_tag do %>
  14 + <%= javascript_tag do %>
15 15 jQuery('.search-product-price-details').altBeautify();
16 16 <% end %>
17 17 <% end %>
... ...
app/views/shared/_dialog_error_messages.html.erb
1   -<% javascript_tag do %>
  1 +<%= javascript_tag do %>
2 2 close_loading()
3 3 jQuery('#errorExplanation h2').hide()
4 4 jQuery('#errorExplanation p').hide()
... ...
app/views/shared/_numbers_only_javascript.html.erb
1   -<% javascript_tag do %>
  1 +<%= javascript_tag do %>
2 2 jQuery(".numbers-only").keypress(function(event) {
3 3 var separator = "<%= environment.currency_separator %>"
4 4 return numbersonly(event, separator)
... ...
app/views/shared/_redirect_via_javascript.html.erb
1   -<% javascript_tag do %>
  1 +<%= javascript_tag do %>
2 2 update_loading('<%= _('redirecting...') %>')
3 3 redirect_to('<%= url %>')
4 4 <% end %>
... ...