Commit a0a3986cbbc9402c6c430ee279b78fd91135099c
1 parent
97410c93
Exists in
master
and in
29 other branches
ActionItem85: fixed some bugs
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@782 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
5 changed files
with
13 additions
and
9 deletions
Show diff stats
app/controllers/profile_admin/enterprise_editor_controller.rb
@@ -30,9 +30,12 @@ class EnterpriseEditorController < ProfileAdminController | @@ -30,9 +30,12 @@ class EnterpriseEditorController < ProfileAdminController | ||
30 | 30 | ||
31 | # Elimitates the enterprise of the system | 31 | # Elimitates the enterprise of the system |
32 | def destroy | 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 | end | 39 | end |
37 | 40 | ||
38 | # Activate a validated enterprise | 41 | # Activate a validated enterprise |
app/helpers/application_helper.rb
@@ -188,10 +188,10 @@ module ApplicationHelper | @@ -188,10 +188,10 @@ module ApplicationHelper | ||
188 | 188 | ||
189 | def enterprise_links | 189 | def enterprise_links |
190 | links = [ | 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 | end | 196 | end |
197 | 197 |
app/models/article.rb
app/models/profile.rb
script/anhetegua
@@ -57,7 +57,7 @@ owner_role = Role.create!(:name => 'owner', :permissions => ['edit_profile', 'de | @@ -57,7 +57,7 @@ owner_role = Role.create!(:name => 'owner', :permissions => ['edit_profile', 'de | ||
57 | # root user of the system, admin_role for him, the assignment of the role for him and the ownership of the system homepage | 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 | root = User.create!(:login => 'root', :email => 'root@noosfero.org', :password => 'root', :password_confirmation => 'root').person | 58 | root = User.create!(:login => 'root', :email => 'root@noosfero.org', :password => 'root', :password_confirmation => 'root').person |
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']) | 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 | RoleAssignment.create!(:accessor => root, :role => owner_role, :resource => noosfero) | 61 | RoleAssignment.create!(:accessor => root, :role => owner_role, :resource => noosfero) |
62 | 62 | ||
63 | # Sample user and sample enterprise owned by him | 63 | # Sample user and sample enterprise owned by him |