Adding data to groups page

This commit is contained in:
Will Marshall
2014-05-20 10:47:09 +10:00
parent 61cf35a5b9
commit e7f6a9badf
6 changed files with 29 additions and 18 deletions

View File

@@ -12,8 +12,14 @@
"ng-debounce" => "150",
"ofn-disable-enter" => true}
.row{bindonce: true}
.row.group_table{bindonce: true}
.small.12.columns
.group_table
.group{"ng-repeat" => "group in Groups.groups | filter:query | orderBy:order"}
{{ group.name }}
.group{"ng-repeat" => "group in Groups.groups | filter:query | orderBy:order"}
%h2 {{ group.name }}
%p {{ group.description }}
%p {{ group.long_description }}
%img{"bo-src" => "group.logo"}
%ul
%li{"ng-repeat" => "enterprise in group.enterprises"}
%a{"bo-href" => "enterprise.path"} {{ enterprise.name }}

View File

@@ -4,3 +4,11 @@ attributes :name, :id, :description
child :address do
extends "json/partials/address"
end
node :path do |enterprise|
shop_enterprise_path(enterprise)
end
node :hash do |enterprise|
enterprise.to_param
end

View File

@@ -1,2 +1,10 @@
collection @groups
attributes :id, :name, :position
attributes :id, :name, :position, :description, :long_description
child enterprises: :enterprises do
extends 'json/enterprises'
end
node :logo do |group|
group.logo(:original)
end

View File

@@ -21,14 +21,6 @@ node :delivery do |hub|
not hub.shipping_methods.where(:require_ship_address => true).empty?
end
node :path do |hub|
shop_enterprise_path(hub)
end
node :hash do |hub|
hub.to_param
end
node :active do |hub|
@active_distributors.include?(hub)
end

View File

@@ -21,7 +21,7 @@
%span.nav-primary Producers
%li.divider
%li
%a{href: ""}
%a{href: groups_path}
%span.nav-primary Groups
%li.divider
- if spree_current_user.andand.has_spree_role? 'admin'

View File

@@ -36,17 +36,14 @@
%li
%a{href: root_path + "#/#hubs"}
%span.nav-primary Hubs
%li
%a{href: ""}
%span.nav-primary Map
%li
%a{href: main_app.producers_path}
%span.nav-primary Producers
%li
%a{href: ""}
%a{href: groups_path}
%span.nav-primary Groups