Commit 93c6a41f36472cd23f2b7fc68938f904cfbec063

Authored by AntonioTerceiro
1 parent 32ab46c6

ActionItem65: creating base controllers and making the ones in the folders inherit from them



git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@489 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/controllers/environment_admin/admin_panel_controller.rb
1   -class AdminPanelController < ApplicationController
  1 +class AdminPanelController < EnvironmentAdminController
2 2 end
... ...
app/controllers/environment_admin/edit_template_controller.rb
1   -class EditTemplateController < ApplicationController
  1 +class EditTemplateController < EnvironmentAdminController
2 2  
3 3 design_editor :holder => 'virtual_community', :autosave => true, :block_types => :block_types
4 4  
... ...
app/controllers/environment_admin/features_controller.rb
1   -class FeaturesController < ApplicationController
  1 +class FeaturesController < EnvironmentAdminController
2 2  
3 3 acts_as_virtual_community_admin_controller
4 4  
... ...
app/controllers/environment_admin/manage_tags_controller.rb
1 1 # Manage tags stored by the acts-as_taggable_on_steroids plugin by providing an interface to create, destroy, update and list them
2   -class ManageTagsController < ApplicationController
  2 +class ManageTagsController < EnvironmentAdminController
3 3  
4 4 # Index redirects to list action without modifing the url
5 5 def index
... ...
app/controllers/environment_admin/role_controller.rb
1   -class RoleController < ApplicationController
  1 +class RoleController < EnvironmentAdminController
2 2 def index
3 3 @roles = Role.find(:all)
4 4 end
... ...
app/controllers/environment_admin_controller.rb 0 → 100644
... ... @@ -0,0 +1,2 @@
  1 +class EnvironmentAdminController < ApplicationController
  2 +end
... ...
app/controllers/profile_admin/enterprise_controller.rb
1 1 # Manage enterprises by providing an interface to register, activate and manage them
2   -class EnterpriseController < ApplicationController
  2 +class EnterpriseController < ProfileAdminController
3 3  
4 4 before_filter :logon, :my_enterprises
5 5  
... ...
app/controllers/profile_admin/profile_editor_controller.rb
1   -class ProfileEditorController < ApplicationController
  1 +class ProfileEditorController < ProfileAdminController
2 2 helper :profile
3 3  
4 4 # edits the profile info (posts back)
... ...
app/controllers/profile_admin_controller.rb 0 → 100644
... ... @@ -0,0 +1,2 @@
  1 +class ProfileAdminController < ApplicationController
  2 +end
... ...
app/controllers/public/account_controller.rb
1   -class AccountController < ApplicationController
  1 +class AccountController < PublicController
2 2  
3 3 # say something nice, you goof! something sweet.
4 4 def index
... ...
app/controllers/public/content_viewer_controller.rb
1   -class ContentViewerController < ApplicationController
  1 +class ContentViewerController < PublicController
2 2  
3 3 def view_page
4 4 path = params[:page].clone
... ...
app/controllers/public/home_controller.rb
1   -class HomeController < ApplicationController
  1 +class HomeController < PublicController
2 2  
3 3 design :holder => 'virtual_community'
4 4  
... ...
app/controllers/public_controller.rb 0 → 100644
... ... @@ -0,0 +1,2 @@
  1 +class PublicController < ApplicationController
  2 +end
... ...
app/controllers/system_admin_controller.rb 0 → 100644
... ... @@ -0,0 +1,2 @@
  1 +class SystemAdminController < ApplicationController
  2 +end
... ...
test/functional/environment_admin_controller_test.rb 0 → 100644
... ... @@ -0,0 +1,18 @@
  1 +require File.dirname(__FILE__) + '/../test_helper'
  2 +require 'environment_admin_controller'
  3 +
  4 +# Re-raise errors caught by the controller.
  5 +class EnvironmentAdminController; def rescue_action(e) raise e end; end
  6 +
  7 +class EnvironmentAdminControllerTest < Test::Unit::TestCase
  8 + def setup
  9 + @controller = EnvironmentAdminController.new
  10 + @request = ActionController::TestRequest.new
  11 + @response = ActionController::TestResponse.new
  12 + end
  13 +
  14 + # Replace this with your real tests.
  15 + def test_truth
  16 + assert true
  17 + end
  18 +end
... ...
test/functional/profile_admin_controller_test.rb 0 → 100644
... ... @@ -0,0 +1,18 @@
  1 +require File.dirname(__FILE__) + '/../test_helper'
  2 +require 'profile_admin_controller'
  3 +
  4 +# Re-raise errors caught by the controller.
  5 +class ProfileAdminController; def rescue_action(e) raise e end; end
  6 +
  7 +class ProfileAdminControllerTest < Test::Unit::TestCase
  8 + def setup
  9 + @controller = ProfileAdminController.new
  10 + @request = ActionController::TestRequest.new
  11 + @response = ActionController::TestResponse.new
  12 + end
  13 +
  14 + # Replace this with your real tests.
  15 + def test_truth
  16 + assert true
  17 + end
  18 +end
... ...
test/functional/public_controller_test.rb 0 → 100644
... ... @@ -0,0 +1,18 @@
  1 +require File.dirname(__FILE__) + '/../test_helper'
  2 +require 'public_controller'
  3 +
  4 +# Re-raise errors caught by the controller.
  5 +class PublicController; def rescue_action(e) raise e end; end
  6 +
  7 +class PublicControllerTest < Test::Unit::TestCase
  8 + def setup
  9 + @controller = PublicController.new
  10 + @request = ActionController::TestRequest.new
  11 + @response = ActionController::TestResponse.new
  12 + end
  13 +
  14 + # Replace this with your real tests.
  15 + def test_truth
  16 + assert true
  17 + end
  18 +end
... ...
test/functional/system_admin_controller_test.rb 0 → 100644
... ... @@ -0,0 +1,18 @@
  1 +require File.dirname(__FILE__) + '/../test_helper'
  2 +require 'system_admin_controller'
  3 +
  4 +# Re-raise errors caught by the controller.
  5 +class SystemAdminController; def rescue_action(e) raise e end; end
  6 +
  7 +class SystemAdminControllerTest < Test::Unit::TestCase
  8 + def setup
  9 + @controller = SystemAdminController.new
  10 + @request = ActionController::TestRequest.new
  11 + @response = ActionController::TestResponse.new
  12 + end
  13 +
  14 + # Replace this with your real tests.
  15 + def test_truth
  16 + assert true
  17 + end
  18 +end
... ...