From 8b1c2b1e9e8fce73835a12902a1720a67c580538 Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Thu, 5 Jun 2014 17:12:38 +1000 Subject: [PATCH] New icons and some more enterprise data --- app/assets/images/map-icon-hub.svg | 50 +++++++------- app/assets/images/map-icon-producer.svg | 68 ++++++++----------- .../controllers/map_controller.js.coffee | 6 +- .../darkswarm/services/map.js.coffee | 2 + app/views/json/_enterprises_for_map.rabl | 13 +++- app/views/map/index.html.haml | 1 - 6 files changed, 72 insertions(+), 68 deletions(-) diff --git a/app/assets/images/map-icon-hub.svg b/app/assets/images/map-icon-hub.svg index 56030e2446..34665a2870 100644 --- a/app/assets/images/map-icon-hub.svg +++ b/app/assets/images/map-icon-hub.svg @@ -1,33 +1,35 @@ - - + + - + + + + - - - - + + + diff --git a/app/assets/images/map-icon-producer.svg b/app/assets/images/map-icon-producer.svg index b636cb0db8..7af7c35bf1 100644 --- a/app/assets/images/map-icon-producer.svg +++ b/app/assets/images/map-icon-producer.svg @@ -1,47 +1,39 @@ - - + + - + + + + + + + + - - - - - - + + diff --git a/app/assets/javascripts/darkswarm/controllers/map_controller.js.coffee b/app/assets/javascripts/darkswarm/controllers/map_controller.js.coffee index 7e47c60ded..f6c7fb341a 100644 --- a/app/assets/javascripts/darkswarm/controllers/map_controller.js.coffee +++ b/app/assets/javascripts/darkswarm/controllers/map_controller.js.coffee @@ -2,7 +2,7 @@ Darkswarm.controller "MapCtrl", ($scope, MapConfiguration, OfnMap)-> $scope.OfnMap = OfnMap $scope.map = center: - latitude: -37.775757 - longitude: 144.743663 - zoom: 8 + latitude: -37.4713077 + longitude: 144.7851531 + zoom: 12 styles: MapConfiguration.options diff --git a/app/assets/javascripts/darkswarm/services/map.js.coffee b/app/assets/javascripts/darkswarm/services/map.js.coffee index 9140b9de22..a59631a741 100644 --- a/app/assets/javascripts/darkswarm/services/map.js.coffee +++ b/app/assets/javascripts/darkswarm/services/map.js.coffee @@ -11,4 +11,6 @@ Darkswarm.factory "OfnMap", (enterprisesForMap, MapModal)-> @[k] = v for k, v of enterprise reveal: => + + console.log @ MapModal.open @ diff --git a/app/views/json/_enterprises_for_map.rabl b/app/views/json/_enterprises_for_map.rabl index da50f7eaf3..006f2e3cca 100644 --- a/app/views/json/_enterprises_for_map.rabl +++ b/app/views/json/_enterprises_for_map.rabl @@ -1,9 +1,18 @@ collection @enterprises extends 'json/enterprises' -attributes :latitude, :longitude +attributes :latitude, :longitude, :long_description, :website, :instagram, :linkedin, :twitter, :facebook + +node :logo do |enterprise| + enterprise.logo(:medium) if enterprise.logo.exists? +end +node :promo_image do |enterprise| + enterprise.promo_image(:large) if enterprise.promo_image.exists? +end node :icon do |e| - if e.is_primary_producer? + if e.is_primary_producer? and e.is_distributor? + image_path "map-icon-both.svg" + elsif e.is_primary_producer? image_path "map-icon-producer.svg" else image_path "map-icon-hub.svg" diff --git a/app/views/map/index.html.haml b/app/views/map/index.html.haml index 771c9d3ca4..51df083414 100644 --- a/app/views/map/index.html.haml +++ b/app/views/map/index.html.haml @@ -6,7 +6,6 @@ .ofn-map-container{"fill-vertical" => true} %map{"ng-controller" => "MapCtrl"} %google-map{center: "map.center", zoom: "map.zoom", styles: "map.styles", draggable: "true"} - %markers{models: "OfnMap.enterprises", fit: "true", coords: "'self'", icon: "'icon'", click: "'reveal'"}