diff --git a/app/controllers/enterprise_controller.rb b/app/controllers/enterprise_controller.rb index 7e8bc0f..e43d17b 100644 --- a/app/controllers/enterprise_controller.rb +++ b/app/controllers/enterprise_controller.rb @@ -30,7 +30,7 @@ class EnterpriseController < ApplicationController @enterprise.organization_info = OrganizationInfo.new(params[:organization]) if @enterprise.save @enterprise.people << @person - flash[:notice] = _('Enterprise was succesfully created') + flash[:notice] = _('The enterprise was succesfully created, the validation entity will cotact you as soon as your enterprise is approved') redirect_to :action => 'index' else flash[:notice] = _('Enterprise was not created') @@ -72,6 +72,16 @@ class EnterpriseController < ApplicationController @tagged_enterprises = Enterprise.find_tagged_with(params[:query]) end + def activate + @enterprise = Enterprise.find(params[:id]) + if @enterprise.update_attribute('active', true) + flash[:notice] = 'Enterprise successfuly activacted' + render :action => 'show' + else + redirect_to :action => 'show', :id => @enterprise + end + end + protected def logon diff --git a/app/views/enterprise/_search_box.rhtml b/app/views/enterprise/_search_box.rhtml new file mode 100644 index 0000000..895590d --- /dev/null +++ b/app/views/enterprise/_search_box.rhtml @@ -0,0 +1,6 @@ + diff --git a/app/views/enterprise/list.rhtml b/app/views/enterprise/list.rhtml index 47b5dd1..d6e468e 100644 --- a/app/views/enterprise/list.rhtml +++ b/app/views/enterprise/list.rhtml @@ -1,11 +1,7 @@ - +<%= render :partial => 'search_box' %>

<%= link_to _('Register new enterprise'), :action => 'register_form' %>

+

<%= _('Listing my enterprises') %>