diff --git a/.gitignore b/.gitignore index d3e283ca3a..6cb7536f07 100644 --- a/.gitignore +++ b/.gitignore @@ -30,4 +30,3 @@ config/abr.yml config/heroku_env.rb NERD_tree* coverage -config/database.yml diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 30c59f30cb..1ce9866eb3 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -11,9 +11,9 @@ class ApplicationController < ActionController::Base def load_data_for_sidebar @suppliers = Enterprise.is_primary_producer.with_supplied_active_products_on_hand.limit(5) - @supplier_count = Enterprise.is_primary_producer.with_supplied_active_products_on_hand.count + @supplier_total = Enterprise.is_primary_producer.with_supplied_active_products_on_hand.count @distributors = Enterprise.is_distributor.with_distributed_active_products_on_hand.by_name.limit(5) - @distributor_count = Enterprise.is_distributor.with_distributed_active_products_on_hand.by_name.count + @distributor_total = Enterprise.is_distributor.with_distributed_active_products_on_hand.by_name.count end # All render calls within the block will be performed with the specified format diff --git a/app/views/spree/products/_source_sidebar.html.haml b/app/views/spree/products/_source_sidebar.html.haml index 11f62f90cb..918d89206b 100644 --- a/app/views/spree/products/_source_sidebar.html.haml +++ b/app/views/spree/products/_source_sidebar.html.haml @@ -11,8 +11,8 @@ = link_to distributor.name, [main_app, distributor] - else %abbr(title="One or more of the products in your cart is not available from this distributor")= distributor.name - - if @distributor_count > @distributors.count - - distributors_more = @distributors.count - @distributor_count + - if @distributor_total > @distributors.count + - distributors_more = @distributors.count - @distributor_total = "#{distributors_more} more..." - if current_distributor && validator.can_change_distributor? = button_to 'Browse All Distributors', deselect_distributor_orders_path, :method => :get @@ -20,9 +20,8 @@ %h6.filter_name Shop by Supplier %ul.filter_choices - @suppliers.each do |supplier| - -# - if supplier.has_supplied_products_on_hand? -#d.cook: this is filtered in the controller now %li.nowrap= link_to supplier.name, [main_app, supplier] - - if @supplier_count > @suppliers.count - - suppliers_more = @suppliers.count - @supplier_count + - if @supplier_total > @suppliers.count + - suppliers_more = @suppliers.count - @supplier_total = "#{suppliers_more} more..." = button_to 'Browse All Suppliers', main_app.suppliers_enterprises_path, :method => :get diff --git a/config/database.yml b/config/database.yml new file mode 100644 index 0000000000..40ffe445f7 --- /dev/null +++ b/config/database.yml @@ -0,0 +1,29 @@ +development: + adapter: postgresql + encoding: unicode + #template: template0 + #collate: en_US.UTF8 + #ctype: en_US.UTF8 + database: open_food_web_dev + pool: 5 + host: localhost + username: ofw + password: f00d + +test: + adapter: postgresql + encoding: unicode + database: open_food_web_test + pool: 5 + host: localhost + username: ofw + password: f00d + +#not used with heroku +production: + adapter: postgresql + encoding: unicode + database: open_food_web_prod + pool: 5 + username: ofw + password: f00d