diff --git a/.gitignore b/.gitignore index e9a18987ec..c329b4f035 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,9 @@ /config/database.yml +# rspec failures +examples.txt + # Ignore the default SQLite database. /db/*.sqlite3 /db/*.sqlite3-journal @@ -27,20 +30,18 @@ dragonfly.log /dragonfly public/system/dragonfly/development -.DS_Store - tags *.swp *.swo latest.prod.dump cleansed.prod.dump -.DS_Store ~*.xlsx # IntelliJ /.idea /localorbit.iml + node_modules/ *.sublime-project diff --git a/.rspec b/.rspec index 9d52c56327..f494de58d3 100644 --- a/.rspec +++ b/.rspec @@ -1,2 +1,4 @@ --color --format doc +--require spec_helper + diff --git a/Gemfile b/Gemfile index 3292f04ee2..076df25aec 100644 --- a/Gemfile +++ b/Gemfile @@ -124,6 +124,7 @@ group :development do end group :development, :test do + gem 'active_record_query_trace' gem 'rspec-rails', '~> 3.0' gem 'rspec-collection_matchers' gem 'rspec_junit_formatter', :git => 'https://github.com/circleci/rspec_junit_formatter.git' diff --git a/Gemfile.lock b/Gemfile.lock index e746b2bec3..8fc881b184 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -74,6 +74,7 @@ GEM erubis (~> 2.7.0) active_model_serializers (0.9.0) activemodel (>= 3.2) + active_record_query_trace (1.5.4) active_record_union (1.0.1) activerecord (>= 4.0) activemodel (4.1.16) @@ -759,6 +760,7 @@ PLATFORMS DEPENDENCIES accountingjs-rails active_model_serializers + active_record_query_trace active_record_union activerecord-import acts_as_geocodable diff --git a/app/assets/javascripts/product_catalog/components/product_catalog.js.jsx b/app/assets/javascripts/product_catalog/components/product_catalog.js.jsx index a716953395..827cdc1f74 100644 --- a/app/assets/javascripts/product_catalog/components/product_catalog.js.jsx +++ b/app/assets/javascripts/product_catalog/components/product_catalog.js.jsx @@ -9,6 +9,7 @@ propTypes: { cartUrl: React.PropTypes.string, baseUrl: React.PropTypes.string.isRequired, + resourcesPath: React.PropTypes.string.isRequired, deliveryDate: React.PropTypes.string.isRequired, selectedType: React.PropTypes.string, orderCutoff: React.PropTypes.string.isRequired, @@ -84,7 +85,7 @@ limit={30} filter={null} cartUrl={this.props.cartUrl} - url={this.props.baseUrl + '/products'} + url={this.props.baseUrl + this.props.resourcesPath} supplierOnly={this.props.supplierId > 0} orderId={this.props.orderId} purchaseOrder={this.props.purchaseOrder} @@ -92,7 +93,7 @@ consignmentMarket={this.props.consignmentMarket} supplierView={this.props.supplierView} />); - + return (
{orderTemplates} diff --git a/app/assets/javascripts/product_catalog/product_store.js b/app/assets/javascripts/product_catalog/product_store.js index ffb9f4de66..fbd900ff19 100644 --- a/app/assets/javascripts/product_catalog/product_store.js +++ b/app/assets/javascripts/product_catalog/product_store.js @@ -19,7 +19,7 @@ products: [], hasMore: true }; - this.url = window.location.protocol + "//" + window.location.host + "/api/v1/products"; + // this.url = window.location.protocol + "//" + window.location.host + "/api/v1/products"; this.orderId = null; this.parameters = { offset: 0, @@ -45,11 +45,11 @@ ProductActions.loadProducts(); }, - loadProducts: function() { + loadProducts: function(url) { this.loading = true; this.parameters.offset = 0; this.parameters.order_id = this.orderId; - $.getJSON(this.url, this.parameters, this.onLoad, this.onLoadError); + $.getJSON(url, this.parameters, this.onLoad, this.onLoadError); }, onLoad: function(res) { @@ -57,12 +57,12 @@ this.onLoadMore(res); }, - loadMoreProducts: function() { + loadMoreProducts: function(url) { if(this.loading || !this.catalog.hasMore) return; this.loading = true; this.parameters.offset = this.catalog.products.length; this.parameters.order_id = this.orderId; - $.getJSON(this.url, this.parameters, this.onLoadMore, this.onLoadError); + $.getJSON(url, this.parameters, this.onLoadMore, this.onLoadError); }, onLoadMore: function(res) { diff --git a/app/controllers/api/v1/products_controller.rb b/app/controllers/api/v1/products_controller.rb index 5f09278870..8cdc6ceaee 100644 --- a/app/controllers/api/v1/products_controller.rb +++ b/app/controllers/api/v1/products_controller.rb @@ -13,7 +13,7 @@ class ProductsController < ApplicationController def index @offset = (params[:offset] || 0).to_i @limit = (params[:limit] || 30).to_i - @query = (params[:query] || '').gsub(/\W+/, '+') || '' + @query = (params[:query] || '').gsub(/\W+/, '+') @category_ids = (params[:category_ids] || []) @seller_ids = (params[:seller_ids] || []) @sort_by = (params[:sort_by] || "top_level_category.lft, second_level_category.lft, general_products.name") @@ -26,28 +26,31 @@ def index featured_promotion = current_market.featured_promotion(current_organization, current_delivery) end - if current_market.try(:is_consignment_market?) && (order_type == 'purchase' || (!order.nil? && order.purchase_order?)) - products = filtered_available_po_consignment_products(@query, @category_ids, @seller_ids, @order) - elsif current_market.try(:is_consignment_market?) && (order_type == 'sales' || (!order.nil? && order.sales_order?)) - products = filtered_available_so_consignment_products(@query, @category_ids, @seller_ids, @order) - else - products = filtered_available_products(@query, @category_ids, @seller_ids, @order) - end + # products = if current_market.try(:is_consignment_market?) && (order_type == 'purchase' || (!order.nil? && order.purchase_order?)) + # filtered_available_po_consignment_products(@query, @category_ids, @seller_ids, @order) + # elsif current_market.try(:is_consignment_market?) && (order_type == 'sales' || (!order.nil? && order.sales_order?)) + # filtered_available_so_consignment_products(@query, @category_ids, @seller_ids, @order) + # else + # filtered_available_products(@query, @category_ids, @seller_ids, @order) + # end + products = filtered_available_products(@query, @category_ids, @seller_ids, @order) sellers = {} + # page_of_products = products page_of_products = products - .offset(@offset) - .limit(@limit) - .map { |p| format_general_product_for_catalog(p, sellers, @order) } - render :json => { - product_total: products.count(:all), - featured_promotion: { - :details => featured_promotion, - :image_url => get_image_url(featured_promotion), - :product => featured_promotion ? format_general_product_for_catalog(featured_promotion.product.general_product, sellers, @order) : nil - }, - products: page_of_products, - sellers: sellers + .includes(:organization) + .offset(@offset) + .limit(@limit) + .map { |p| format_general_product_for_catalog(p, sellers, @order) } + render json: { + product_total: products.count(:all), + featured_promotion: { + :details => featured_promotion, + :image_url => get_image_url(featured_promotion), + :product => featured_promotion ? format_general_product_for_catalog(featured_promotion.product.general_product, sellers, @order) : nil + }, + products: page_of_products, + sellers: sellers } end @@ -93,85 +96,85 @@ def filtered_available_products(query, category_ids, seller_ids, order) .uniq end - def filtered_available_po_consignment_products(query, category_ids, seller_ids, order) - catalog_products = cross_sold_products = Product.connection.unprepared_statement do - Product.joins(organization: [market_organizations: [:market]]) - .where("markets.id = ?", current_market.id) - .visible - .select(:id, :general_product_id) - .to_sql - end - - # KXM GC: Disable cross selling products for now. - # Once re-enabled you can delete the double assignment in catalog_products above... - - # cross_sold_products = Product. - # cross_selling_list_items(current_market.id). - # visible. - # with_available_inventory(current_delivery.deliver_on). - # priced_for_market_and_buyer(current_market, current_organization). - # with_visible_pricing. - # select(:id, :general_product_id). - # to_sql - - gp = GeneralProduct.joins("JOIN (#{catalog_products}) p_child - ON general_products.id=p_child.general_product_id - JOIN categories top_level_category ON general_products.top_level_category_id = top_level_category.id - JOIN categories second_level_category ON general_products.second_level_category_id = second_level_category.id - JOIN organizations supplier ON general_products.organization_id=supplier.id") - .filter_by_current_order(order) - .filter_by_name_or_category_or_supplier(query) - .filter_by_categories(category_ids) - .filter_by_suppliers(seller_ids) - .select("top_level_category.lft, top_level_category.name, second_level_category.lft, second_level_category.name, general_products.*") - .order("general_products.name") - .uniq - end - - def filtered_available_so_consignment_products(query, category_ids, seller_ids, order) - catalog_products = cross_sold_products = Product.connection.unprepared_statement do - Product.joins(organization: [market_organizations: [:market]]) - .where("markets.id = ?", current_market.id) - .with_available_so_inventory(current_delivery.deliver_on) - .visible - .select(:id, :general_product_id) - .to_sql - end - - catalog_products2 = cross_sold_products2 = Product.connection.unprepared_statement do - Product.joins(organization: [market_organizations: [:market]]) - .where("markets.id = ?", current_market.id) - .with_pending_so_inventory(current_delivery.deliver_on) - .visible - .select(:id, :general_product_id) - .to_sql - end - - cp = "#{catalog_products} UNION #{catalog_products2} UNION - SELECT products.id, products.general_product_id - FROM products - INNER JOIN organizations ON organizations.id = products.organization_id - INNER JOIN market_organizations ON market_organizations.organization_id = organizations.id - INNER JOIN markets ON markets.id = market_organizations.market_id - INNER JOIN consignment_transactions ON consignment_transactions.product_id = products.id AND consignment_transactions.market_id = markets.id AND consignment_transactions.transaction_type = 'PO' AND consignment_transactions.lot_id IS NULL AND consignment_transactions.deleted_at IS NULL - INNER JOIN orders ON consignment_transactions.order_id = orders.id AND orders.delivery_status in ('pending','partially delivered') - WHERE markets.id = #{current_market.id} AND products.deleted_at IS NULL" - - gp = GeneralProduct.joins("JOIN (#{cp}) p_child - ON general_products.id=p_child.general_product_id - JOIN categories top_level_category ON general_products.top_level_category_id = top_level_category.id - JOIN categories second_level_category ON general_products.second_level_category_id = second_level_category.id - JOIN organizations supplier ON general_products.organization_id=supplier.id - LEFT JOIN market_organizations ON general_products.organization_id = market_organizations.organization_id - AND market_organizations.market_id = #{current_market.id}") - .filter_by_name_or_category_or_supplier(query) - .filter_by_categories(category_ids) - .filter_by_suppliers(seller_ids) - .filter_by_active_org - .select("top_level_category.lft, top_level_category.name, second_level_category.lft, second_level_category.name, general_products.*") - .order("general_products.name") - .uniq - end + # def filtered_available_po_consignment_products(query, category_ids, seller_ids, order) + # catalog_products = cross_sold_products = Product.connection.unprepared_statement do + # Product.joins(organization: [market_organizations: [:market]]) + # .where("markets.id = ?", current_market.id) + # .visible + # .select(:id, :general_product_id) + # .to_sql + # end + + # # KXM GC: Disable cross selling products for now. + # # Once re-enabled you can delete the double assignment in catalog_products above... + + # # cross_sold_products = Product. + # # cross_selling_list_items(current_market.id). + # # visible. + # # with_available_inventory(current_delivery.deliver_on). + # # priced_for_market_and_buyer(current_market, current_organization). + # # with_visible_pricing. + # # select(:id, :general_product_id). + # # to_sql + + # gp = GeneralProduct.joins("JOIN (#{catalog_products}) p_child + # ON general_products.id=p_child.general_product_id + # JOIN categories top_level_category ON general_products.top_level_category_id = top_level_category.id + # JOIN categories second_level_category ON general_products.second_level_category_id = second_level_category.id + # JOIN organizations supplier ON general_products.organization_id=supplier.id") + # .filter_by_current_order(order) + # .filter_by_name_or_category_or_supplier(query) + # .filter_by_categories(category_ids) + # .filter_by_suppliers(seller_ids) + # .select("top_level_category.lft, top_level_category.name, second_level_category.lft, second_level_category.name, general_products.*") + # .order("general_products.name") + # .uniq + # end + + # def filtered_available_so_consignment_products(query, category_ids, seller_ids, order) + # catalog_products = cross_sold_products = Product.connection.unprepared_statement do + # Product.joins(organization: [market_organizations: [:market]]) + # .where("markets.id = ?", current_market.id) + # .with_available_so_inventory(current_delivery.deliver_on) + # .visible + # .select(:id, :general_product_id) + # .to_sql + # end + + # catalog_products2 = cross_sold_products2 = Product.connection.unprepared_statement do + # Product.joins(organization: [market_organizations: [:market]]) + # .where("markets.id = ?", current_market.id) + # .with_pending_so_inventory(current_delivery.deliver_on) + # .visible + # .select(:id, :general_product_id) + # .to_sql + # end + + # cp = "#{catalog_products} UNION #{catalog_products2} UNION + # SELECT products.id, products.general_product_id + # FROM products + # INNER JOIN organizations ON organizations.id = products.organization_id + # INNER JOIN market_organizations ON market_organizations.organization_id = organizations.id + # INNER JOIN markets ON markets.id = market_organizations.market_id + # INNER JOIN consignment_transactions ON consignment_transactions.product_id = products.id AND consignment_transactions.market_id = markets.id AND consignment_transactions.transaction_type = 'PO' AND consignment_transactions.lot_id IS NULL AND consignment_transactions.deleted_at IS NULL + # INNER JOIN orders ON consignment_transactions.order_id = orders.id AND orders.delivery_status in ('pending','partially delivered') + # WHERE markets.id = #{current_market.id} AND products.deleted_at IS NULL" + + # gp = GeneralProduct.joins("JOIN (#{cp}) p_child + # ON general_products.id=p_child.general_product_id + # JOIN categories top_level_category ON general_products.top_level_category_id = top_level_category.id + # JOIN categories second_level_category ON general_products.second_level_category_id = second_level_category.id + # JOIN organizations supplier ON general_products.organization_id=supplier.id + # LEFT JOIN market_organizations ON general_products.organization_id = market_organizations.organization_id + # AND market_organizations.market_id = #{current_market.id}") + # .filter_by_name_or_category_or_supplier(query) + # .filter_by_categories(category_ids) + # .filter_by_suppliers(seller_ids) + # .filter_by_active_org + # .select("top_level_category.lft, top_level_category.name, second_level_category.lft, second_level_category.name, general_products.*") + # .order("general_products.name") + # .uniq + # end def format_general_product_for_catalog(general_product, sellers, order) general_product = general_product.decorate diff --git a/app/controllers/api/v1/purchaseable_products_controller.rb b/app/controllers/api/v1/purchaseable_products_controller.rb new file mode 100644 index 0000000000..9d2506eaa2 --- /dev/null +++ b/app/controllers/api/v1/purchaseable_products_controller.rb @@ -0,0 +1,45 @@ +module Api + module V1 + class PurchaseableProductsController < ProductsController + + private + + def filtered_available_products(query, category_ids, seller_ids, order) + catalog_products = cross_sold_products = Product.connection.unprepared_statement do + Product.joins(organization: [market_organizations: [:market]]) + .where("markets.id = ?", current_market.id) + .visible + .select(:id, :general_product_id) + .to_sql + end + + # KXM GC: Disable cross selling products for now. + # Once re-enabled you can delete the double assignment in catalog_products above... + + # cross_sold_products = Product. + # cross_selling_list_items(current_market.id). + # visible. + # with_available_inventory(current_delivery.deliver_on). + # priced_for_market_and_buyer(current_market, current_organization). + # with_visible_pricing. + # select(:id, :general_product_id). + # to_sql + + gp = GeneralProduct.joins("JOIN (#{catalog_products}) p_child + ON general_products.id=p_child.general_product_id + JOIN categories top_level_category ON general_products.top_level_category_id = top_level_category.id + JOIN categories second_level_category ON general_products.second_level_category_id = second_level_category.id + JOIN organizations supplier ON general_products.organization_id=supplier.id") + .filter_by_current_order(order) + .filter_by_name_or_category_or_supplier(query) + .filter_by_categories(category_ids) + .filter_by_suppliers(seller_ids) + .select("top_level_category.lft, top_level_category.name, second_level_category.lft, second_level_category.name, general_products.*") + .order("general_products.name") + .uniq + end + + + end + end +end diff --git a/app/controllers/api/v1/saleable_products_controller.rb b/app/controllers/api/v1/saleable_products_controller.rb new file mode 100644 index 0000000000..4520a525a8 --- /dev/null +++ b/app/controllers/api/v1/saleable_products_controller.rb @@ -0,0 +1,54 @@ +module Api + module V1 + class SaleableProductsController < ProductsController + + private + + def filtered_available_products(query, category_ids, seller_ids, order) + catalog_products = cross_sold_products = Product.connection.unprepared_statement do + Product.joins(organization: [market_organizations: [:market]]) + .where("markets.id = ?", current_market.id) + .with_available_so_inventory(current_delivery.deliver_on) + .visible + .select(:id, :general_product_id) + .to_sql + end + + catalog_products2 = cross_sold_products2 = Product.connection.unprepared_statement do + Product.joins(organization: [market_organizations: [:market]]) + .where("markets.id = ?", current_market.id) + .with_pending_so_inventory(current_delivery.deliver_on) + .visible + .select(:id, :general_product_id) + .to_sql + end + + cp = "#{catalog_products} UNION #{catalog_products2} UNION + SELECT products.id, products.general_product_id + FROM products + INNER JOIN organizations ON organizations.id = products.organization_id + INNER JOIN market_organizations ON market_organizations.organization_id = organizations.id + INNER JOIN markets ON markets.id = market_organizations.market_id + INNER JOIN consignment_transactions ON consignment_transactions.product_id = products.id AND consignment_transactions.market_id = markets.id AND consignment_transactions.transaction_type = 'PO' AND consignment_transactions.lot_id IS NULL AND consignment_transactions.deleted_at IS NULL + INNER JOIN orders ON consignment_transactions.order_id = orders.id AND orders.delivery_status in ('pending','partially delivered') + WHERE markets.id = #{current_market.id} AND products.deleted_at IS NULL" + + gp = GeneralProduct.joins("JOIN (#{cp}) p_child + ON general_products.id=p_child.general_product_id + JOIN categories top_level_category ON general_products.top_level_category_id = top_level_category.id + JOIN categories second_level_category ON general_products.second_level_category_id = second_level_category.id + JOIN organizations supplier ON general_products.organization_id=supplier.id + LEFT JOIN market_organizations ON general_products.organization_id = market_organizations.organization_id + AND market_organizations.market_id = #{current_market.id}") + .filter_by_name_or_category_or_supplier(query) + .filter_by_categories(category_ids) + .filter_by_suppliers(seller_ids) + .filter_by_active_org + .select("top_level_category.lft, top_level_category.name, second_level_category.lft, second_level_category.name, general_products.*") + .order("general_products.name") + .uniq + end + + end + end +end diff --git a/app/controllers/products_controller.rb b/app/controllers/products_controller.rb index 7a4d482105..0f981e57c0 100644 --- a/app/controllers/products_controller.rb +++ b/app/controllers/products_controller.rb @@ -14,16 +14,23 @@ class ProductsController < ApplicationController before_action :load_sellers, only: [:search] def index + @resources_path = 'products' if current_market.alternative_order_page render 'alternative_order_page' - return end end def purchase + @resources_path = 'purchaseable_products' + if current_market.alternative_order_page + render 'alternative_order_page' + end + end + + def sell + @resources_path = 'saleable_products' if current_market.alternative_order_page render 'alternative_order_page' - return end end @@ -96,9 +103,10 @@ def load_products def set_order_type @order_type = case params[:action] when 'index' then 'sales' + when 'sell' then 'sales' else params[:action] end - session[:order_type] = @order_type unless session[:order_type] == @order_type + session[:order_type] = @order_type end end diff --git a/app/interactors/send_fresh_sheet.rb b/app/interactors/send_fresh_sheet.rb index 649303dacd..e1a98f43df 100644 --- a/app/interactors/send_fresh_sheet.rb +++ b/app/interactors/send_fresh_sheet.rb @@ -22,15 +22,15 @@ def send_test_email end def send_fresh_sheets_to_subscribed_members - fresh_sheet_type = SubscriptionType.find_by(keyword: SubscriptionType::Keywords::FreshSheet) + fresh_sheet_type = SubscriptionType.find_by(keyword: SubscriptionType::Keywords::FRESHSHEET) User.in_market(market). subscribed_to(fresh_sheet_type). - uniq. + uniq. includes(:subscriptions). each do |user| token = user.unsubscribe_token(subscription_type: fresh_sheet_type) - MarketMailer.delay.fresh_sheet(market: market, - to: user.pretty_email, + MarketMailer.delay.fresh_sheet(market: market, + to: user.pretty_email, note: CGI::unescapeHTML(note), unsubscribe_token: token, port: get_port) diff --git a/app/interactors/send_newsletter.rb b/app/interactors/send_newsletter.rb index 5e9380bada..0435571cef 100644 --- a/app/interactors/send_newsletter.rb +++ b/app/interactors/send_newsletter.rb @@ -7,13 +7,13 @@ def perform context[:notice] = "Successfully sent a test to #{email}" elsif commit == "Send Now" - newsletter_type = SubscriptionType.find_by(keyword: SubscriptionType::Keywords::Newsletter) + newsletter_type = SubscriptionType.find_by(keyword: SubscriptionType::Keywords::NEWSLETTER) newsletter.recipients.each do |user| token = user.unsubscribe_token(subscription_type: newsletter_type) MarketMailer.delay.newsletter( - newsletter: newsletter, - market: market, - to: user.pretty_email, + newsletter: newsletter, + market: market, + to: user.pretty_email, unsubscribe_token: token, port: get_port) end diff --git a/app/models/newsletter.rb b/app/models/newsletter.rb index 908a731e07..6a050b3fa5 100644 --- a/app/models/newsletter.rb +++ b/app/models/newsletter.rb @@ -9,7 +9,7 @@ class Newsletter < ActiveRecord::Base validates_property :format, of: :image, in: %w(jpg jpeg png gif) def recipients - newsletter_type = SubscriptionType::Keywords::Newsletter + newsletter_type = SubscriptionType::Keywords::NEWSLETTER subscribers = User.in_market(market).subscribed_to(newsletter_type).includes(:subscriptions) recipients = Set.new diff --git a/app/models/subscription.rb b/app/models/subscription.rb index 23afac1977..a2f500e26a 100644 --- a/app/models/subscription.rb +++ b/app/models/subscription.rb @@ -26,8 +26,8 @@ def self.ensure_user_has_subscription_link_to(user, subscription_type_keyword:) end def self.ensure_user_has_subscription_links_to_fresh_sheet_and_newsletter(user) - [ SubscriptionType::Keywords::FreshSheet, - SubscriptionType::Keywords::Newsletter + [ SubscriptionType::Keywords::FRESHSHEET, + SubscriptionType::Keywords::NEWSLETTER ].each do |keyword| Subscription.ensure_user_has_subscription_link_to(user, subscription_type_keyword: keyword) end diff --git a/app/models/subscription_type.rb b/app/models/subscription_type.rb index d1b6bf9254..96c9c1becf 100644 --- a/app/models/subscription_type.rb +++ b/app/models/subscription_type.rb @@ -1,7 +1,7 @@ class SubscriptionType < ActiveRecord::Base module Keywords - FreshSheet = "fresh_sheet" - Newsletter = "newsletter" + FRESHSHEET = 'fresh_sheet' + NEWSLETTER = 'newsletter' end has_many :subscriptions diff --git a/app/views/products/alternative_order_page.html.erb b/app/views/products/alternative_order_page.html.erb index 3b0c923d9d..f678db98e0 100644 --- a/app/views/products/alternative_order_page.html.erb +++ b/app/views/products/alternative_order_page.html.erb @@ -6,6 +6,7 @@ %> <%= react_component('lo.ProductCatalog', { baseUrl: "#{request.base_url}/api/v1/", + resourcesPath: @resources_path, cartUrl: cart_path, deliveryDate: current_delivery.buyer_deliver_on, selectedType: current_delivery.selected_type.capitalize, diff --git a/app/views/shared/_navigation.html.erb b/app/views/shared/_navigation.html.erb index d1aaea0a2c..eb68739aa6 100644 --- a/app/views/shared/_navigation.html.erb +++ b/app/views/shared/_navigation.html.erb @@ -5,7 +5,7 @@ else logo = image_tag(asset_path('logo.png'), alt: "Local Orbit logo", class: "vertical-centerer logo") end -on_catalog = current_page?(products_path) || current_page?(products_purchase_path) +on_catalog = current_page?(products_path) || current_page?(purchase_products_path) || current_page?(sell_products_path) %> <% if current_market %> @@ -18,8 +18,8 @@ on_catalog = current_page?(products_path) || current_page?(products_purchase_pat
<% if current_user %>