diff --git a/app/assets/javascripts/darkswarm/controllers/tabs/about_us_controller.js.coffee b/app/assets/javascripts/darkswarm/controllers/tabs/about_us_controller.js.coffee new file mode 100644 index 0000000000..c86cf12286 --- /dev/null +++ b/app/assets/javascripts/darkswarm/controllers/tabs/about_us_controller.js.coffee @@ -0,0 +1,2 @@ +Darkswarm.controller "AboutUsCtrl", ($scope, CurrentHub) -> + $scope.CurrentHub = CurrentHub diff --git a/app/assets/javascripts/darkswarm/services/current_hub.js.coffee b/app/assets/javascripts/darkswarm/services/current_hub.js.coffee index 68fcd6e3f6..d89bec9c20 100644 --- a/app/assets/javascripts/darkswarm/services/current_hub.js.coffee +++ b/app/assets/javascripts/darkswarm/services/current_hub.js.coffee @@ -1,5 +1,2 @@ -Darkswarm.factory 'CurrentHub', ($location, $filter, currentHub) -> - new class CurrentHub - constructor: -> - @[k] = v for k, v of currentHub - +Darkswarm.factory 'CurrentHub', ($location, $filter, currentHub, Enterprises) -> + Enterprises.enterprises_by_id[currentHub.id] diff --git a/app/views/home/_hubs.html.haml b/app/views/home/_hubs.html.haml index 55b8cc29ca..12d21623cc 100644 --- a/app/views/home/_hubs.html.haml +++ b/app/views/home/_hubs.html.haml @@ -1,6 +1,4 @@ #hubs.hubs{"ng-controller" => "HubsCtrl"} - = inject_enterprises - .row .small-12.columns.text-center %h1 Ready to shop? diff --git a/app/views/json/_current_hub.rabl b/app/views/json/_current_hub.rabl index 7f615bb07a..33bacd38b1 100644 --- a/app/views/json/_current_hub.rabl +++ b/app/views/json/_current_hub.rabl @@ -1,8 +1,2 @@ object current_distributor -attributes :name, :id - -if current_distributor - child suppliers: :producers do - extends "json/producer" - end -end +attributes :id diff --git a/app/views/layouts/darkswarm.html.haml b/app/views/layouts/darkswarm.html.haml index 0bc90f9234..d7063b6e1e 100644 --- a/app/views/layouts/darkswarm.html.haml +++ b/app/views/layouts/darkswarm.html.haml @@ -25,6 +25,7 @@ = inject_json "currentOrder", "current_order" = inject_json "user", "current_user" = inject_json "railsFlash", "flash" + = inject_enterprises .off-canvas-wrap{offcanvas: true} .inner-wrap diff --git a/app/views/map/index.html.haml b/app/views/map/index.html.haml index e7f6006ae4..3c9e9b64ec 100644 --- a/app/views/map/index.html.haml +++ b/app/views/map/index.html.haml @@ -1,5 +1,3 @@ -= inject_enterprises - .map-container{"fill-vertical" => true} %map{"ng-controller" => "MapCtrl"} %google-map{options: "map.additional_options", center: "map.center", zoom: "map.zoom", styles: "map.styles", draggable: "true"} diff --git a/app/views/producers/index.haml b/app/views/producers/index.haml index 2c3253a141..f13c0aadb7 100644 --- a/app/views/producers/index.haml +++ b/app/views/producers/index.haml @@ -1,6 +1,4 @@ .producers{"ng-controller" => "ProducersCtrl"} - = inject_enterprises - .row .small-12.columns.text-center.pad-top %h1 Producers diff --git a/app/views/shop/products/_form.html.haml b/app/views/shop/products/_form.html.haml index 65a02cbaca..e18c197594 100644 --- a/app/views/shop/products/_form.html.haml +++ b/app/views/shop/products/_form.html.haml @@ -1,9 +1,7 @@ %products.small-12.columns{"ng-controller" => "ProductsCtrl", "ng-show" => "order_cycle.order_cycle_id != null", "infinite-scroll" => "incrementLimit()", "infinite-scroll-distance" => "1"} - = inject_enterprises = form_for :order, :url => populate_orders_path, html: {:class => "custom"} do - .row .small-6.columns %input#search.text{"ng-model" => "query", diff --git a/app/views/shopping_shared/_about.html.haml b/app/views/shopping_shared/_about.html.haml index 264ab7ef28..397ae1f041 100644 --- a/app/views/shopping_shared/_about.html.haml +++ b/app/views/shopping_shared/_about.html.haml @@ -1,16 +1,9 @@ -.content#about +.content#about{"ng-controller" => "AboutUsCtrl", bindonce: true} .row .small-12.large-6.columns - %img.hero-img-small{"ng-src" => "{{current_distributor.promo_image}}"} - %p.small-text= current_distributor.long_description.andand.html_safe - + %img.hero-img-small{"bo-src" => "CurrentHub.promo_image"} + %p.small-text{"bo-html" => "CurrentHub.long_description"} .small-12.large-3.columns   - .small-12.large-3.columns - %img{"bo-src" => "current_distributor.logo", "bo-if" => "current_distributor.logo"} - - -#- if current_distributor.promo_image.exists? - -#.small-12.large-3.columns - -#%img.about.right{src: current_distributor.promo_image.url(:large)} - + %img{"bo-src" => "CurrentHub.logo", "bo-if" => "CurrentHub.logo"}