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"}

View File

@@ -1,6 +1,6 @@
.row.active_table_row{"ng-if" => "hub.is_distributor", "ng-click" => "toggle($event)", "ng-class" => "{'closed' : !open(), 'is_distributor' : producer.is_distributor}", bindonce: true}
.columns.small-12.medium-5.large-5.skinny-head
%a.hub{"bo-href" => "hub.path", "ng-class" => "{primary: hub.active, secondary: !hub.active}", "ofn-empties-cart" => "hub", "data-is-link" => "true"}
%a.hub{"bo-href" => "hub.path", "ng-class" => "{primary: hub.active, secondary: !hub.active}", "ofn-change-hub" => "hub", "data-is-link" => "true"}
%i{bo: {class: "hub.icon_font"}}
%span.margin-top.hub-name-listing{"bo-bind" => "hub.name | truncate:40"}
@@ -11,7 +11,7 @@
%span.margin-top{"ng-if" => "hub.distance != null && hub.distance > 0"} ({{ hub.distance / 1000 | number:0 }} km)
.columns.small-4.medium-3.large-3.text-right{"bo-if" => "hub.active"}
%a.hub.open_closed{"bo-href" => "hub.path", "ng-class" => "{primary: hub.active, secondary: !hub.active}", "ofn-empties-cart" => "hub"}
%a.hub.open_closed{"bo-href" => "hub.path", "ng-class" => "{primary: hub.active, secondary: !hub.active}", "ofn-change-hub" => "hub"}
%i.ofn-i_033-open-sign
%span.margin-top{ bo: { if: "current()" } }
%em Shopping here
@@ -19,7 +19,7 @@
%span{"bo-bind" => "hub.orders_close_at | sensible_timeframe"}
.columns.small-4.medium-3.large-3.text-right{"bo-if" => "!hub.active"}
%a.hub.open_closed{"bo-href" => "hub.path", "ng-class" => "{primary: hub.active, secondary: !hub.active}", "ofn-empties-cart" => "hub"}
%a.hub.open_closed{"bo-href" => "hub.path", "ng-class" => "{primary: hub.active, secondary: !hub.active}", "ofn-change-hub" => "hub"}
%i.ofn-i_032-closed-sign
%span.margin-top{ bo: { if: "current()" } }
%em Shopping here

View File

@@ -1,5 +1,5 @@
.row.active_table_row{"ng-if" => "open()", "ng-click" => "toggle($event)", "ng-class" => "{'open' : !ofn-i_032-closed-sign()}"}
.columns.small-12.medium-7.large-7.fat
/ Will add in long description available once clean up HTML formatting producer.long_description
%div{"bo-if" => "producer.description"}
@@ -10,23 +10,23 @@
%label  
.columns.small-12.medium-5.large-5.fat
%div{"bo-if" => "producer.supplied_taxons"}
%label Shop for
%p.trans-sentence
%span.fat-taxons{"ng-repeat" => "taxon in producer.supplied_taxons"}
%render-svg{path: "{{taxon.icon}}"}
%span{"bo-text" => "taxon.name"}
%div.show-for-medium-up{"ng-if" => "producer.supplied_taxons.length==0"}
 
%div{"bo-if" => "producer.email || producer.website || producer.phone"}
%label Contact
%p.word-wrap{"bo-if" => "producer.phone"}
Call
%span{"bo-text" => "producer.phone"}
Call
%span{"bo-text" => "producer.phone"}
%p.word-wrap{"bo-if" => "producer.email"}
%a{"bo-href" => "producer.email | stripUrl", target: "_blank", mailto: true}
@@ -39,20 +39,20 @@
%div{"bo-if" => "producer.twitter || producer.facebook || producer.linkedin || producer.instagram"}
%label Follow
.follow-icons{bindonce: true}
%span{"bo-if" => "producer.twitter"}
%span{"bo-if" => "producer.twitter"}
%a{"bo-href-i" => "http://twitter.com/{{producer.twitter}}", target: "_blank"}
%i.ofn-i_041-twitter
%span{"bo-if" => "producer.facebook"}
%a{"bo-href-i" => "http://{{producer.facebook | stripUrl}}", target: "_blank"}
%i.ofn-i_044-facebook
%span{"bo-if" => "producer.linkedin"}
%a{"bo-href-i" => "http://{{producer.linkedin | stripUrl}}", target: "_blank"}
%i.ofn-i_042-linkedin
%span{"bo-if" => "producer.instagram"}
%a{"bo-href-i" => "http://instagram.com/{{producer.instagram}}", target: "_blank"}
%a{"bo-href-i" => "http://instagram.com/{{producer.instagram}}", target: "_blank"}
%i.ofn-i_043-instagram
.row.active_table_row.pad-top{"ng-if" => "open()", "bo-if" => "producer.hubs"}
@@ -60,19 +60,18 @@
.row
.columns.small-12.fat
%div{"bo-if" => "producer.name"}
%label
%label
Shop for
%span.turquoise{"bo-text" => "producer.name"}
%span.turquoise{"bo-text" => "producer.name"}
products at:
%div.show-for-medium-up{"bo-if" => "!producer.name"}
 
.row.cta-container
.columns.small-12
%a.cta-hub{"ng-repeat" => "hub in producer.hubs | orderBy:'-active'",
"bo-href" => "hub.path", "ofn-empties-cart" => "hub",
"bo-href" => "hub.path", "ofn-change-hub" => "hub",
"bo-class" => "{primary: hub.active, secondary: !hub.active}"}
%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"}
.button-address{"bo-bind" => "[hub.address.city, hub.address.state_name] | printArray"}