mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Adding working modals
This commit is contained in:
@@ -6,4 +6,6 @@ Darkswarm.controller "ProductNodeCtrl", ($scope) ->
|
||||
else
|
||||
$scope.product.price
|
||||
|
||||
$scope.producer = $scope.product.supplier
|
||||
|
||||
$scope.hasVariants = $scope.product.variants.length > 0
|
||||
|
||||
@@ -8,7 +8,10 @@ Darkswarm.directive "ofnModal", ($modal)->
|
||||
link: (scope, elem, attrs, ctrl, transclude)->
|
||||
scope.title = attrs.title
|
||||
contents = null
|
||||
transclude scope, (clone)->
|
||||
|
||||
# We're using an isolate scope, which is a child of the original scope
|
||||
# We have to compile the transclude against the original scope, not the isolate
|
||||
transclude scope.$parent, (clone)->
|
||||
contents = clone
|
||||
|
||||
elem.on "click", =>
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
%ofn-modal{title: "{{ producer.name }}"}
|
||||
#producer_modal{bindonce: true}
|
||||
#producer_modal
|
||||
.row
|
||||
.small-12.columns
|
||||
%img{"bo-src" => "producer.promo_image"}
|
||||
%img{"ng-src" => "producer.promo_image"}
|
||||
%h3 {{ producer.name }}
|
||||
|
||||
.row
|
||||
.small-6.columns
|
||||
%p
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
%ofn-modal{title: "{{product.name}}"}
|
||||
|
||||
{{ product | json }}
|
||||
{{ product.description }}
|
||||
@@ -6,11 +6,10 @@
|
||||
%img{"bo-src" => "product.primary_taxon.icon",
|
||||
"ng-click" => "ordering.order = 'primary_taxon.name'",
|
||||
name: "{{product.primary_taxon.name}}"}
|
||||
{{ product.name}}
|
||||
-#= render partial: "shop/products/modal"
|
||||
= render partial: "modals/product"
|
||||
|
||||
.small-5.columns.summary-header
|
||||
{{ product.supplier.name }}
|
||||
= render partial: "modals/producer"
|
||||
|
||||
.small-2.columns.summary-price.text-right.price
|
||||
%span{"ng-if" => "hasVariants"}
|
||||
|
||||
Reference in New Issue
Block a user