Extract hubs table into partial

This commit is contained in:
Rohan Mitchell
2015-07-02 15:17:44 +10:00
parent 7f2508eeaa
commit 97c9504344
2 changed files with 15 additions and 14 deletions

View File

@@ -5,18 +5,7 @@
.small-12.columns
%h1{"scroll-after-load" => (spree_current_user ? true : nil)} Shop in your local area
= render partial: "shared/components/enterprise_search"
= render partial: "home/filters"
= render "shared/components/enterprise_search"
= render "home/filters"
.row{bindonce: true}
.small-12.columns
.active_table
%hub.active_table_node.row.animate-repeat{"ng-repeat" => "hub in filteredEnterprises = (Enterprises.hubs | visible | taxons:activeTaxons | shipping:shippingTypes | showHubProfiles:show_profiles | orderBy:['-active', '-matches_name_query', '+distance', '+orders_close_at'])",
"ng-class" => "{'is_profile' : hub.category == 'hub_profile', 'closed' : !open(), 'open' : open(), 'inactive' : !hub.active, 'current' : current()}",
"ng-controller" => "HubNodeCtrl",
id: "{{hub.hash}}"}
.small-12.columns
= render partial: 'home/skinny'
= render partial: 'home/fat'
= render partial: 'shared/components/enterprise_no_results'
= render "home/hubs_table", filters: "visible | taxons:activeTaxons | shipping:shippingTypes | showHubProfiles:show_profiles", order_by: "['-active', '-matches_name_query', '+distance', '+orders_close_at']"

View File

@@ -0,0 +1,12 @@
.row{bindonce: true}
.small-12.columns
.active_table
%hub.active_table_node.row.animate-repeat{"ng-repeat" => "hub in filteredEnterprises = (Enterprises.hubs | #{filters} | orderBy:#{order_by})",
"ng-class" => "{'is_profile' : hub.category == 'hub_profile', 'closed' : !open(), 'open' : open(), 'inactive' : !hub.active, 'current' : current()}",
"ng-controller" => "HubNodeCtrl",
id: "{{hub.hash}}"}
.small-12.columns
= render partial: 'home/skinny'
= render partial: 'home/fat'
= render partial: 'shared/components/enterprise_no_results'