add map modals, profile filters and bugfixes

This commit is contained in:
Rafael Schouten
2014-09-19 17:07:07 +10:00
parent cf13115d57
commit abc5a215a2
13 changed files with 49 additions and 29 deletions

View File

@@ -1,4 +1,4 @@
Darkswarm.controller "HubsCtrl", ($scope, Hubs, Search, $document, $rootScope, HashNavigation, FilterSelectorsService) ->
Darkswarm.controller "HubsCtrl", ($scope, Hubs, Search, $document, $rootScope, HashNavigation, FilterSelectorsService, MapModal) ->
$scope.Hubs = Hubs
$scope.hubs = Hubs.visible
$scope.totalActive = FilterSelectorsService.totalActive
@@ -6,6 +6,8 @@ Darkswarm.controller "HubsCtrl", ($scope, Hubs, Search, $document, $rootScope, H
$scope.filterText = FilterSelectorsService.filterText
$scope.FilterSelectorsService = FilterSelectorsService
$scope.query = Search.search()
$scope.show_profiles = false
$scope.openModal = MapModal.open
$scope.$watch "query", (query)->
Search.search query

View File

@@ -1,4 +1,4 @@
Darkswarm.controller "ProducersCtrl", ($scope, Producers, $filter, FilterSelectorsService, Search) ->
Darkswarm.controller "ProducersCtrl", ($scope, Producers, $filter, FilterSelectorsService, Search, MapModal) ->
$scope.Producers = Producers
$scope.totalActive = FilterSelectorsService.totalActive
$scope.clearAll = FilterSelectorsService.clearAll
@@ -7,6 +7,8 @@ Darkswarm.controller "ProducersCtrl", ($scope, Producers, $filter, FilterSelecto
$scope.filtersActive = false
$scope.activeTaxons = []
$scope.query = Search.search()
$scope.show_profiles = false
$scope.openModal = MapModal.open
$scope.$watch "query", (query)->
Search.search query

View File

@@ -0,0 +1,7 @@
Darkswarm.filter 'showProfiles', ()->
(enterprises, show_profiles) ->
enterprises ||= []
show_profiles ?= true
enterprises.filter (enterprise)=>
show_profiles or not enterprise.is_profile

View File

@@ -2,7 +2,7 @@ Darkswarm.factory 'Hubs', ($filter, Enterprises, visibleFilter) ->
new class Hubs
constructor: ->
@hubs = @order Enterprises.enterprises.filter (hub)->
hub.is_distributor && hub.has_shopfront
hub.is_distributor
@visible = visibleFilter @hubs
order: (hubs)->

View File

@@ -1,9 +1,12 @@
.highlight{"ng-class" => "{'has_shopfront' : enterprise.has_shopfront}"}
.highlight
.highlight-top
%p.right
{{ [enterprise.address.city, enterprise.address.state_name] | printArray}}
%h3
%h3{"ng-if" => "enterprise.has_shopfront"}
%a{"bo-href" => "enterprise.path", "ofn-empties-cart" => "enterprise", bindonce: true}
%i{"ng-class" => "enterprise.icon_font"}
%span {{ enterprise.name }}
%span {{ enterprise.name }}
%h3{"ng-if" => "!enterprise.has_shopfront"}
%i{"ng-class" => "enterprise.icon_font"}
%span {{ enterprise.name }}
%img.hero-img{"ng-src" => "{{enterprise.promo_image}}"}