Commit 861eeeb7d110f8970ac2aa5e198fb7ee4f8a3e03

Authored by Rafael Reggiani Manzo
1 parent b9867847

Refactor sub_organizations plugin Block

The method footer was an instance of a model generating HTML and thus
violating MVC. This has been refactored to use the new BoxesHelper
structure for view rendering.
plugins/sub_organizations/lib/related_organizations_block.rb
... ... @@ -39,16 +39,6 @@ class RelatedOrganizationsBlock < ProfileListBlock
39 39 end
40 40 end
41 41  
42   - def footer
43   - profile = self.owner
44   - type = self.organization_type
45   - params = {:profile => profile.identifier, :controller => 'sub_organizations_plugin_profile', :action => display_type[:action]}
46   - params[:type] = type if type == 'enterprise' || type == 'community'
47   - proc do
48   - link_to c_('View all'), params.merge(params)
49   - end
50   - end
51   -
52 42 def related_organizations
53 43 profile = self.owner
54 44 organizations = Organization.parents(profile)
... ...
plugins/sub_organizations/views/blocks/footers/related_organizations.html.erb 0 → 100644
... ... @@ -0,0 +1,8 @@
  1 +<%= link_to c_('View all'),
  2 + {
  3 + profile: block.owner.identifier,
  4 + controller: 'sub_organizations_plugin_profile',
  5 + action: block.display_type[:action],
  6 + type: ((block.organization_type == 'enterprise' || block.organization_type == 'community') ? block.organization_type : nil)
  7 + }
  8 +%>
... ...