From b11533a6299daf5d34d7bab644b8c115dc27058e Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Fri, 7 Feb 2014 16:52:18 +1100 Subject: [PATCH] Renaming ShopController to Shop::ShopController --- app/controllers/{ => shop}/shop_controller.rb | 6 +++--- app/views/shop/{ => shop}/_about_us.html.haml | 0 app/views/shop/{ => shop}/_contact_us.html.haml | 0 app/views/shop/{ => shop}/_last_order_cycle.html.haml | 0 app/views/shop/{ => shop}/_next_order_cycle.html.haml | 0 app/views/shop/{ => shop}/_order_cycle.rabl | 0 app/views/shop/{ => shop}/_order_cycles.html.haml | 6 +++--- app/views/shop/{ => shop}/_products.html.haml | 2 +- app/views/shop/{ => shop}/_variant.html.haml | 0 app/views/shop/{ => shop}/products.rabl | 0 app/views/shop/{ => shop}/show.html.haml | 8 ++++---- config/routes.rb | 2 +- spec/controllers/{ => shop}/shop_controller_spec.rb | 2 +- spec/features/consumer/{ => shopping}/shopping_spec.rb | 0 14 files changed, 13 insertions(+), 13 deletions(-) rename app/controllers/{ => shop}/shop_controller.rb (89%) rename app/views/shop/{ => shop}/_about_us.html.haml (100%) rename app/views/shop/{ => shop}/_contact_us.html.haml (100%) rename app/views/shop/{ => shop}/_last_order_cycle.html.haml (100%) rename app/views/shop/{ => shop}/_next_order_cycle.html.haml (100%) rename app/views/shop/{ => shop}/_order_cycle.rabl (100%) rename app/views/shop/{ => shop}/_order_cycles.html.haml (86%) rename app/views/shop/{ => shop}/_products.html.haml (98%) rename app/views/shop/{ => shop}/_variant.html.haml (100%) rename app/views/shop/{ => shop}/products.rabl (100%) rename app/views/shop/{ => shop}/show.html.haml (89%) rename spec/controllers/{ => shop}/shop_controller_spec.rb (99%) rename spec/features/consumer/{ => shopping}/shopping_spec.rb (100%) diff --git a/app/controllers/shop_controller.rb b/app/controllers/shop/shop_controller.rb similarity index 89% rename from app/controllers/shop_controller.rb rename to app/controllers/shop/shop_controller.rb index fd1926e102..e0862d205e 100644 --- a/app/controllers/shop_controller.rb +++ b/app/controllers/shop/shop_controller.rb @@ -1,4 +1,4 @@ -class ShopController < BaseController +class Shop::ShopController < BaseController layout "darkswarm" before_filter :set_distributor @@ -22,12 +22,12 @@ class ShopController < BaseController if request.post? if oc = OrderCycle.with_distributor(@distributor).active.find_by_id(params[:order_cycle_id]) current_order(true).set_order_cycle! oc - render partial: "shop/order_cycle" + render partial: "shop/shop/order_cycle" else render status: 404, json: "" end else - render partial: "shop/order_cycle" + render partial: "shop/shop/order_cycle" end end diff --git a/app/views/shop/_about_us.html.haml b/app/views/shop/shop/_about_us.html.haml similarity index 100% rename from app/views/shop/_about_us.html.haml rename to app/views/shop/shop/_about_us.html.haml diff --git a/app/views/shop/_contact_us.html.haml b/app/views/shop/shop/_contact_us.html.haml similarity index 100% rename from app/views/shop/_contact_us.html.haml rename to app/views/shop/shop/_contact_us.html.haml diff --git a/app/views/shop/_last_order_cycle.html.haml b/app/views/shop/shop/_last_order_cycle.html.haml similarity index 100% rename from app/views/shop/_last_order_cycle.html.haml rename to app/views/shop/shop/_last_order_cycle.html.haml diff --git a/app/views/shop/_next_order_cycle.html.haml b/app/views/shop/shop/_next_order_cycle.html.haml similarity index 100% rename from app/views/shop/_next_order_cycle.html.haml rename to app/views/shop/shop/_next_order_cycle.html.haml diff --git a/app/views/shop/_order_cycle.rabl b/app/views/shop/shop/_order_cycle.rabl similarity index 100% rename from app/views/shop/_order_cycle.rabl rename to app/views/shop/shop/_order_cycle.rabl diff --git a/app/views/shop/_order_cycles.html.haml b/app/views/shop/shop/_order_cycles.html.haml similarity index 86% rename from app/views/shop/_order_cycles.html.haml rename to app/views/shop/shop/_order_cycles.html.haml index 5c2986bedf..22463e677b 100644 --- a/app/views/shop/_order_cycles.html.haml +++ b/app/views/shop/shop/_order_cycles.html.haml @@ -1,7 +1,7 @@ %ordercycle{"ng-controller" => "OrderCycleCtrl"} :javascript - angular.module('Shop').value('orderCycleData', #{render "shop/order_cycle"}) + angular.module('Shop').value('orderCycleData', #{render "shop/shop/order_cycle"}) - if @order_cycles.empty? @@ -10,8 +10,8 @@ Please contact your hub directly to see if they accept late orders, or wait until the next cycle opens. - = render partial: "shop/next_order_cycle" - = render partial: "shop/last_order_cycle" + = render partial: "shop/shop/next_order_cycle" + = render partial: "shop/shop/last_order_cycle" - else %form.custom diff --git a/app/views/shop/_products.html.haml b/app/views/shop/shop/_products.html.haml similarity index 98% rename from app/views/shop/_products.html.haml rename to app/views/shop/shop/_products.html.haml index 98b6a7ecf1..85bd5cf7ac 100644 --- a/app/views/shop/_products.html.haml +++ b/app/views/shop/shop/_products.html.haml @@ -50,5 +50,5 @@ %tr.product-description %td{colspan: 2}{{ product.notes | truncate:80 }} %tr{"ng-repeat" => "variant in product.variants", "ng-show" => "product.show_variants"} - = render partial: "shop/variant" + = render partial: "shop/shop/variant" %input.button.right{type: :submit, value: "Check Out"} diff --git a/app/views/shop/_variant.html.haml b/app/views/shop/shop/_variant.html.haml similarity index 100% rename from app/views/shop/_variant.html.haml rename to app/views/shop/shop/_variant.html.haml diff --git a/app/views/shop/products.rabl b/app/views/shop/shop/products.rabl similarity index 100% rename from app/views/shop/products.rabl rename to app/views/shop/shop/products.rabl diff --git a/app/views/shop/show.html.haml b/app/views/shop/shop/show.html.haml similarity index 89% rename from app/views/shop/show.html.haml rename to app/views/shop/shop/show.html.haml index 6f1f0b0181..5063841152 100644 --- a/app/views/shop/show.html.haml +++ b/app/views/shop/shop/show.html.haml @@ -9,7 +9,7 @@ %small %a{href: "/"} Change location - = render partial: "shop/order_cycles" + = render partial: "shop/shop/order_cycles" -#%description @@ -44,9 +44,9 @@ %p Contact %products.row - = render partial: "shop/products" + = render partial: "shop/shop/products" #footer %section.row - = render partial: "shop/contact_us" - = render partial: "shop/about_us" + = render partial: "shop/shop/contact_us" + = render partial: "shop/shop/about_us" = render partial: "shared/copyright" diff --git a/config/routes.rb b/config/routes.rb index bcbd37d7db..479970737d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,7 +1,7 @@ Openfoodnetwork::Application.routes.draw do root :to => 'home#temp_landing_page' - resource :shop, controller: :shop do + resource :shop, controller: "shop/shop" do get :products post :order_cycle get :order_cycle diff --git a/spec/controllers/shop_controller_spec.rb b/spec/controllers/shop/shop_controller_spec.rb similarity index 99% rename from spec/controllers/shop_controller_spec.rb rename to spec/controllers/shop/shop_controller_spec.rb index 6b539fdbef..f440da9805 100644 --- a/spec/controllers/shop_controller_spec.rb +++ b/spec/controllers/shop/shop_controller_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe ShopController do +describe Shop::ShopController do let(:d) { create(:distributor_enterprise) } it "redirects to the home page if no distributor is selected" do diff --git a/spec/features/consumer/shopping_spec.rb b/spec/features/consumer/shopping/shopping_spec.rb similarity index 100% rename from spec/features/consumer/shopping_spec.rb rename to spec/features/consumer/shopping/shopping_spec.rb