noosfero | Add type filter on manage organization page on admin panel (#527)
Rodrigo Souto
gitlab at gitlab.com
Thu May 7 13:45:26 BRT 2015
New comment for Merge Request 527
https://gitlab.com/noosfero/noosfero/merge_requests/527#note_1202548
Rodrigo Souto
Instead of using these keys ('communities', 'enterprises', etc.) to apply the correct scope, what do you think of doing something like this:
```
@types_filter = [['All', 'any'], [_('Community'), 'Community'], [_('Enterprise'), 'Enterprise']]
@types_filter = @types_filter | @plugins.dispatch_without_flatten(:organization_types_filter_options).flatten(1)
if @type == 'any'
environment.organizations
else
environment.profiles.where(:type => type)
end
```
This way you also escape the need of this new hotspot `filter_manage_organization_scope` since whatever type a plugin provides through `organization_types_filter_options` will just work.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20150507/1e1e0491/attachment-0001.html>
More information about the Noosfero-dev
mailing list