WIP: Rename ofnEmptiesCart to ofnChangeHub

This commit is contained in:
Rohan Mitchell
2015-07-30 10:06:09 +10:00
parent fc409c97bf
commit 5688cfd1dd
6 changed files with 33 additions and 35 deletions

View File

@@ -1,9 +1,9 @@
Darkswarm.directive "ofnEmptiesCart", (CurrentHub, Cart, storage) ->
Darkswarm.directive "ofnChangeHub", (CurrentHub, Cart, storage) ->
# Compares scope.hub with CurrentHub. Will trigger an confirmation if they are different,
# and Cart isn't empty
restrict: "A"
scope:
hub: "=ofnEmptiesCart"
hub: "=ofnChangeHub"
link: (scope, elm, attr)->
cart_will_need_emptying = ->
CurrentHub.hub?.id and CurrentHub.hub.id isnt scope.hub.id and !Cart.empty()

View File

@@ -2,7 +2,7 @@
.highlight-top.row
.small-12.medium-7.large-8.columns
%h3{"ng-if" => "enterprise.is_distributor"}
%a{"bo-href" => "enterprise.path", "ofn-empties-cart" => "enterprise"}
%a{"bo-href" => "enterprise.path", "ofn-change-hub" => "enterprise"}
%i{"ng-class" => "enterprise.icon_font"}
%span{"bo-text" => "enterprise.name"}
%h3{"ng-if" => "!enterprise.is_distributor", "ng-class" => "{'is_producer' : enterprise.is_primary_producer}"}
@@ -10,4 +10,4 @@
%span{"bo-text" => "enterprise.name"}
.small-12.medium-5.large-4.columns.text-right.small-only-text-left
%p{"bo-bind" => "[enterprise.address.city, enterprise.address.state_name] | printArray"}
%img.hero-img{"bo-src" => "enterprise.promo_image"}
%img.hero-img{"bo-src" => "enterprise.promo_image"}

View File

@@ -1,16 +1,15 @@
.row.pad-top{bindonce: true, "ng-if" => "enterprise.hubs.length > 0 && enterprise.is_distributor"}
.cta-container.small-12.columns
%label
Shop for
%strong{"bo-text" => "enterprise.name"}
%label
Shop for
%strong{"bo-text" => "enterprise.name"}
products at:
%a.cta-hub{"ng-repeat" => "hub in enterprise.hubs",
"bo-href" => "hub.path",
%a.cta-hub{"ng-repeat" => "hub in enterprise.hubs",
"bo-href" => "hub.path",
"bo-class" => "{primary: hub.active, secondary: !hub.active}",
"ofn-empties-cart" => "hub"}
"ofn-change-hub" => "hub"}
%i.ofn-i_033-open-sign{"bo-if" => "hub.active"}
%i.ofn-i_032-closed-sign{"bo-if" => "!hub.active"}
.hub-name{"bo-text" => "hub.name"}
.hub-name{"bo-text" => "hub.name"}
.button-address{"bo-bind" => "[hub.address.city, hub.address.state_name] | printArray"}
/ %i.ofn-i_007-caret-right

View File

@@ -5,18 +5,18 @@
%label{"active-table-hub-link" => "enterprise", change: "Change shop to:", shop: "Shop now at:"}
.small-8.columns.right
%label.right{"bo-if" => "enterprise.pickup || enterprise.delivery"}
Delivery options:
%span{"bo-if" => "enterprise.pickup"}
Delivery options:
%span{"bo-if" => "enterprise.pickup"}
%i.ofn-i_038-takeaway
Pickup
%span{"bo-if" => "enterprise.delivery"}
%span{"bo-if" => "enterprise.delivery"}
%i.ofn-i_039-delivery
Delivery
.row
.columns.small-12
%a.cta-hub{"bo-href" => "enterprise.path",
%a.cta-hub{"bo-href" => "enterprise.path",
"ng-class" => "{primary: enterprise.active, secondary: !enterprise.active}",
"ofn-empties-cart" => "enterprise"}
"ofn-change-hub" => "enterprise"}
%i.ofn-i_033-open-sign{"bo-if" => "enterprise.active"}
%i.ofn-i_032-closed-sign{"bo-if" => "!enterprise.active"}
.hub-name{"bo-text" => "enterprise.name"}