diff --git a/app/controllers/profile_admin/enterprise_editor_controller.rb b/app/controllers/profile_admin/enterprise_editor_controller.rb index 3243482..1a63ecc 100644 --- a/app/controllers/profile_admin/enterprise_editor_controller.rb +++ b/app/controllers/profile_admin/enterprise_editor_controller.rb @@ -30,9 +30,12 @@ class EnterpriseEditorController < ProfileAdminController # Elimitates the enterprise of the system def destroy - @enterprise.destroy - flash[:notice] = _('Enterprise sucessfully erased from the system') - redirect_to '/' + if @enterprise.destroy + flash[:notice] = _('Enterprise sucessfully erased from the system') + redirect_to :profile => current_user.login + else + redirect_to :action => 'index' + end end # Activate a validated enterprise diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 7374c6f..153296a 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -188,10 +188,10 @@ module ApplicationHelper def enterprise_links links = [ - [(link_to_myprofile _('Edit visual design'), {:controller => 'profile_editor', :action => 'design_editor'}, profile), 'edit_profile_design', profile], - [(link_to_myprofile _('Edit informations'), {:controller => 'profile_editor'}, profile), 'edit_profile', profile], - [(link_to_myprofile _('Manage content'), {:controller => 'cms'}, profile), 'post_content', profile], - [(link_to_myprofile _('Exclude'), {:controller => 'enterprise_editor', :action => 'destroy'}, profile), 'edit_profile', profile], + [(link_to_myprofile _('Edit visual design'), {:controller => 'profile_editor', :action => 'design_editor'}, profile.identifier), 'edit_profile_design', profile], + [(link_to_myprofile _('Edit informations'), {:controller => 'profile_editor'}, profile.identifier), 'edit_profile', profile], + [(link_to_myprofile _('Manage content'), {:controller => 'cms'}, profile.identifier), 'post_content', profile], + [(link_to_myprofile _('Exclude'), {:controller => 'enterprise_editor', :action => 'destroy'}, profile.identifier), 'edit_profile', profile], ] end diff --git a/app/models/article.rb b/app/models/article.rb index 1d2775f..7baea91 100644 --- a/app/models/article.rb +++ b/app/models/article.rb @@ -1,7 +1,7 @@ class Article < Comatose::Page acts_as_taggable - acts_as_ferret :fields => [:title, :body] +# acts_as_ferret :fields => [:title, :body] def keywords tag_list.to_s end diff --git a/app/models/profile.rb b/app/models/profile.rb index 9258652..a5b4b05 100644 --- a/app/models/profile.rb +++ b/app/models/profile.rb @@ -43,6 +43,7 @@ class Profile < ActiveRecord::Base cms community test + search ] acts_as_taggable diff --git a/script/anhetegua b/script/anhetegua index 820ba6e..7c48a22 100644 --- a/script/anhetegua +++ b/script/anhetegua @@ -57,7 +57,7 @@ owner_role = Role.create!(:name => 'owner', :permissions => ['edit_profile', 'de # root user of the system, admin_role for him, the assignment of the role for him and the ownership of the system homepage root = User.create!(:login => 'root', :email => 'root@noosfero.org', :password => 'root', :password_confirmation => 'root').person admin_role = Role.create!(:name => 'admin', :permissions => ['view_environment_admin_panel','edit_environment_features', 'edit_environment_design', 'manage_environment_categories', 'manage_environment_roles', 'manage_environment_validators']) -RoleAssignment.create!(:accessor => root, :role => admin_role, :resource => nil) +RoleAssignment.create!(:accessor => root, :role => admin_role, :resource => Environment.default) RoleAssignment.create!(:accessor => root, :role => owner_role, :resource => noosfero) # Sample user and sample enterprise owned by him -- libgit2 0.21.2