This commit is contained in:
Nicolas Bally 2019-04-29 12:01:35 +02:00
parent 6036a5cbec
commit 512eb7346a
4 changed files with 82 additions and 75 deletions

View File

@ -3,6 +3,8 @@
.content .content
=form.input :reseaux_id, :label => "Réseau :", :collection => Reseaux.where(:parent_id => nil).all, :as => :select, :include_blank => false =form.input :reseaux_id, :label => "Réseau :", :collection => Reseaux.where(:parent_id => nil).all, :as => :select, :include_blank => false
=form.input :orderable, :label => "Peut être commandé ?", :as => :boolean
=#form.input :product_category_id, :label => "Catégorie :", :collection => @categories_select, :as => :select, :include_blank => false =#form.input :product_category_id, :label => "Catégorie :", :collection => @categories_select, :as => :select, :include_blank => false
-if @product.product_category_id -if @product.product_category_id

View File

@ -50,7 +50,7 @@
-@porduct_order_product.product_size_id = @product.product_sizes_in_stock(@porduct_order_product.product_option_id).first.id if @product.product_sizes_in_stock(@porduct_order_product.product_option_id).first -@porduct_order_product.product_size_id = @product.product_sizes_in_stock(@porduct_order_product.product_option_id).first.id if @product.product_sizes_in_stock(@porduct_order_product.product_option_id).first
-if @product.orderable
-if @product.product_stocks.where("stock_th > 0").count > 0 -if @product.product_stocks.where("stock_th > 0").count > 0
= form_for [:public, @porduct_order_product], :remote => true do |f| = form_for [:public, @porduct_order_product], :remote => true do |f|
= f.hidden_field :product_id = f.hidden_field :product_id

View File

@ -4,9 +4,9 @@
-if current_customer.account_validated? -if current_customer.account_validated?
-if @reseaux and @reseaux.needs_enabled -if @reseaux and @reseaux.needs_enabled
=link_to "Besoins spécifiques", public_needs_path(:type => 1), :class => ("active" if @needs and params[:type].to_i == 1) =link_to "Besoins exclusifs", public_needs_path(:type => 1), :class => ("active" if @needs and params[:type].to_i == 1)
-if @reseaux and @reseaux.centrale_enabled -if @reseaux and @reseaux.centrale_enabled
=link_to "Centrale d'achats", public_needs_path(:type => 2), :class => ("active" if @needs and params[:type].to_i == 2) =link_to "Portail local", public_needs_path(:type => 2), :class => ("active" if @needs and params[:type].to_i == 2)
-if session[:reseaux_id].to_i > 0 -if session[:reseaux_id].to_i > 0
-if @reseaux and @reseaux.offres_enabled -if @reseaux and @reseaux.offres_enabled

View File

@ -0,0 +1,5 @@
class AddOrderableToProducts < ActiveRecord::Migration
def change
add_column :products, :orderable, :boolean, :default => true
end
end