From f7ba8cade0bc0bd629ecf8f4d8f505b7bc3d1661 Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Tue, 24 Jun 2014 13:01:51 +1000 Subject: [PATCH] Bunch of minor bugfixes --- .../controllers/tabs/producers_controller.js.coffee | 3 ++- app/assets/javascripts/templates/partials/contact.html.haml | 5 +++-- app/views/home/_fat.html.haml | 2 +- app/views/json/partials/_hub.rabl | 6 ++++-- app/views/modals/_producer.html.haml | 5 +++-- app/views/shop/products/_master.html.haml | 4 ++-- app/views/shop/products/_variants.html.haml | 4 ++-- app/views/spree/orders/show.html.haml | 2 ++ 8 files changed, 19 insertions(+), 12 deletions(-) diff --git a/app/assets/javascripts/darkswarm/controllers/tabs/producers_controller.js.coffee b/app/assets/javascripts/darkswarm/controllers/tabs/producers_controller.js.coffee index 92cf8dedfc..6db73f7af3 100644 --- a/app/assets/javascripts/darkswarm/controllers/tabs/producers_controller.js.coffee +++ b/app/assets/javascripts/darkswarm/controllers/tabs/producers_controller.js.coffee @@ -1,2 +1,3 @@ -Darkswarm.controller "ProducersTabCtrl", ($scope, CurrentHub) -> +Darkswarm.controller "ProducersTabCtrl", ($scope, CurrentHub, Enterprises) -> + # Injecting Enterprises so CurrentHub.producers is dereferenced $scope.CurrentHub = CurrentHub diff --git a/app/assets/javascripts/templates/partials/contact.html.haml b/app/assets/javascripts/templates/partials/contact.html.haml index 3a64615be1..8831a8436e 100644 --- a/app/assets/javascripts/templates/partials/contact.html.haml +++ b/app/assets/javascripts/templates/partials/contact.html.haml @@ -5,8 +5,9 @@ {{ enterprise.phone }} %p{"ng-if" => "enterprise.email"} - %a{"ng-href" => "mailto:{{enterprise.email | stripUrl}}", target: "_blank" } - {{ enterprise.email | stripUrl }} + %a{"ng-href" => "{{enterprise.email | stripUrl}}", target: "_blank", mailto: true} + %span.email + {{ enterprise.email | stripUrl }} %p{"ng-if" => "enterprise.website"} %a{"ng-href" => "http://{{enterprise.website | stripUrl}}", target: "_blank" } diff --git a/app/views/home/_fat.html.haml b/app/views/home/_fat.html.haml index f9c0db6810..15bff714f4 100644 --- a/app/views/home/_fat.html.haml +++ b/app/views/home/_fat.html.haml @@ -30,7 +30,7 @@ %li{"ng-repeat" => "enterprise in hub.producers"} = render partial: "modals/producer" -.row.active_table_row.link{"ng-show" => "open()", "bo-if" => "hub.active"} +.row.active_table_row.link{"ng-show" => "open()"} .cta-container.columns.small-12 .row .columns.small-12 diff --git a/app/views/json/partials/_hub.rabl b/app/views/json/partials/_hub.rabl index 2df71001cb..ed9520b43e 100644 --- a/app/views/json/partials/_hub.rabl +++ b/app/views/json/partials/_hub.rabl @@ -13,8 +13,10 @@ end node :delivery do |hub| hub.shipping_methods.where(:require_ship_address => true).present? end -node :active do |hub| - @active_distributors.include?(hub) +if @active_distributors + node :active do |hub| + @active_distributors.include?(hub) + end end node :orders_close_at do |hub| OrderCycle.first_closing_for(hub).andand.orders_close_at diff --git a/app/views/modals/_producer.html.haml b/app/views/modals/_producer.html.haml index 044cf3cdf0..6f8d8951f1 100644 --- a/app/views/modals/_producer.html.haml +++ b/app/views/modals/_producer.html.haml @@ -23,8 +23,9 @@ {{ enterprise.phone }} %p{"bo-if" => "enterprise.email"} - %a{"ng-href" => "mailto:{{enterprise.email | stripUrl}}", target: "_blank" } - {{ enterprise.email | stripUrl }} + %a{"ng-href" => "{{enterprise.email | stripUrl}}", target: "_blank", mailto: true } + %span.email + {{ enterprise.email | stripUrl }} %p{"bo-show" => "enterprise.website"} %a{"ng-href" => "http://{{enterprise.website}}", target: "_blank" } diff --git a/app/views/shop/products/_master.html.haml b/app/views/shop/products/_master.html.haml index c06acb5cb1..4c00365f71 100644 --- a/app/views/shop/products/_master.html.haml +++ b/app/views/shop/products/_master.html.haml @@ -15,7 +15,7 @@ name: "variants[{{product.master.id}}]", id: "variants_{{product.master.id}}", "ng-model" => "product.quantity"} - %small {{ product.master.unit_to_display }} + %small x {{ product.master.unit_to_display }} -# WITH GROUP BUY .small-2.columns{"bo-if" => "product.group_buy"} @@ -36,7 +36,7 @@ max: "{{product.on_demand && 9999 || product.count_on_hand }}", name: "variant_attributes[{{product.master.id}}][max_quantity]", "ng-model" => "product.max_quantity"} - {{ product.master.unit_to_display }} + %small x {{ product.master.unit_to_display }} .small-2.columns.text-right {{ product.price | currency }} diff --git a/app/views/shop/products/_variants.html.haml b/app/views/shop/products/_variants.html.haml index 9faaa5e8b1..fed7753ff3 100644 --- a/app/views/shop/products/_variants.html.haml +++ b/app/views/shop/products/_variants.html.haml @@ -18,7 +18,7 @@ max: "{{variant.on_demand && 9999 || variant.count_on_hand }}", name: "variants[{{variant.id}}]", id: "variants_{{variant.id}}", "bo-model" => "variant.quantity"} - %small {{ variant.unit_to_display }} + %small x {{ variant.unit_to_display }} -# WITH GROUP BUY .small-2.columns{"bo-if" => "product.group_buy"} @@ -39,7 +39,7 @@ max: "{{variant.on_demand && 9999 || variant.count_on_hand }}", name: "variant_attributes[{{variant.id}}][max_quantity]", "ng-model" => "variant.max_quantity"} - %small {{ variant.unit_to_display }} + %small x {{ variant.unit_to_display }} .small-2.columns.text-right.price {{ variant.price | currency }} diff --git a/app/views/spree/orders/show.html.haml b/app/views/spree/orders/show.html.haml index f0fe766696..1f020f8c1f 100644 --- a/app/views/spree/orders/show.html.haml +++ b/app/views/spree/orders/show.html.haml @@ -1,3 +1,5 @@ += inject_enterprises + .darkswarm - content_for :order_cycle_form do %strong.avenir