From 8b0a64db0856bff0ad5bd082e75d53b168533c38 Mon Sep 17 00:00:00 2001 From: AntonioTerceiro Date: Tue, 6 Nov 2007 14:39:56 +0000 Subject: [PATCH] ActionItem16: moving along with #16 --- app/controllers/application.rb | 5 ----- app/controllers/profile_admin/cms_controller.rb | 2 +- app/controllers/profile_admin/enterprise_editor_controller.rb | 2 +- app/controllers/profile_admin/enterprise_validation_controller.rb | 5 +++++ app/controllers/profile_admin/membership_editor_controller.rb | 2 +- app/controllers/profile_admin/profile_editor_controller.rb | 6 ++++-- app/controllers/profile_admin_controller.rb | 2 ++ 7 files changed, 14 insertions(+), 10 deletions(-) diff --git a/app/controllers/application.rb b/app/controllers/application.rb index cfbcabb..1573abb 100644 --- a/app/controllers/application.rb +++ b/app/controllers/application.rb @@ -40,11 +40,6 @@ class ApplicationController < ActionController::Base end end - def load_profile - @profile ||= Profile.find_by_identifier(params[:profile]) - render_not_found(request.path) unless profile - end - def render_not_found(path) @path = path render :file => File.join(RAILS_ROOT, 'app', 'views', 'shared', 'not_found.rhtml'), :layout => 'not_found', :status => 404 diff --git a/app/controllers/profile_admin/cms_controller.rb b/app/controllers/profile_admin/cms_controller.rb index 55d4c0d..dee7bcc 100644 --- a/app/controllers/profile_admin/cms_controller.rb +++ b/app/controllers/profile_admin/cms_controller.rb @@ -1,7 +1,7 @@ class CmsController < Comatose::AdminController extend PermissionCheck - needs_profile + define_option :page_class, Article diff --git a/app/controllers/profile_admin/enterprise_editor_controller.rb b/app/controllers/profile_admin/enterprise_editor_controller.rb index 6936736..4f4342e 100644 --- a/app/controllers/profile_admin/enterprise_editor_controller.rb +++ b/app/controllers/profile_admin/enterprise_editor_controller.rb @@ -5,7 +5,7 @@ class EnterpriseEditorController < ProfileAdminController protect [:edit, :update], 'edit_profile', :profile protect [:destroy], 'destroy_profile', :profile - needs_profile + # Show details about an enterprise def index diff --git a/app/controllers/profile_admin/enterprise_validation_controller.rb b/app/controllers/profile_admin/enterprise_validation_controller.rb index 5f67fdc..21d04eb 100644 --- a/app/controllers/profile_admin/enterprise_validation_controller.rb +++ b/app/controllers/profile_admin/enterprise_validation_controller.rb @@ -1,3 +1,8 @@ class EnterpriseValidationController < ProfileAdminController + def index + #@pending = profile.pending_validations + render :text => profile.inspect + end + end diff --git a/app/controllers/profile_admin/membership_editor_controller.rb b/app/controllers/profile_admin/membership_editor_controller.rb index 0652007..dbb3ad3 100644 --- a/app/controllers/profile_admin/membership_editor_controller.rb +++ b/app/controllers/profile_admin/membership_editor_controller.rb @@ -2,7 +2,7 @@ class MembershipEditorController < ProfileAdminController before_filter :login_required - needs_profile + protect [:index, :new_enterprise, :create_enterprise ], 'edit_profile', :profile diff --git a/app/controllers/profile_admin/profile_editor_controller.rb b/app/controllers/profile_admin/profile_editor_controller.rb index 941cf90..6bf5be1 100644 --- a/app/controllers/profile_admin/profile_editor_controller.rb +++ b/app/controllers/profile_admin/profile_editor_controller.rb @@ -1,8 +1,10 @@ class ProfileEditorController < ProfileAdminController -# protect [:index, :edit], 'edit_profile', :profile + + #protect [:index, :edit], 'edit_profile', :profile + helper :profile - needs_profile + design_editor :holder => 'profile', :autosave => true, :block_types => :block_types diff --git a/app/controllers/profile_admin_controller.rb b/app/controllers/profile_admin_controller.rb index fbeac79..3a97115 100644 --- a/app/controllers/profile_admin_controller.rb +++ b/app/controllers/profile_admin_controller.rb @@ -1,5 +1,7 @@ class ProfileAdminController < ApplicationController + needs_profile + # declares that the controller needs an specific type of profile. Example: # # class PersonDetailControlles < ProfileAdminController -- libgit2 0.21.2