[Git][noosfero/noosfero][master] 3 commits: Refactor sub_organizations plugin Block
Bráulio Bhavamitra
gitlab at mg.gitlab.com
Sun May 1 20:17:42 BRT 2016
Bráulio Bhavamitra pushed to branch master at Noosfero / noosfero
Commits:
861eeeb7 by Rafael Reggiani Manzo at 2016-04-30T08:54:24-03:00
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.
- - - - -
4e7b5d6f by Rafael Reggiani Manzo at 2016-04-30T10:01:36-03:00
Convert RelatedOrganizationsBlock footer to slim
This should improve the view readability, as mentioned by @brauliobo on
MR !833.
- - - - -
75101844 by Bráulio Bhavamitra at 2016-05-01T23:17:15+00:00
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
- - - - -
2 changed files:
- plugins/sub_organizations/lib/related_organizations_block.rb
- + plugins/sub_organizations/views/blocks/footers/related_organizations.slim
Changes:
=====================================
plugins/sub_organizations/lib/related_organizations_block.rb
=====================================
--- a/plugins/sub_organizations/lib/related_organizations_block.rb
+++ b/plugins/sub_organizations/lib/related_organizations_block.rb
@@ -39,16 +39,6 @@ class RelatedOrganizationsBlock < ProfileListBlock
end
end
- def footer
- profile = self.owner
- type = self.organization_type
- params = {:profile => profile.identifier, :controller => 'sub_organizations_plugin_profile', :action => display_type[:action]}
- params[:type] = type if type == 'enterprise' || type == 'community'
- proc do
- link_to c_('View all'), params.merge(params)
- end
- end
-
def related_organizations
profile = self.owner
organizations = Organization.parents(profile)
=====================================
plugins/sub_organizations/views/blocks/footers/related_organizations.slim
=====================================
--- /dev/null
+++ b/plugins/sub_organizations/views/blocks/footers/related_organizations.slim
@@ -0,0 +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)
View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/c1b2bd5d6a13b014dd2786021d0c625e95256559...75101844a6762523d648105f0bebef5a99f1d788
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20160501/cb945efa/attachment-0001.html>
More information about the Noosfero-dev
mailing list