From 38643752abd32b742ef4ec3b811daddf8f81e87c Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Wed, 4 Jan 2012 21:24:04 +0300 Subject: [PATCH] Drop temporary plugin view_paths integration --- app/controllers/my_profile/cms_controller.rb | 8 -------- app/controllers/public/content_viewer_controller.rb | 8 -------- lib/noosfero/plugin.rb | 6 ------ plugins/mezuro/lib/mezuro_plugin.rb | 6 +----- test/functional/cms_controller_test.rb | 17 +++-------------- 5 files changed, 4 insertions(+), 41 deletions(-) diff --git a/app/controllers/my_profile/cms_controller.rb b/app/controllers/my_profile/cms_controller.rb index 989d223..6bf1c4b 100644 --- a/app/controllers/my_profile/cms_controller.rb +++ b/app/controllers/my_profile/cms_controller.rb @@ -79,7 +79,6 @@ class CmsController < MyProfileController end def edit - plugins_prepend_view_paths @article = profile.articles.find(params[:id]) @parent_id = params[:parent_id] @type = params[:type] || @article.class.to_s @@ -103,7 +102,6 @@ class CmsController < MyProfileController end def new - plugins_prepend_view_paths # FIXME this method should share some logic wirh edit !!! # user must choose an article type first @@ -355,12 +353,6 @@ class CmsController < MyProfileController end.to_json end - def plugins_prepend_view_paths - @plugins.map(:view_path).each do |view_path| - prepend_view_path(view_path) - end - end - def content_editor? true end diff --git a/app/controllers/public/content_viewer_controller.rb b/app/controllers/public/content_viewer_controller.rb index 957b945..6ec74ab 100644 --- a/app/controllers/public/content_viewer_controller.rb +++ b/app/controllers/public/content_viewer_controller.rb @@ -6,7 +6,6 @@ class ContentViewerController < ApplicationController helper TagsHelper def view_page - plugins_prepend_view_paths path = params[:page].join('/') if path.blank? @@ -152,12 +151,5 @@ class ContentViewerController < ApplicationController end end end - - # FIXME duplicated - def plugins_prepend_view_paths - @plugins.map(:view_path).each do |view_path| - prepend_view_path(view_path) - end - end end diff --git a/lib/noosfero/plugin.rb b/lib/noosfero/plugin.rb index bd50cbb..67adbe7 100644 --- a/lib/noosfero/plugin.rb +++ b/lib/noosfero/plugin.rb @@ -111,12 +111,6 @@ class Noosfero::Plugin nil end - # -> Can be used to add plugin-specific view paths to controllers - # returns = { plugins' view paths } - def view_path - nil - end - # -> Adds content to calalog item # returns = lambda block that creates a html code def catalog_item_extras(item) diff --git a/plugins/mezuro/lib/mezuro_plugin.rb b/plugins/mezuro/lib/mezuro_plugin.rb index 2a683e2..ebd3ab3 100644 --- a/plugins/mezuro/lib/mezuro_plugin.rb +++ b/plugins/mezuro/lib/mezuro_plugin.rb @@ -12,10 +12,6 @@ class MezuroPlugin < Noosfero::Plugin MezuroPlugin::ProjectContent end - def view_path - File.join(RAILS_ROOT, "plugins", "mezuro", "views") - end - def stylesheet? true end @@ -24,4 +20,4 @@ class MezuroPlugin < Noosfero::Plugin 'javascripts/collapsable.js' end -end \ No newline at end of file +end diff --git a/test/functional/cms_controller_test.rb b/test/functional/cms_controller_test.rb index a071304..c99ebf9 100644 --- a/test/functional/cms_controller_test.rb +++ b/test/functional/cms_controller_test.rb @@ -1514,25 +1514,14 @@ class CmsControllerTest < ActionController::TestCase plugins = mock() plugins.stubs(:map).with(:content_types).returns(types) plugins.stubs(:map).with(:body_beginning).returns([]) + plugins.stubs(:map).with(:head_ending).returns([]) plugins.stubs(:enabled_plugins).returns([]) - Noosfero::Plugin::Manager.expects(:new).returns(plugins) + Noosfero::Plugin::Manager.expects(:new).returns(plugins) get :index, :profile => profile.identifier assert_includes @controller.special_article_types, Integer - assert_includes @controller.special_article_types, Float - end - - should 'include plugins view paths on partial search' do - view_path = '/example/view_path' - plugins = mock() - plugins.stubs(:map).with(:view_path).returns(view_path) - plugins.stubs(:enabled_plugins).returns([]) - Noosfero::Plugin::Manager.expects(:new).returns(plugins) - - get :new, :profile => profile.identifier - - assert_equal view_path, @controller.view_paths[0] + assert_includes @controller.special_article_types, Float end end -- libgit2 0.21.2