Commit a0a3986cbbc9402c6c430ee279b78fd91135099c

Authored by MoisesMachado
1 parent 97410c93

ActionItem85: fixed some bugs


git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@782 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/controllers/profile_admin/enterprise_editor_controller.rb
... ... @@ -30,9 +30,12 @@ class EnterpriseEditorController < ProfileAdminController
30 30  
31 31 # Elimitates the enterprise of the system
32 32 def destroy
33   - @enterprise.destroy
34   - flash[:notice] = _('Enterprise sucessfully erased from the system')
35   - redirect_to '/'
  33 + if @enterprise.destroy
  34 + flash[:notice] = _('Enterprise sucessfully erased from the system')
  35 + redirect_to :profile => current_user.login
  36 + else
  37 + redirect_to :action => 'index'
  38 + end
36 39 end
37 40  
38 41 # Activate a validated enterprise
... ...
app/helpers/application_helper.rb
... ... @@ -188,10 +188,10 @@ module ApplicationHelper
188 188  
189 189 def enterprise_links
190 190 links = [
191   - [(link_to_myprofile _('Edit visual design'), {:controller => 'profile_editor', :action => 'design_editor'}, profile), 'edit_profile_design', profile],
192   - [(link_to_myprofile _('Edit informations'), {:controller => 'profile_editor'}, profile), 'edit_profile', profile],
193   - [(link_to_myprofile _('Manage content'), {:controller => 'cms'}, profile), 'post_content', profile],
194   - [(link_to_myprofile _('Exclude'), {:controller => 'enterprise_editor', :action => 'destroy'}, profile), 'edit_profile', profile],
  191 + [(link_to_myprofile _('Edit visual design'), {:controller => 'profile_editor', :action => 'design_editor'}, profile.identifier), 'edit_profile_design', profile],
  192 + [(link_to_myprofile _('Edit informations'), {:controller => 'profile_editor'}, profile.identifier), 'edit_profile', profile],
  193 + [(link_to_myprofile _('Manage content'), {:controller => 'cms'}, profile.identifier), 'post_content', profile],
  194 + [(link_to_myprofile _('Exclude'), {:controller => 'enterprise_editor', :action => 'destroy'}, profile.identifier), 'edit_profile', profile],
195 195 ]
196 196 end
197 197  
... ...
app/models/article.rb
1 1 class Article < Comatose::Page
2 2 acts_as_taggable
3 3  
4   - acts_as_ferret :fields => [:title, :body]
  4 +# acts_as_ferret :fields => [:title, :body]
5 5 def keywords
6 6 tag_list.to_s
7 7 end
... ...
app/models/profile.rb
... ... @@ -43,6 +43,7 @@ class Profile &lt; ActiveRecord::Base
43 43 cms
44 44 community
45 45 test
  46 + search
46 47 ]
47 48  
48 49 acts_as_taggable
... ...
script/anhetegua
... ... @@ -57,7 +57,7 @@ owner_role = Role.create!(:name =&gt; &#39;owner&#39;, :permissions =&gt; [&#39;edit_profile&#39;, &#39;de
57 57 # root user of the system, admin_role for him, the assignment of the role for him and the ownership of the system homepage
58 58 root = User.create!(:login => 'root', :email => 'root@noosfero.org', :password => 'root', :password_confirmation => 'root').person
59 59 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'])
60   -RoleAssignment.create!(:accessor => root, :role => admin_role, :resource => nil)
  60 +RoleAssignment.create!(:accessor => root, :role => admin_role, :resource => Environment.default)
61 61 RoleAssignment.create!(:accessor => root, :role => owner_role, :resource => noosfero)
62 62  
63 63 # Sample user and sample enterprise owned by him
... ...