Commit 75101844a6762523d648105f0bebef5a99f1d788

Authored by Braulio Bhavamitra
2 parents c1b2bd5d 4e7b5d6f

Merge branch 'refactor_sub_organizations' into 'master'

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.

Here follows a travis build: https://travis-ci.org/rafamanzo/noosfero/builds/126868220

See merge request !883
plugins/sub_organizations/lib/related_organizations_block.rb
@@ -39,16 +39,6 @@ class RelatedOrganizationsBlock < ProfileListBlock @@ -39,16 +39,6 @@ class RelatedOrganizationsBlock < ProfileListBlock
39 end 39 end
40 end 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 def related_organizations 42 def related_organizations
53 profile = self.owner 43 profile = self.owner
54 organizations = Organization.parents(profile) 44 organizations = Organization.parents(profile)
plugins/sub_organizations/views/blocks/footers/related_organizations.slim 0 → 100644
@@ -0,0 +1 @@ @@ -0,0 +1 @@
  1 += link_to c_('View all'), profile: block.owner.identifier, controller: 'sub_organizations_plugin_profile', action: block.display_type[:action], type: ((block.organization_type == 'enterprise' || block.organization_type == 'community') ? block.organization_type : nil)