From 58e810a73625c238baea871449622d115b4810bb Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Thu, 19 Jun 2014 12:38:30 +1000 Subject: [PATCH] Using enterprise in modals --- .../darkswarm/services/map_modal.js.coffee | 1 + .../templates/partials/contact.html.haml | 18 +++++++++--------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/app/assets/javascripts/darkswarm/services/map_modal.js.coffee b/app/assets/javascripts/darkswarm/services/map_modal.js.coffee index cd82edbe98..1c9bf13bb3 100644 --- a/app/assets/javascripts/darkswarm/services/map_modal.js.coffee +++ b/app/assets/javascripts/darkswarm/services/map_modal.js.coffee @@ -3,6 +3,7 @@ Darkswarm.factory "MapModal", ($modal, $rootScope)-> open: (enterprise)-> scope = $rootScope.$new(true) # Spawn an isolate to contain the enterprise + scope.enterprise = enterprise if enterprise.is_distributor scope.hub = enterprise $modal.open(templateUrl: "map_modal_hub.html", scope: scope) diff --git a/app/assets/javascripts/templates/partials/contact.html.haml b/app/assets/javascripts/templates/partials/contact.html.haml index 2811a221a5..83e7926bf0 100644 --- a/app/assets/javascripts/templates/partials/contact.html.haml +++ b/app/assets/javascripts/templates/partials/contact.html.haml @@ -1,12 +1,12 @@ -%div.modal-centered{"bo-if" => "producer.email || producer.website || producer.address.phone"} +%div.modal-centered{"bo-if" => "enterprise.email || enterprise.website || enterprise.address.phone"} %h5.modal-header Contact - %p{"ng-if" => "producer.address.phone"} - {{ producer.address.phone }} + %p{"ng-if" => "enterprise.address.phone"} + {{ enterprise.address.phone }} - %p{"bo-if" => "producer.email"} - %a{"ng-href" => "mailto:{{producer.email | stripUrl}}", target: "_blank" } - {{ producer.email | stripUrl }} + %p{"bo-if" => "enterprise.email"} + %a{"ng-href" => "mailto:{{enterprise.email | stripUrl}}", target: "_blank" } + {{ enterprise.email | stripUrl }} - %p{"ng-if" => "producer.website"} - %a{"ng-href" => "http://{{producer.website | stripUrl}}", target: "_blank" } - {{ producer.website | stripUrl }} + %p{"ng-if" => "enterprise.website"} + %a{"ng-href" => "http://{{enterprise.website | stripUrl}}", target: "_blank" } + {{ enterprise.website | stripUrl }}