diff --git a/app/assets/javascripts/darkswarm/filters/filter_groups.js.coffee b/app/assets/javascripts/darkswarm/filters/filter_groups.js.coffee new file mode 100644 index 0000000000..e6572ec5c2 --- /dev/null +++ b/app/assets/javascripts/darkswarm/filters/filter_groups.js.coffee @@ -0,0 +1,10 @@ +Darkswarm.filter "groups", (Matcher)-> + (groups, text)-> + groups ||= [] + text ?= "" + + groups.filter (group)=> + Matcher.match([ + group.name, group.description, group.long_description + ], text) || group.enterprises.some (e)-> + Matcher.match [e.name], text diff --git a/app/views/groups/index.html.haml b/app/views/groups/index.html.haml index 059abfe882..f2ae6e550a 100644 --- a/app/views/groups/index.html.haml +++ b/app/views/groups/index.html.haml @@ -20,7 +20,7 @@ "ng-debounce" => "150", "ofn-disable-enter" => true} - .group{"ng-repeat" => "group in Groups.groups | filter:query | orderBy:order", + .group{"ng-repeat" => "group in Groups.groups | groups:query | orderBy:order", name: "group{{group.id}}", id: "group{{group.id}}"} .row.pad-top{bindonce: true}