Commit 8b0a64db0856bff0ad5bd082e75d53b168533c38

Authored by AntonioTerceiro
1 parent c032fe70

ActionItem16: moving along with #16



git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@852 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/controllers/application.rb
@@ -40,11 +40,6 @@ class ApplicationController < ActionController::Base @@ -40,11 +40,6 @@ class ApplicationController < ActionController::Base
40 end 40 end
41 end 41 end
42 42
43 - def load_profile  
44 - @profile ||= Profile.find_by_identifier(params[:profile])  
45 - render_not_found(request.path) unless profile  
46 - end  
47 -  
48 def render_not_found(path) 43 def render_not_found(path)
49 @path = path 44 @path = path
50 render :file => File.join(RAILS_ROOT, 'app', 'views', 'shared', 'not_found.rhtml'), :layout => 'not_found', :status => 404 45 render :file => File.join(RAILS_ROOT, 'app', 'views', 'shared', 'not_found.rhtml'), :layout => 'not_found', :status => 404
app/controllers/profile_admin/cms_controller.rb
1 class CmsController < Comatose::AdminController 1 class CmsController < Comatose::AdminController
2 extend PermissionCheck 2 extend PermissionCheck
3 3
4 - needs_profile 4 +
5 5
6 define_option :page_class, Article 6 define_option :page_class, Article
7 7
app/controllers/profile_admin/enterprise_editor_controller.rb
@@ -5,7 +5,7 @@ class EnterpriseEditorController &lt; ProfileAdminController @@ -5,7 +5,7 @@ class EnterpriseEditorController &lt; ProfileAdminController
5 protect [:edit, :update], 'edit_profile', :profile 5 protect [:edit, :update], 'edit_profile', :profile
6 protect [:destroy], 'destroy_profile', :profile 6 protect [:destroy], 'destroy_profile', :profile
7 7
8 - needs_profile 8 +
9 9
10 # Show details about an enterprise 10 # Show details about an enterprise
11 def index 11 def index
app/controllers/profile_admin/enterprise_validation_controller.rb
1 class EnterpriseValidationController < ProfileAdminController 1 class EnterpriseValidationController < ProfileAdminController
2 2
  3 + def index
  4 + #@pending = profile.pending_validations
  5 + render :text => profile.inspect
  6 + end
  7 +
3 end 8 end
app/controllers/profile_admin/membership_editor_controller.rb
@@ -2,7 +2,7 @@ class MembershipEditorController &lt; ProfileAdminController @@ -2,7 +2,7 @@ class MembershipEditorController &lt; ProfileAdminController
2 2
3 before_filter :login_required 3 before_filter :login_required
4 4
5 - needs_profile 5 +
6 6
7 protect [:index, :new_enterprise, :create_enterprise ], 'edit_profile', :profile 7 protect [:index, :new_enterprise, :create_enterprise ], 'edit_profile', :profile
8 8
app/controllers/profile_admin/profile_editor_controller.rb
1 class ProfileEditorController < ProfileAdminController 1 class ProfileEditorController < ProfileAdminController
2 -# protect [:index, :edit], 'edit_profile', :profile 2 +
  3 + #protect [:index, :edit], 'edit_profile', :profile
  4 +
3 helper :profile 5 helper :profile
4 6
5 - needs_profile 7 +
6 8
7 design_editor :holder => 'profile', :autosave => true, :block_types => :block_types 9 design_editor :holder => 'profile', :autosave => true, :block_types => :block_types
8 10
app/controllers/profile_admin_controller.rb
1 class ProfileAdminController < ApplicationController 1 class ProfileAdminController < ApplicationController
2 2
  3 + needs_profile
  4 +
3 # declares that the controller needs an specific type of profile. Example: 5 # declares that the controller needs an specific type of profile. Example:
4 # 6 #
5 # class PersonDetailControlles < ProfileAdminController 7 # class PersonDetailControlles < ProfileAdminController