From 19118da82ebd3a9eaebc470c250d05c48c6d3944 Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Wed, 16 Jul 2014 15:11:57 +1000 Subject: [PATCH] Remove old landing page cruft --- app/controllers/enterprises_controller.rb | 13 ---- app/helpers/temp_landing_page_helper.rb | 11 ---- app/views/home/temp_landing_page.html.haml | 66 ------------------- app/views/layouts/landing_page.html.haml | 52 --------------- config/routes.rb | 1 - spec/helpers/temp_landing_page_helper_spec.rb | 5 -- 6 files changed, 148 deletions(-) delete mode 100644 app/helpers/temp_landing_page_helper.rb delete mode 100644 app/views/home/temp_landing_page.html.haml delete mode 100644 app/views/layouts/landing_page.html.haml delete mode 100644 spec/helpers/temp_landing_page_helper_spec.rb diff --git a/app/controllers/enterprises_controller.rb b/app/controllers/enterprises_controller.rb index 90a04d5eb7..298c1d5a10 100644 --- a/app/controllers/enterprises_controller.rb +++ b/app/controllers/enterprises_controller.rb @@ -69,17 +69,4 @@ class EnterprisesController < BaseController redirect_to main_app.shop_path end - - # essentially the new 'show' action that renders non-spree view - # will need to be renamed into show once the old one is removed - def shop_front - options = {:enterprise_id => params[:id]} - options.merge(params.reject { |k,v| k == :id }) - - @enterprise = Enterprise.find params[:id] - - @searcher = Spree::Config.searcher_class.new(options) - @products = @searcher.retrieve_products - render :layout => "landing_page" - end end diff --git a/app/helpers/temp_landing_page_helper.rb b/app/helpers/temp_landing_page_helper.rb deleted file mode 100644 index 02277e7322..0000000000 --- a/app/helpers/temp_landing_page_helper.rb +++ /dev/null @@ -1,11 +0,0 @@ -module TempLandingPageHelper - def temp_landing_page_distributor_link_class(distributor) - cart = current_order(true) - @active_distributors ||= Enterprise.distributors_with_active_order_cycles - - klass = "shop-distributor" - klass += " empties-cart" unless cart.line_items.empty? || cart.distributor == distributor - klass += @active_distributors.include?(distributor) ? ' active' : ' inactive' - klass - end -end diff --git a/app/views/home/temp_landing_page.html.haml b/app/views/home/temp_landing_page.html.haml deleted file mode 100644 index 3ce57de4bc..0000000000 --- a/app/views/home/temp_landing_page.html.haml +++ /dev/null @@ -1,66 +0,0 @@ -!!! -%html - %head - %meta{charset: 'utf-8'}/ - %meta{name: 'viewport', content: "width=device-width,initial-scale=1.0"}/ - - %title Welcome to Open Food Network - = favicon_link_tag "favicon.png" - = stylesheet_link_tag "search/all" - = javascript_include_tag "search/all" - = javascript_include_tag "store/shop_front" - = render "layouts/bugherd_script" - - = csrf_meta_tags - %body - %nav.top-bar - %section.top-bar-section - %ul.left - %li= link_to image_tag("ofn_logo_small.png"), new_landing_page_path - %li.divider - - if spree_current_user.nil? - %li#login-link= link_to "Login", "#sidebar", id: "sidebarLoginButton", class: "sidebar-button" - %li#login-name.hide - %li.divider - %li#sign-up-link= link_to "Sign Up", "#sidebar", id: "sidebarSignUpButton", class: "sidebar-button" - %li#sign-out-link.hide= link_to "Sign Out", "/logout" - - else - %li#login-link.hide= link_to "Login", "#sidebar", id: "sidebarLoginButton", class: "sidebar-button" - %li#login-name= link_to "#{spree_current_user.email}", "#" - %li.divider - %li#sign-up-link.hide= link_to "Sign Up", "#" - %li#sign-out-link= link_to "Sign Out", "/logout" - - %section{ role: "main" } - .row.landing-page-row.with-bottom-border - .large-12.columns.centered - = image_tag "ofn_logo_black.png" - .row.landing-page-row.with-bottom-border.with-pin-bg - .large-12.columns.centered - %h3 WHERE WOULD YOU LIKE TO SHOP? - %p.secondary Select your hub from the list below - - if Rails.env.development? || Rails.env.staging? - .large-12.columns.centered - #environment= Rails.env.capitalize - - - @groups.in_groups_of(4, false) do |row| - .row.landing-page-row.hub_group{:class => (row.last == @groups.last ? "with-bottom-border" : "")} - - row.each do |group| - .large-3.columns - .group-header - %h5= group.name.upcase - - group.enterprises.is_distributor.by_name.each do |distributor| - .row.distributor-link-row - .large-12.columns - = render partial: "shared/distributor", object: distributor - - = render partial: "shared/footer" - - - - %section#sidebar{ role: "complementary" } - .login-panel - #login-content.hide - = render "home/login" - #sign-up-content.hide - = render "home/signup" diff --git a/app/views/layouts/landing_page.html.haml b/app/views/layouts/landing_page.html.haml deleted file mode 100644 index e03086a2b8..0000000000 --- a/app/views/layouts/landing_page.html.haml +++ /dev/null @@ -1,52 +0,0 @@ -!!! -%html - %head - %meta{charset: 'utf-8'}/ - %meta{name: 'viewport', content: "width=device-width,initial-scale=1.0"}/ - - %title= content_for?(:title) ? yield(:title) : 'Welcome to Open Food Network' - = favicon_link_tag "favicon.png" - = stylesheet_link_tag "search/all" - = javascript_include_tag "search/all" - = render "layouts/bugherd_script" - - = csrf_meta_tags - %body.off-canvas - = render "layouts/become_distributor" - = render "layouts/become_farmer" - - %nav.top-bar - %section.top-bar-section - %ul.left - %li= link_to image_tag("ofn_logo_small.png"), new_landing_page_path - %li.divider - - if spree_current_user.nil? - %li#login-link= link_to "Login", "#sidebar", id: "sidebarLoginButton", class: "sidebar-button" - %li#login-name.hide - %li.divider - %li#sign-up-link= link_to "Sign Up", "#sidebar", id: "sidebarSignUpButton", class: "sidebar-button" - %li#sign-out-link.hide= link_to "Sign Out", "/logout" - - else - %li#login-link.hide= link_to "Login", "#sidebar", id: "sidebarLoginButton", class: "sidebar-button" - %li#login-name= link_to "#{spree_current_user.email}", "#" - %li.divider - %li#sign-up-link.hide= link_to "Sign Up", "#" - %li#sign-out-link= link_to "Sign Out", "/logout" - - %ul.right - %li= link_to "Distributors", "#", :data => { "reveal-id" => "become-distributor" } - %li.divider - %li= link_to "Farmers", "#", :data => { "reveal-id" => "become-farmer" } - - %section{ role: "main" } - = yield - - %section#sidebar{ role: "complementary" } - .login-panel - #login-content.hide - = render "home/login" - #sign-up-content.hide - = render "home/signup" - - = yield :scripts - diff --git a/config/routes.rb b/config/routes.rb index f3160ce107..75516552a4 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -68,7 +68,6 @@ Openfoodnetwork::Application.routes.draw do end end - get "new_landing_page", :controller => 'home', :action => "new_landing_page" get "about_us", :controller => 'home', :action => "about_us" namespace :open_food_network do diff --git a/spec/helpers/temp_landing_page_helper_spec.rb b/spec/helpers/temp_landing_page_helper_spec.rb deleted file mode 100644 index 625dca57f4..0000000000 --- a/spec/helpers/temp_landing_page_helper_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'spec_helper' - -describe TempLandingPageHelper do - -end