Commit b8f10d32e0aa8c29cb8bc725185759bc0a7263dc
1 parent
563ef4f0
Exists in
master
and in
29 other branches
Fix form_for calls to new api
Showing
4 changed files
with
4 additions
and
4 deletions
Show diff stats
app/views/licenses/_form.html.erb
1 | <%= error_messages_for :license %> | 1 | <%= error_messages_for :license %> |
2 | 2 | ||
3 | -<%= form_for :license, @license do |f| %> | 3 | +<%= form_for :license do |f| %> |
4 | <%= hidden_field_tag(:license_id, params[:license_id]) %> | 4 | <%= hidden_field_tag(:license_id, params[:license_id]) %> |
5 | <%= required labelled_form_field(_('Name'), f.text_field(:name)) %> | 5 | <%= required labelled_form_field(_('Name'), f.text_field(:name)) %> |
6 | <%= labelled_form_field(_('License url'), f.text_field(:url)) %> | 6 | <%= labelled_form_field(_('License url'), f.text_field(:url)) %> |
plugins/shopping_cart/controllers/shopping_cart_plugin_controller.rb
@@ -94,6 +94,7 @@ class ShoppingCartPluginController < PublicController | @@ -94,6 +94,7 @@ class ShoppingCartPluginController < PublicController | ||
94 | end | 94 | end |
95 | 95 | ||
96 | def buy | 96 | def buy |
97 | + @customer = user || Person.new | ||
97 | if validate_cart_presence | 98 | if validate_cart_presence |
98 | @cart = cart | 99 | @cart = cart |
99 | @enterprise = environment.enterprises.find(cart[:profile_id]) | 100 | @enterprise = environment.enterprises.find(cart[:profile_id]) |
plugins/shopping_cart/views/shopping_cart_plugin/buy.html.erb
1 | -<% person = user.nil? ? Person.new : user %> | ||
2 | <div id='cart-request-box'> | 1 | <div id='cart-request-box'> |
3 | - <% form_for(:customer, person, :url => {:action => 'send_request'}, | 2 | + <% form_for(:customer, :url => {:action => 'send_request'}, |
4 | :html => {:onsubmit => "return Cart.send_request(this)", :id => 'cart-request-form' }) do |f| %> | 3 | :html => {:onsubmit => "return Cart.send_request(this)", :id => 'cart-request-form' }) do |f| %> |
5 | <div id="cart-form-main"> | 4 | <div id="cart-form-main"> |
6 | <%= labelled_form_field('* ' + _("Name"), f.text_field(:name, :class => 'required') ) %> | 5 | <%= labelled_form_field('* ' + _("Name"), f.text_field(:name, :class => 'required') ) %> |
plugins/shopping_cart/views/shopping_cart_plugin_myprofile/edit.html.erb
1 | <h1> <%= _('Basket options') %> </h1> | 1 | <h1> <%= _('Basket options') %> </h1> |
2 | 2 | ||
3 | -<%= form_for(:settings, @settings, :url => {:action => 'edit'}, :html => {:method => 'post'}) do |f| %> | 3 | +<%= form_for(:settings, :url => {:action => 'edit'}, :html => {:method => 'post'}) do |f| %> |
4 | <%= labelled_form_field(_('Enable shopping basket'), f.check_box(:enabled)) %> | 4 | <%= labelled_form_field(_('Enable shopping basket'), f.check_box(:enabled)) %> |
5 | <%= labelled_form_field(_('Enable delivery fields on orders'), f.check_box(:delivery)) %> | 5 | <%= labelled_form_field(_('Enable delivery fields on orders'), f.check_box(:delivery)) %> |
6 | <% display_delivery_settings = @settings.delivery ? 'auto' : 'none' %> | 6 | <% display_delivery_settings = @settings.delivery ? 'auto' : 'none' %> |